angular/goldens/public-api/compiler-cli
Alex Rickabaugh 8155428ba6 perf(compiler-cli): ignore the module.id anti-pattern for NgModule ids (#45024)
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
2022-03-22 11:11:54 -07:00
..
compiler_options.md refactor(compiler-cli): add defaultCategory option (#44391) 2022-01-11 17:33:16 +00:00
error_code.md perf(compiler-cli): ignore the module.id anti-pattern for NgModule ids (#45024) 2022-03-22 11:11:54 -07:00
extended_template_diagnostic_name.md refactor(compiler-cli): add ExtendedTemplateDiagnosticName and TemplateCheckFactory (#44391) 2022-01-11 17:33:15 +00:00