angular/packages/compiler-cli
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
..
integrationtest refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
linker refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
ngcc refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
private refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
src fix(compiler-cli): defer symbols only used in types (#58104) 2024-10-07 08:26:07 -07:00
test 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
esbuild.config.js refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
index.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
package.json refactor(compiler): update dependency chokidar to v4 (#57945) 2024-10-04 10:56:03 -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