This guide contains information related to updating to Angular version 12.
For step-by-step instructions on how to update to the latest Angular release and leverage our automated migration tools to do so, use the interactive update guide at update.angular.io.
For libraries, View Engine is deprecated and will be removed in version 13. New libraries created with version 12 or later default to Ivy. For more information about distributing libraries with View Engine and Ivy, see the Building libraries with Ivy section of Creating libraries.
For information about Angular's deprecation and removal practices, see Angular Release Practices.
enableIvy: false
. Support for building libraries with View Engine, for backwards compatibility, is deprecated and will be removed in Angular version 13. New libraries created with Angular version 12 will default to building and distributing with Ivy. For more information, see Creating Libraries.localize-extract
called --migrateMapFile
which generates a JSON file that can be used to map legacy message IDs to canonical ones. There is also a new script called localize-migrate
that can use the mapping file which localize-extract
generates and migrate all of the IDs in the files that are passed in. For better stability, if you are using Angular's i18n
, run this migration to move to the new message ID generation algorithm. If you don't run this migration, all your generated message IDs will change when Angular removes the View Engine compiler. See PR #41026.inlineStyleLanguage
for defining the style sheet language in inline component styles. Currently supported language options are CSS (default), Sass, SCSS, and LESS. The default of CSS enables existing projects to continue to function as expected. See PR #20514.emitEvent
option for AbstractControl
class methods. See PR #31031.APP_INITIALIZER
to work with observables. See PR #31031.HttpClient
supports specifying request metadata. See PR #25751.node-sass
npm package. node-sass
is unmaintained and does not support newer Sass features. Instead, applications must use the sass
npm package, or the sass-embedded
npm package for the sass-embedded
beta.namedChunks
option is enabled. For the majority of users this change should have no effect on the application or build process. Production builds should also not be affected as the namedChunks
option is disabled by default in production configurations. However, if a project's post-build process makes assumptions as to the file names, then adjustments may need to be made to account for the new naming paradigm. Such post-build processes could include custom file transformations after the build, integration into service-side frameworks, or deployment procedures. An example of a development file name change is lazy-lazy-module.js
becoming src_app_lazy_lazy_module_ts.js
. See PR #20466../app.worker
is the actual worker name, change new Worker('./app.worker', ...)
to new Worker(new URL('./app.worker', import.meta.url), ...)
. See PR #20466.inlineCritical
to false. See PR #20096 and the Style preprocessor options section of Angular workspace configuration.ng build
now produces production bundle by default. See PR #20128.min
and max
attributes defined on the <input type="number">
. Now these attributes trigger min
and max
validation logic in cases where formControl
, formControlName
, or ngModel
directives are also present on a given input. See PR #39063.@angular/material/theming
are deprecated. There is a new Angular Material Sass API for @use
. Run the migration script ng g @angular/material:themingApi
to switch all your Sass imports for Angular CDK and Angular Material to the new API and @use
.i18n
message IDs. If the library was previously compiled by View Engine, and contained legacy i18n
message IDs, then applications may have translation files that you'll need to migrate to the new message ID format. For more information, see Migrating legacy localization IDs.Since version 9, Angular Ivy is the default rendering engine. For more information about Ivy, see Angular Ivy.
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/guide/updating-to-version-12