Angular 8: How does Ivy affect the (Re)build time?

Technology CommunityCategory: AngularAngular 8: How does Ivy affect the (Re)build time?
VietMX Staff asked 3 years ago

One of the Ivy goals is to reach better build times (with a more incremental compilation). It’s achieved by the new locality principle:

To compile an AppComponent that uses AnotherComponent in its template, Ivy doesn’t need to know anything about the pony component.

Previously, when you were working on your application, Angular had to recompile everything inside your module to know what had changed, because the generated code of a component could be using internal details of another component.

Now each component references the directives and components it uses only by their public APIs. So if you modify an internal detail of a component or a directive, only the actual components that use it will be recompiled! It could lead to huge benefits in rebuild times for applications with dozens of components and directives, as you will go from recompiling all of them to recompile just the needed ones.