What's New in Angular 9?

Image by Mabel Amber, still incognito... from Pixabay

Work continues on forthcoming Angular 9, including execution upgrades to the Ivy compilation and rendering pipeline, which will be the default technology after the release. Angular 9 reached a release candidate stage on October 31. Meanwhile, Angular 8.2 is accessible as the newest production release of the JavaScript framework. Angular 8.2 upgrade compiler performance and the Bazel build tool.

Angular allows dependency injection, which is especially handy for assembling data services for applications, along with the use of an HTML template to create components. In Angular, developers still create components with an HTML component that connects to TypeScript code for vital parts of the program.

New features in Angular 9.0

With Ivy, the new compilation and rendering pipeline, the default importance of the Ivy flag becomes real. Applications that use NGC compilation now by default receive an Ivy build. Ivy is anticipated to generate code that is not so hard to read and debug at runtime and to give more quickly re-builds and smaller payload sizes.

But Ivy becoming the default is not the only new thing, Angular 9.0, is now available in beta and will have the following new features and upgrades:

  • To have a better performance of the Ivy renderer, repeat global state accesses are eliminated from the i18n instructions when the information is already accessible. Ivy also has a performance boost from the elimination of extra SafeDetection code. And the angular/localize package can be used with an Angular CLI project via ng add.
  • For the Ivy renderer, we will also have better error messages for unknown components. Even more, another flag has been added to localize-translate that gives the source the ability to locate better, more specifically.
  • Regarding the compiler, a sourceSpan property on expression ASTs has been added to record the position of expression relative to the whole source code file that contains it. This pertains to recording the absolute span of template expressions on the parser.
  • To have better performance in the core, sanitization becomes tree-shakable in the Ivy renderer. Sanitizer is not mandatory in Ivy and DomSanitizer is tree-shakable. For stability, DomSanitizer is also refactored to use the same functions as Ivy sanitization. Some small changes will be made in Ivy in relation to property bindings, helping with shortening the processing time. Ivy will also obtain performance quality from changing for-of loops in runtime code to regular for.
  • In the core, a schematic is presented that adds a Directive decorator to undecorated classes with areas that use Angular decorators.
  • Also in Ivy, template type-checking has been modified to make ts. diagnostics.
  • Angular adds a new migration schematic for the core as well, as per the given migration plan.
  • In Ivy, the DomElementSchema registry is used in ngtsc to check bindings to the DOM. 
  • The deprecated ngform selector has been removed.
  • For Ivy, debugging has been updated for styles.
  • Styling execution has been upgraded in Ivy too.
  • Type Script 3.6 is supported.
  • Bootstrap Options will have a new flag to make available the coalesce event change detection to improve the quality of the performance.
  • For ngcc (Angular compatibility compiler), we have a migration
  • For the Angular language system, a Span field has been added
  • Some bugs have been taken care of for Ivy, the compiler, core, language-service, ngcc, and Bazel.