Angular 11 Features, Major Improvements and Migration Benefits

Load-Cascading-List-in-Single-Dropdown-Angular
Dhara Tank
14-Dec-2020
Reading Time: 5 minutes

Let us start with brief introduction about angular 11,

What is Angular 11? What’s new in it?

Angular 11 focuses on enhancing the developer experience by dealing with the bug issues and addressing the issues raised by the community. It aims to simplify the whole development procedure, which also eases things for an angular development company.

The proposed changes and additions include stricter types, router performance improvements, automation in the lining of fonts, and also eliminating the support part for certain versions of Internet Explorer. It has got some really good updates for the community of developers.

Its official release

Angular 11 got officially released on 11th November 2020. Its official release has got some nice updates across the platform which includes the framework, the CLI, and components.

Know About Major Features & Improvements of Angular 11

Angular has recently released the latest version Angular 11 of its remarkable framework, so let us take a quick look at its latest features and improvements.

Enhanced Reporting and Logging

Enhanced Reporting and Logging in Angular 11
Source: blog.angular.io

The latest version of Angular 11 has brought a change in the way, reporting and logging take place. Certain changes have been carried out in the builder phase reporting, which proves helpful in the development process.

With new CLI updates introduced in the latest version, now you can easily read logs and reports. This in turn will help developers to save their huge amount of time and increase their efficiency.

Automatic Inlining of Fonts

"configurations": {  
   "optimization": true  
 }  
You can disable this optimization by changing the flag to below snippets  
 "configurations": {  
   "optimization": {  
     "fonts": false  
   }  
 }  

OR

"configurations": {
  "optimization": {
    "fonts": {
      "inline": false
    }
  }
}

This feature has been introduced in the latest Angular 11 version, which helps the apps to work even faster by speeding up their first contentful paint. Let us understand in detail about it.

During the process of compilation, Angular CLI will automatically download and in turn, inline fonts, which are used and linked in the application. This feature is enabled by default in applications, which are built with Angular 11.

Now, all that needs to be done is to take full benefit of this optimization and carry out updates for your application.

Component Test Harness

This feature offers a robust and readable API base for carrying out testing of Angular material components with the supported API at the testing phase. With the introduction of this feature developers now have harnesses for all the material components, so this will enable developers to build more test suites.

It comes with several updates, performance enhancement, and even new APIs. With the parallel function, now it has become much easier to manage dealings with async actions inside tests, as you can now operate multiple async interactions with the components in a parallel manner.

With a useful function like manual change detection, you can get access to even better control of detection by disabling the auto change detection feature inside your tests.

Updates on Operation Byelog

When the Angular Roadmap was shared, one of the important items was Operation Byelog, where the Angular team gave its full focus on investing its significant amount of engineering efforts towards triaging issues and PRs until they had a clear understanding of the broader needs of the community.

The team has triaged all the issues in all 3 of the monorepos and will continue this process as an ongoing effort to report new issues as and when they arise.

Faster Builds

First and the most important thing that the Angular team has been doing continuously with the latest versions is to optimize for speed. The latest Angular version is faster than you expect starting from the development to even the build cycle.

This was made possible only through carrying out a few changes and updates on certain things such as compilation, which currently uses TypeScript 4.0, and faster processes such as the ngcc update, which is now about four times faster.

Updated Hot Module Replacement Support (HMRS)

To define with, Hot Module Replacement is a mechanism that permits modules replacement without the need to fully refresh the browser. It is a well-known thing with Angular developers team as they were able to use this with previous versions as well.

Thanks to Angular 11, the amount of efforts required to configure the HMR has been reduced to a great extent, and a CLI command for the same.

You need to use ng serve command along with an hmr tag to enable HMR:

ng serve – configuration hmr

TypeScript 4.0 Support

The latest Angular version now only supports TypeScript 4.0. One of the main reasons as to why this upgrade was made is that it helps to speed up the builds. This has led Angular 11 to promote much faster builds compared to its previous versions.

Webpack 5 Support

We all are aware that Webpack is used for compiling a large number of files into a single bundle or file.

Webpack 5 is the latest version that is undergoing development and fixes and it will take some time to be completely stable. The latest Angular 11 version offers experimental support for web pack 5, which can be used to try out new things.

Currently, the team of developers can experiment with the module federation as of now and in the future, when Webpack 5 will make a way for faster builds clubbed with persistent disk caching and smaller bundles.

The Angular team has a strong belief that they will be able to extend experimental support very soon, which will enable developers in achieving smaller bundles and faster build, once all the things are stabilized.

You need to use yarn to make use of Webpack and it needs to be called using yarn. The reason behind this is that npm doesn’t support the resolution property as of now.

“resolutions”: 
{
	“webpack” : “5.4.0”
}

Updated Language Service Preview

Angular 11 Updated Language Service Preview
Source: blog.angular.io

The Angular Language Service is very useful as it offers tools to ease the development process with Angular. It was previously based on the View engine, whereas the latest Angular version offers Ivy-based language service, which is very accurate and powerful. It gives the best experience to developers.

This service can now correctly infer generic type sin templates similar to what TypeScript compiler does. Although still in the development phase, this language service will give a great edge once it is rolled out in the best manner.

Apart from the above-mentioned changes, Angular 11 has also introduced some small changes as mentioned below:

  • New schematics and automated migrations.
  • Resolve guards can be generated with Angular CLI.
  • Stricter types have now been built-in pipes.
  • The function (formatDate) supports ISO 8601 week-number and year format.
  • Offers support for Lazy loading for named outlets.
  • Service worker improvements.

How to get Angular 11 upgrades?

Updating to Angular 11 is very easy. Before you upgrade to Angular 11, you should follow certain steps like upgrading your application to the Angular 10 version. Then make use of below command.

ng update @angular/cli @angular/core

Further, to get more information on Angular 11 features upgrades, you can visit update.angular.io, where you will be supported with detailed guidance regarding the whole procedure.

Wrapping Up

It can be said that the long-awaited Angular 11 version is packed with advanced features and major improvements.

From a development perspective, this latest version offers several improvements that simplify the whole development procedure. The features and improvements enhance the type of safety and reduction of backlogs, which has been a pain point for the developers in the past.

All in all, Angular 11 features have substantially beneficial to developers, therefore it makes total sense to migrate to Angular 11.


Quick Read