angular/packages/compiler-cli
Alex Rickabaugh 1e07a112b0 fix(compiler-cli): use existing imports for standalone dependencies (#46029)
This commit fixes a small issue in the logic around the calculation of
template scopes for standalone components. These scopes include a
`Reference` for each dependency of a standalone component, which is used to
generate references to that dependency in various contexts.

Previously, the `Reference` used for a dependency was the one generated from
its own metadata. For example, a referenced directive used the `Reference`
that was created when analyzing the directive declaration itself. This still
works, as the compiler is always able to emit a reference to any valid
`Reference`. However, it's not optimal.

The `Reference` which should be used instead is the one generated from
analyzing the standalone component's `imports` array, which has knowledge of
how the dependency is referenced from within the standalone component's file
itself. This allows the compiler to skip creating a new import for the
dependency when emitting the standalone component, and use the existing,
user-authored import instead. This saves on code size and avoids taxing the
bundler with unnecessary imports.

PR Close #46029
2022-05-18 08:55:31 -07:00
..
integrationtest fix(router): Remove deprecated initialNavigation option (#45729) 2022-04-28 14:40:03 -07:00
linker refactor(compiler-cli): emit NgModule dependencies of standalone components (#45672) 2022-04-20 05:45:56 -07:00
ngcc fix(language-service): Add resource files as roots to their associated projects (#45601) 2022-05-10 09:36:26 -07:00
private refactor(localize): update version of Babel (#44931) 2022-02-24 21:42:54 +00:00
src fix(compiler-cli): use existing imports for standalone dependencies (#46029) 2022-05-18 08:55:31 -07:00
test fix(compiler-cli): use existing imports for standalone dependencies (#46029) 2022-05-18 08:55:31 -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 build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -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