Angular 8 is released. Angular is keep growing by adding features that make it more stable. What’s new
in Angular 8.
- Experimental Support for Ivy (Not Stable)
- Experimental Support for Bazel
- Differential Loading
As Ivy was the main feature for Angular 7 but it released with basic support, we were expecting it to be stable on Angular 8. We still need to wait a bit for this feature.
Build tool for Angular. It’s not finished and tested.
Angular 8 has come with differential loading. Differential loading is a process by which browser chooses between modern and legacy build. Modern builds generates js with es2015 and legacy builds generates js with es5. Browser will pick bundle and loads application for the user.
Once you update the app with ng update, you can notice that module is added new and target set to es2015. Previously it was set as es5.
It informs build process that you want to take advantage of differential loading or not. In index.html file there will be two files reference . For example,
<script src="main-es2015.902988c03c77800aed47.js" type="module"></script> // Modern
<script src="main-es5.5836b1b49f74982bf186.js" nomodule></script> // Legacy
Its applicable for lazy loaded component also. Overall saving as per angular is around 7% to 20%. For my project it reduced around 7%.
To opt-out this feature one can set target to es5 again and it will not generate two builds.
- Application loads faster that improves overall user experience
- Opt-in and opt-out is easy
- No code change needed
- Google SEO and Crawl advantage as app loads more faster
- High build time as its building two builds
- Some Unexpected error can be face and one may lead to opt-out this feature.
Read more on the official document. Let know your feedback about differential loading feature in comment section.
Thank you for reading.