mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
In early versions of Angular, it was sometimes necessary to provide a `moduleId` to `@Component` metadata, and the common pattern for doing this was to set `moduleId: module.id`. This relied on the bundler to fill in a value for `module.id`. However, due to the superficial similarity between `Component.moduleId` and `NgModule.id`, many users ended up setting `id: module.id` in their NgModules. This is an anti-pattern that has a few negative effects, including preventing the NgModule from tree-shaking properly. This commit changes the compiler to ignore `id: module.id` in NgModules, and instead provide a warning which suggests removing the line entirely. PR Close #45024 |
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| component_indexing_spec.ts | ||
| env.ts | ||
| extended_template_diagnostics_spec.ts | ||
| imports_spec.ts | ||
| incremental_error_spec.ts | ||
| incremental_semantic_changes_spec.ts | ||
| incremental_spec.ts | ||
| incremental_typecheck_spec.ts | ||
| monorepo_spec.ts | ||
| ngtsc_spec.ts | ||
| scope_spec.ts | ||
| sourcemap_utils.ts | ||
| standalone_spec.ts | ||
| template_mapping_spec.ts | ||
| template_typecheck_spec.ts | ||
| xi18n_spec.ts | ||