angular-cn/packages/compiler-cli/test
Paul Gschwendtner 66e6b932d8 refactor(compiler-cli): skip class decorators in tooling constructor parameters transform (#37545)
We recently added a transformer to NGC that is responsible for downleveling Angular
decorators and constructor parameter types. The primary goal was to mitigate a
TypeScript limitation/issue that surfaces in Angular projects due to the heavy
reliance on type metadata being captured for DI. Additionally this is a pre-requisite
of making `tsickle` optional in the Angular bazel toolchain.

See: 401ef71ae5 for more context on this.

Another (less important) goal was to make sure that the CLI can re-use
this transformer for its JIT mode compilation. The CLI (as outlined in
the commit mentioned above), already has a transformer for downleveling
constructor parameters. We want to avoid this duplication and exported
the transform through the tooling-private compiler entry-point.

Early experiments in using this transformer over the current one, highlighted
that in JIT, class decorators cannot be downleveled. Angular relies on those
to be invoked immediately for JIT (so that factories etc. are generated upon loading)

The transformer we exposed, always downlevels such class decorators
though, so that would break CLI's JIT mode. We can address the CLI's
needs by adding another flag to skip class decorators. This will allow
us to continue with the goal of de-duplication.

PR Close #37545
2020-06-15 12:47:57 -07:00
..
compliance build: update to typescript 3.9.5 (#37456) 2020-06-11 12:05:33 -07:00
diagnostics build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
helpers fix(ngcc): correctly get config for sub-entry-points when primary entry-point is ignored (#37040) 2020-06-11 18:58:36 -07:00
metadata build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngtsc feat(core): support injection token as predicate in queries (#37506) 2020-06-11 13:21:11 -07:00
transformers refactor(compiler-cli): skip class decorators in tooling constructor parameters transform (#37545) 2020-06-15 12:47:57 -07:00
BUILD.bazel build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34736) 2020-01-15 14:58:07 -05:00
extract_i18n_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
mocks.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngc_spec.ts fix(compiler-cli): downlevel angular decorators to static properties (#37382) 2020-06-10 09:24:11 -07:00
perform_compile_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
perform_watch_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_support.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
typescript_support_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00