Angular 14, the next major upgrade to the popular Google-developed, TypeScript-based web framework, will feature strictly typed reactive forms and extended template diagnostics. Due in June, the release will also make NgModules optional.
The most-requested improvement for the framework on GitHub, strictly typed reactive forms is intended to improve the developer experience of Angular’s model-driven approach to handling form inputs whose values change over time. Plans call for providing as much type safety as possible while balancing against API complexity; supporting gradual typing and allowing typed and untyped forms to be mixed; landing changes without breaking existing applications; and avoiding the fragmentation of the ecosystem. The intention is to not change template-driven forms.
Extended template diagnostics in the compiler would guard developers from hitting common errors. These diagnostics would be applied after type checking. At present, the compiler lacks warnings and generally only fails on fatal issues that directly prevent compilation. Extended diagnostics will allow warnings to be easily authored to check for smaller mistakes, such as getting two-way binding syntax backwards or having extraneous operators, like using foo ?? ‘bar’
when foo
is not nullable. A new private flag in the compiler would enable diagnostic checks that giving warning/information diagnostics about user templates that are not strictly fatal errors.
Angular 14 also is set to move forward with the adoption of standalone components and make NgModules optional. The plan calls for moving Angular in a direction where pipes, directives, and components play a more central role and are self-contained.
Angular 14 is available in pre-release form on GitHub. While the feature set for Angular 14 still is subject to change, other capabilities currently planned for the release include tree-shakable error messages and TypeScript 4.7 support. Predecessor TypeScript 4.6 is due as a production release later this month; TypeScript 4.7 support is a project based on Angular’s release schedule.
Angular 13 was published in November.