mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Before standalone, everything that could appear in an NgModule's `imports` was relevant to DI, and needed to be emitted in the `imports` of the generated `InjectorDef` definition. With the introduction of standalone types, NgModule `imports` can now contain components, directives, and pipes which are standalone. Only standalone components need to be included in the `imports` of the generated injector definition - directives and pipes have no effect on DI. Having them present doesn't cause any errors in the runtime (they're filtered out by the injector itself) but it does prevent tree-shaking. With this commit, the generation of `InjectorDef` now filters the `imports` to exclude directives and pipes as much as possible. It's not _always_ possible because an expression in `imports` may pull in both a directive and a `ModuleWithProviders` reference, and we have no way of referencing just the MWP part of that expression. Therefore this is an optimization, not a rule of `InjectorDef` compilation. PR Close #45701 |
||
|---|---|---|
| .. | ||
| r3_compiler_compliance | ||
| r3_view_compiler | ||
| r3_view_compiler_bindings | ||
| r3_view_compiler_di/di | ||
| r3_view_compiler_directives/matching | ||
| r3_view_compiler_i18n | ||
| r3_view_compiler_input_outputs | ||
| r3_view_compiler_listener | ||
| r3_view_compiler_providers | ||
| r3_view_compiler_styling | ||
| r3_view_compiler_template | ||
| source_mapping | ||
| BUILD.bazel | ||
| list_golden_update_rules.ts | ||
| test_case_schema.json | ||