Angular, SPA

Angular 9 is out – What’s in it for me?

Angular officially released version 9 few days. Most notable change that Angular 9 includes is Ivy – a new view rendering engine. This is guaranteed to provide following features:

  • Smaller bundle size
  • Faster Rendering
  • Better Debugging
  • Improved Type Checking

Ivy – A new view rendering engine replacing older VE

This is responsible to take your component template and convert it into instructions that the browser would execute to build the D.O.M. Faster this logic, faster the app would render.

Since all these changes are in the framework (under the hood), there is no effort for the developers to utilize this feature. There is no change in the way you’d develop component etc.

This is basically free with the Angular 9 upgrade.

Smaller Bundles

Ivy is also responsible for building the app into much smaller bundles. This means that the application would be quick to download especially for the mobile devices the start-up time would be much quicker.

image source

AOT Compilation

Angular 9 brings AOT compilation to the compile time which means the errors that would uncover when you build app with –prod flag would be seen during development.

Strict Type-Checking

Now you can specify how strict you’d like Angular to check for issues with the component templates.

In addition to the full mode behavior, Angular version 9:

  • Verifies that component/directive bindings are assignable to their @Input()s.
  • Obeys TypeScript’s strictNullChecks flag when validating the above.
  • Infers the correct type of components/directives, including generics.
  • Infers template context types where configured (for example, allowing correct type-checking of NgFor).
  • Infers the correct type of $event in component/directive, DOM, and animation event bindings.
  • Infers the correct type of local references to DOM elements, based on the tag name (for example, the type that document.createElement would return for that tag).

Upgrade to Angular 9

You can run following command to upgrade to latest version.

ng update @angular/cli @angular/core

However it is recommended to upgrade first to version 8 and then to latest. For more information on how to upgrade visit angular documentation here. There is also an interactive guide to upgrading to version 9 it might be worth trying.