angular/packages/compiler-cli/test/compliance/test_cases
Alex Rickabaugh 27b4af7240 fix(compiler-cli): full side-effectful registration of NgModules with ids (#45024)
Angular contains an NgModule registry, which allows a user to declare
NgModules with string ids and retrieve them via those ids, using the
`getNgModuleById` API.

Previously, we attempted to structure this registration in a clever fashion
to allow for tree-shaking of registered NgModules (that is, those with ids).
This sort of worked due to the accidental alignment of behaviors from the
different tree-shakers involved. However, this trick relies on the
generation of `.ngfactory` files and how they're specifically processed in
various bundling scenarios. We intend to remove `.ngfactory` files, hence
we can no longer rely on them in this way.

The correct solution here is to recognize that `@NgModule({id})` is
inherently declaring a global side-effect, and such classes should not
really be eligible for tree-shaking in the first place. This commit removes
all the old registration machinery, and standardizes on generating a side-
effectful call to `registerNgModuleType` for NgModules that have ids.

There is some risk here that NgModules with unnecessary `id`s may not
tree-shake as a result of this change, whereas they would have in previous
circumstances. The fix here should be to remove the `id` if it's not needed.
Specifying an `id` is a request that the NgModule be retained regardless of
any other references, in case it is later looked up by string id.

PR Close #45024
2022-03-22 11:11:53 -07:00
..
r3_compiler_compliance fix(compiler-cli): full side-effectful registration of NgModules with ids (#45024) 2022-03-22 11:11:53 -07:00
r3_view_compiler perf(compiler): chain element start/end instructions (#44994) 2022-02-08 09:56:50 -08:00
r3_view_compiler_bindings Revert "test: update compiler-cli compliance goldens due to TS 4.3 emit format regression (#42022)" (#42600) 2021-06-21 16:42:48 +00:00
r3_view_compiler_di/di fix(compiler-cli): correctly interpret token arrays in @Injectable deps (#43226) 2021-09-28 14:15:48 -07:00
r3_view_compiler_directives/matching Revert "test: update compiler-cli compliance goldens due to TS 4.3 emit format regression (#42022)" (#42600) 2021-06-21 16:42:48 +00:00
r3_view_compiler_i18n perf(compiler): chain element start/end instructions (#44994) 2022-02-08 09:56:50 -08:00
r3_view_compiler_input_outputs refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_listener perf(compiler): chain element start/end instructions (#44994) 2022-02-08 09:56:50 -08:00
r3_view_compiler_providers refactor(compiler-cli): change how partial-linkers are matched to declaration versions (#41578) 2021-04-14 11:00:40 -07:00
r3_view_compiler_styling perf(compiler): chain element start/end instructions (#44994) 2022-02-08 09:56:50 -08:00
r3_view_compiler_template fix(compiler-cli): Handle ng-template with structural directive in indexer (#44788) 2022-01-25 14:15:44 -08:00
source_mapping refactor(localize): update version of Babel (#44931) 2022-02-24 21:42:54 +00:00
BUILD.bazel test(compiler-cli): generate golden files for partial compilation (#39617) 2020-11-13 11:25:56 -08:00
list_golden_update_rules.ts refactor(compiler-cli): use semver range checking for partial versions (#39847) 2020-12-04 10:26:17 -08:00
test_case_schema.json test(compiler-cli): improve compliance test compile mode filtering (#39939) 2020-12-07 16:21:04 -08:00