mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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 |
||
|---|---|---|
| .. | ||
| compliance | ||
| ngtsc | ||
| BUILD.bazel | ||
| downlevel_decorators_transform_spec.ts | ||
| extract_i18n_spec.ts | ||
| mocks.ts | ||
| perform_compile_spec.ts | ||
| perform_watch_spec.ts | ||
| test_support.ts | ||
| typescript_support_spec.ts | ||
| version_helpers_spec.ts | ||