angular/packages/compiler-cli/test
Kristiyan Kostadinov f187c3abf8 fix(compiler-cli): defer symbols only used in types (#58104)
Currently we don't defer any symbols that have references outside of the `import` statement and the `imports` array. This is a bit too aggressive, because it's possible that the symbol is only used for types (e.g. `viewChild<SomeCmp>('ref')`) which will be stripped when emitting to JS.

These changes expand the logic so that references inside type nodes aren't considered.

**Note:** one special case is when the symbol used in constructor-based DI (e.g. `constructor(someCmp: SomeCmp)`, because these constructors will be compiled to `directiveInject` calls. We don't need to worry about them, because the compiler introduces an addition `import * as i1 from './some-cmp';` import that it uses to refer to the symbol.

Fixes #55991.

PR Close #58104
2024-10-07 08:26:07 -07:00
..
compliance refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
ngtsc fix(compiler-cli): defer symbols only used in types (#58104) 2024-10-07 08:26:07 -07:00
BUILD.bazel refactor(compiler-cli): move JIT transforms into ngtsc (#56892) 2024-07-10 17:29:20 +02:00
extract_i18n_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
mocks.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
perform_compile_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
perform_watch_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
test_support.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
typescript_support_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
version_helpers_spec.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00