How Ivy rendering will improve Angular 8.0?

How Ivy rendering will improve Angular 8.0?

April 20, 2019
4 min read
1133 views
0

IVY rendering

You may have been hearing the buzzword "Ivy" being tossed around.

But what is Ivy?

Google’s Angular Team is setting a soft May 2019 release date for the generally-available version 8.0 release of its web app framework. Angular 8.0 is expected to include the first opt-in technical preview of the new rendering engine, Ivy.

Ivy is Angular's upcoming new rendering pipeline and view engine. Ivy is next in line. Ivy Renderer is a backward-compatible Angular renderer focused on further speed improvements, size reduction, and increased flexibility.

How Ivy rendering will improve Angular 8.0?

Normally, the renderer doesn't affect day-to-day development much. For those of us in the real world, though, we've had our fair share of frustration with the AoT (ahead of time compiled) compiler when moving from development to production. Ivy is going to drastically improve our development experience by removing much of the "black box" of the rendering process.

The features of Ivy rendering

  • Generated code that is easier to read and debug at runtime

  • Faster rebuild time

  • Improved payload size (Real world applications should see some size improvements, but many more improvements are planned)

  • Improved template type checking

  • Great backward compatibility. So that existing applications wouldn't break.

Ivy is going to be smaller, faster, and simpler applies not only to bundle sizes but also to the compilation process. This is mainly due to the two key concepts:

Locality

Locality means that Ivy compiles one file at a time. It only looks at a component and its template, not its dependencies, when generating the output. It's a process of compiling each component independently with its own local information that rebuilds faster by compiling partial changes and not the entire project files. This increases the speed of your build process. In the current angular code, each component has its parent information, which leads to compilation dependencies, whereas in Ivy, each component is independent. With this process, you can ship a precompiled code as a 3rd party lib. Additionally, it doesn’t require any metadata for compilation.

Compiling one file at a time will mean smaller sets of instructions, and it will also mean we'll be able to do incremental builds.

Tree-shaking

Ivy has been designed from the start with tree-shaking in mind. "Tree-shaking" means removing unused pieces of your code, which results in smaller bundles and faster load times.

Until now, Angular compiler takes angular templates, parses and would generate optimized JavaScript code that represents the data structure of the template. At runtime, this template data structure is interpreted by an angular interpreter and generates DOM. During the process, Angular compiler has to pass through conditional code paths, which may or may not be used during runtime. Tree shaking tools only recognize reference code and bundles all the code.

Tree-shaking is done using static analysis, which doesn't actually run your code. Because of this, it must take into account all possible scenarios and include anything that might be needed in the bundle. 

With Ivy, your application will be built with Ivy runtime instructions instead of the ViewEngine runtime. Any dependencies you use from Angular or other 3rd parties should keep working as they will be run through the compatibility compiler. This opt-in preview will be focusing on moving applications to the Ivy compiler and runtime instructions without requiring developers to rewrite their applications.

The Angular team aims to release it as an opt-in preview in Angular v8.0 and you will be able to switch between the Ivy and View Engine build and rendering pipelines in your project. Ivy will be available as an opt-in preview in 8.0.0 in order to provide backward compatibility the team has promised and work on any automated migration tools if needed.

Was this article helpful?Vote to let the author know
0
Share this article

Loading comments...

Related Articles

Trading platforms compared: which one fits your style

Trading platforms compared: which one fits your style

That's the usual shape of the mistake. People compare platforms by feature count, the way you'd compare phones in a shop, when the useful question is narrower. What do you actually do in a normal week, and which software makes that loop faster and less error prone?

6 views
Read More
Read full article: Trading platforms compared: which one fits your style
Growing Your Business Through Better SEO

Growing Your Business Through Better SEO

SEO requires regular monitoring because search results are constantly changing. Competitors publish new content, websites are updated, search behavior changes, and search engines continue to improve how they evaluate pages.

4 views
Read More
Read full article: Growing Your Business Through Better SEO
DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis

DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis

Discover how DomDetailer simplifies domain research by bringing Moz, Majestic, and backlink data together in one place. Learn how to evaluate expired and auction domains using authority metrics, referring domains, Trust Flow, Citation Flow, topical signals, and a simple one-credit-per-domain pricing model.

6 views
Read More
Read full article: DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis