Create transformers that allow specifying transformer actions on
specific libraries.
* angular2/transform/codegen: Generates all necessary code.
* angular2/transform/reflection_rewriter: Replaces `bootstrap` calls in
application entry points to remove transitive dart:mirrors import,
resulting in smaller code size & faster execution.
* angular2/transform/deferred_rewriter: Rewrites deferred imports and
`loadLibrary` calls to initialize Angular2 and preserve deferred
operation.
Proper configuration of these three transformers can replace the single
angular2 transformer, resulting in significant performance gains for
builds of large angular2 apps.
Update angular2 itself to declare the codegen transformer, since it has
neither deferred imports nor application entry points.
Remove the undocumented & unused quick_transformer.
Instead of running with karma and the karma-dart shim, run dart
tests directly using the new package:test runner. This migrates
away from package:unittest.
Fixes a couple tests, mostly associated with depending on absolute
URLs or editing the test providers after an injector had already
been created.
Remove karma-dart and associated files. Change gupfiles to run tests
via `pub run test` instead.
Widen version dependencies for `package:angular`, `package:code_transformers`,
and `package:observe`.
`package:guinness` uses `package:unittest` while
the newest versions of `package:code_transformers` use `package:test`.
This causes our end-to-end Dart transformer tests (which use testing
code in `package:code_transformers`) to be skipped.
To fix this:
- Move e2e tests to run in a separate file
- Run `gulp test.server.dart` tests serially
Closes#5922Closes#5935
Replace uses of `package:code_transformers`, which is only used to
convert from uri to `AssetId`, with calls to the utility methods in
`src/transform/common/url_resolver.dart`.
Closes#5931
A new verion is causing build issues, perhaps due to an undeclared
dependency on package:test. For now, lock down the version to the
last known working one.
We used to use different external css parsers,
depending on the `DomAdapter`. This lead to
inconsistent behavior and environment specific errors.
Closes#5006Closes#4993
Add two transform parameters to aid in debugging the transformer
- `mirror_mode`, with values {`debug`, `none`, and `verbose`}
- `init_reflector`, with values {`true`, `false`}
`mirror_mode`:
- `debug`: Allow reflective access, but log a message if it is used
- `none`: Remove reflective access, `throw` if it is used. Default value
- `verbose`: Allow reflective access, log a stack trace if it is used
`init_reflector`: Whether to generate calls to our generated
`initReflector` code.
These will be useful to reveal areas where the transformer is not generating
appropriate code and to quickly see where reflective accesses occur.
When the pub mode is `transform_dynamic`, we run in MirrorMode.debug
with `init_reflector = false`. This is used for testing purposes.
Create a method that recursively walks imports from an entry point and
determines where classes are registered.
Use this information to determine if a particular annotation implements or
extends Injectable or Template.
Add a transformer for `di` which generates `.ng_deps.dart` files for all
`.dart` files it is run on. These `.ng_deps.dart` files register
metadata for any `@Injectable` classes.
Fix unit tests for changes introduced by the di transformer.
When using `pub (build|serve) --mode=ngstatic`, we will also generate
getters and setters, parse templates, and remove import of `dart:mirrors`
in the Angular transform. Because this is still relatively immature, we
use the mode to keep it opt-in for now.
Closes#700