Angular 12, a planned upgrade to Google’s popular TypeScript-based web framework, has seen six beta releases since February, bringing enhancements related to performance, the compiler, DOM elements, and more.
The project previously noted that Angular 12 would get capabilities impacting production builds, support for the Webpack 5 bundler, and a host of other improvements. A production release is expected in May. The latest beta, Angular 12.0.0-next.6, was published on GitHub March 24.
Some of the features in the betas include:
- 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 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 a 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.
Copyright © 2021 IDG Communications, Inc.