Angular 12, a massive planned upgrade to Google’s popular TypeScript-based web framework. It has now moved to a release candidate stage – with the production version due somewhere in May. This upgrade bringing enhancements to performance, the compiler, DOM elements, and so much more.
Officially published just a few days ago, the Angular 12 Release Candidate – easily accessible from GitHub – features a performance improvement to the compiler that reduces the amount of generated code for safe accesses and nullish coalescing. This is done by reusing variables in nested nullish coalescing expressions and not initializing temporary variables to
Before the official release candidate, there were 10 beta releases issued for Angular 12. The new features and improvements in Angular 12 include the following as listed below:
- For the build system, applications will only be allowed to be built with the Ivy renderer, thus making minified UMDs redundant since they cannot be processed by NGCC.
- To improve compiler CLI performance, the incremental compilation is allowed in the presence of redirected source files.
- For the compiler, support is offered for transforming component style resources.
- For the language service, Angular property completions are provided only in templates.
- Adding of a migration that casts the value of
fragmentto be non-nullable.
- For the compiler-cli, a
contextoption is introduced for any request that allows supplying arbitrary data in a type-safe way. This feature addresses the need to configure interceptors in the HTTP client on a per-request basis.
- For animations, DOM elements now are correctly removed when the root view is removed. This is a breaking change.
- To improve performance, unused methods have been removed from
- A new format is added to
legacy-migrate, to generate a JSON file that can be used to map legacy message IDs to canonical ones.
- Strict null checks will report on a fragment potentially being null. This is a breaking change.
- The type of the APP-INITIALIZER token has been changed to more accurately reflect the types of return values handled by Angular. This is a breaking change.
- Support has been added for disabling animations through
emiteventoption was added for
FormGroup. This is a breaking change.
- More fine-tuned control has been added in
- Custom router outlet implementations are permitted.
- Support has been added for TypeScript 4.2, and support for TypeScript 4.0 and TypeScript 4.1 has been dropped.
- Implementing the
- For forms, min and max validators are being introduced.
- Exporting of a list of HTTP status codes.
- Addition of a feature to the Angular Language Service that enables accessing the locations for components that use a template file.
- The addition of diagnostics to suggest turning on strictTemplates, providing a way for the language server to retrieve compiler options diagnostics.
- A patch adding an API to retrieve the template typecheck block for a template, if any, at a file location, and selection of the TS node in the TCB corresponding to the template node at which the request for a TCB was made. This will help with debugging.
- The addition of command for getting components for a template file, for the language service.
A variety of bug fixes also are featured, affecting the compiler, compiler-cli, Bazel build tool, the router, and other parts of Angular. A full list of changes can be found on GitHub. The current Angular 11 line debuted as a production release in November.