This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(js size): Add a default @MirrorsUsed to Angular.
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ library todo; | |
|
||
import 'package:angular/angular.dart'; | ||
|
||
|
||
class Item { | ||
String text; | ||
bool done; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,42 @@ import 'dart:js' as js; | |
import 'package:di/di.dart'; | ||
import 'package:di/dynamic_injector.dart'; | ||
|
||
/** | ||
* This @MirrorsUsed annotation is doing two things: | ||
* - setting "override: *", which will cause any library that is not tagged | ||
* with @MirrorsUsed to be potentially shaken out of the production binary. | ||
* - setting targets. All classes inside of Angular will be preserved, as | ||
* well as any class tagged with the annotations listed in metaTargets. | ||
* | ||
* If you are writing code accessed from Angular expressions, you must include | ||
* your own @MirrorsUsed annotation or ensure that everything is tagged with | ||
* the Ng annotations. | ||
* | ||
* This is a short-term fix until we implement a transformer-based solution | ||
* which does not rely on mirrors. | ||
*/ | ||
@MirrorsUsed(targets: const[ | ||
'angular', | ||
'angular.core', | ||
'angular.core.dom', | ||
'angular.filter', | ||
'angular.perf', | ||
'angular.directive', | ||
'angular.routing', | ||
'angular.core.parser.dynamic_parser', | ||
'angular.core.parser.lexer', | ||
'perf_api', | ||
'List', | ||
'NodeTreeSanitizer', | ||
], | ||
metaTargets: const[ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jbdeboer
via email
Author
Contributor
|
||
'NgInjectableService', | ||
'NgDirective', | ||
'NgController', | ||
'NgComponent' | ||
]) | ||
import 'dart:mirrors'; | ||
|
||
import 'package:angular/core/module.dart'; | ||
import 'package:angular/core_dom/module.dart'; | ||
import 'package:angular/directive/module.dart'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 1fd1bd0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
What about NgFilter?