angular/packages/compiler-cli
Alex Rickabaugh 4e0784c2f0 refactor(compiler-cli): optimize InjectorDef imports generation (#45701)
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
2022-04-26 10:07:23 -07:00
..
integrationtest build: migrate more usages from @bazel/typescript to @bazel/concatjs (#45431) 2022-03-25 12:18:34 -07:00
linker refactor(compiler-cli): emit NgModule dependencies of standalone components (#45672) 2022-04-20 05:45:56 -07:00
ngcc refactor(compiler-cli): propagate standalone flag in .d.ts metadata (#45672) 2022-04-20 05:45:57 -07:00
private refactor(localize): update version of Babel (#44931) 2022-02-24 21:42:54 +00:00
src refactor(compiler-cli): optimize InjectorDef imports generation (#45701) 2022-04-26 10:07:23 -07:00
test refactor(compiler-cli): optimize InjectorDef imports generation (#45701) 2022-04-26 10:07:23 -07:00
BUILD.bazel build: migrate more usages from @bazel/typescript to @bazel/concatjs (#45431) 2022-03-25 12:18:34 -07:00
esbuild.config.js refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
import_meta_url.d.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
index.ts build: switch all instances from ng_rollup_bundle to app_bundle (#44490) 2022-01-04 12:14:14 -08:00
package.json feat(core): drop support for TypeScript 4.4 and 4.5 (#45394) 2022-03-24 10:51:47 -07:00
tsconfig-build.json refactor(compiler-cli): dismantle View Engine implementation of ngc (#44269) 2021-12-01 10:36:30 -08:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00