In this fast-changing technology era, the one prominent evolving technology is Angular which is Google’s framework for building web applications, mobile. In the recent version 9, all the existing shortcomings have been modified.
Here are the top few features or improvements of angular 9 we should know
1. Angular Ivy Compiler – Becomes default compiler now!
Ivy is the code name for Angular’s next-generation compilation and rendering pipeline. Instead of using the old View Compiler, all the applications will use the IVY renderer as the default compiler. Apps built with IVY are more efficient.
Below are the advantages of using Ivy compiler
- Smaller bundler size
- Faster testing
- Better debugging
- Improved type checking
- Improved build errors
2. Reduced bundle size by 25 – 40 %!
As mentioned above, the Ivy compiler has been designed to remove parts of Angular that are not used via tree-shaking, and this results in generating less code for Angular components. Small apps that don’t use many Angular features can benefit most from tree-shaking.
3. TypeScript 3.8
Angular 9 now has support for TypeScript 3.8, in addition to existing support for 3.6 and 3.7. New key features of TypeScript language are Type-Only ECMAScript Private Fields, Imports and Exports, Top-level await, etc.
4. Now Debug the code or components in the development mode!
This feature can speed up the development and help the developer a lot of time. Few important points are possible using a variable ng available in the inspect mode.
- Easily grab an instance of your components, directives or pipes.
- Ability to manually call methods using an instance of the component.
- Inspect any object Value or change, trigger the change detection cycle of Angular to see changes.
5. Faster Testing
Testbed in project IVY has been improved a lot in angular 9, in the previous version of angular all the components need to be recompiled when running a single test. This has been removed and kept to only components that have an active part in testing which improves overall testing time.
6. Improved Type Checking
The compiler can now check for more types available in your application which improves the stability of the application, two new flags for type checking has been introduced in the compilers
fullTemplateTypeCheck – Activating this flag will tell the compiler to check everything in the template (ngIf, ngFor, etc..)
strictTemplates – Activating this flag will tell the compiler to apply the strictest system rules for type checking.
7. Improved Build Errors
Improved type checking has resulted in displaying more meaningful build errors.
For eg below is the picture of error compiled with an older version of angular
The same build when compiled with angular 9
8. Improved Internationalization (i18n)
Internationalization allows to build your application once per locale and receive highly optimized and localized applications. In Angular 9 Internationalization is made faster by moving the build-time i18n substitutions later in the build process which made it up to 10 times faster.
There are many other great features also added like enabling AOT on by default, reliable ng update, component harnessing, etc.
There are improvements on IDE and plugin side as well, which makes Angular more fun to work with!