angular/packages/compiler-cli
Payam Valadkhan e8201a5962 refactor(compiler-cli): add a compiler option to enable checking for orphan component (#52061)
Orphan component is an anti-pattern in Angular where a component is rendered while the NgModule declaring it is not installed. It is not easy to capture this scenario, specially in compile time. But it is possible to capture a special case in runtime where the component is being rendered without its NgModule even loaded into the browser. This change adds a flag in cli compiler option to enable such checking, and throwing a runtime exception if it happens. Note that such check is only done in dev mode.

Currently the check requires some generated code that is behind ngJitMode flag (i.e., call to ɵɵsetNgModuleScope), and the new flag can be set only if JIT mode is enabled (i.e., supportJitMode=true) otherwise an error will be thrown.

The orphan component is a main blocker for rolling out local compilation in g3. This option is needed for identifying and isolating such cases.

PR Close #52061
2023-10-10 15:30:26 -07:00
..
integrationtest refactor(compiler-cli): remove unused integration tests. (#49862) 2023-04-17 14:57:02 +00:00
linker feat(core): enable block syntax (#51994) 2023-10-03 15:26:05 -07:00
ngcc refactor(compiler-cli): add back ngcc as a no-op with a warning (#50045) 2023-04-28 18:18:40 +02:00
private refactor(compiler-cli): remove unused class decorator downlevel code (#49351) 2023-03-08 17:59:12 +00:00
src refactor(compiler-cli): add a compiler option to enable checking for orphan component (#52061) 2023-10-10 15:30:26 -07:00
test refactor(compiler-cli): add a compiler option to enable checking for orphan component (#52061) 2023-10-10 15:30:26 -07:00
BUILD.bazel feat(compiler): initial skeleton for API doc extraction (#51733) 2023-09-18 12:29:19 +02:00
esbuild.config.js refactor: remove __ESM_IMPORT_META_URL__ workaround now that we can use ESM (#48521) 2022-12-19 19:50:41 +00:00
index.ts feat(compiler): extract docs via exports (#51828) 2023-09-20 18:34:55 +02:00
package.json build: update babel dependencies (#51898) 2023-10-09 17:01:20 -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