Frontend

Angular Ivy Update Coming In 2019 Means Smaller Apps

Angular Ivy

A new compilation system, nicknamed “Angular Ivy” will allow compiled Angular apps to be tiny. We’re seeing basic Hello World apps as small as 3.3kb! This compares to React projects, where the minimal sizes are between 10-30kb with just react-dom.

Transitioning between Angular 1 and 2+ was a pain. The major difference between the two versions was the addition of a compilation process. No longer did you include a “angular-1.6.9.min.js” in a script tag, but rather you needed to import angular using a package manager, and run a compilation process which would give you one piece of javascript (called the bundle) to include in your HTML page.

This choice to rethink the framework allowed the team behind AngularJS to make progressive improvements over time that would not have been possible with the original version.

Previously, even though you weren’t using many parts of Angular, the code for that still had to be included in your bundle because the compiler wasn’t advanced enough to figure what you were and were not using.

Angular will soon be able to output much smaller filesizes because of advancements in detecting dependencies on the framework-feature level.

Angular Ivy as it’s called, is the newest rendering and view engine the team is working on. This newest update will add advanced tree-shaking algorithms to the compiler, enabling it to figure exactly what parts of Angular need to be included and which ones don’t.

This means that, for an example like like Hello World where very little of Angular is needed (e.g. no need to even include event binding), you can get tiny 3.3kb bundles.

A strong benefit of this is that developers will have a lot more freedom to use Angular as they please. No longer will they be limited to using it where a lot of interaction is required: even simple concepts like landing pages could be developed with the angular toolkit without taking a strong loading-time hit.

The expected release is towards the end of this year, or the beginning of 2019.

It remains to be seen what the React ecosystem’s answer to this will be. Although react can be pretty minimal already with precompiled pages, it still requires a lot of finessing to get it right.