Forbes India Leader Recognition
e.preventDefault(); // Prevent form submission input.blur(); // remove focus input.value = ""; // optional: clear the input

Ivy: New Angular Compiler

Ivy: New Angular Compiler

Featured Image

Angular Ivy is the code used for Angular’s next-generation compilation and rendering pipeline. With the version 9 release of Angular, the new compiler and their runtime instructions are used by default instead of the older compiler and runtime, known as View Engine. Firstly, we take a look:

How does the compiler work?

Architecture:

  • Regular typescript compilation works as:
    Ivy_New_Angular_Compiler_01
  • Angular compilation works as:
    Ivy_New_Angular_Compiler_02

Compilation Model:

  • When the compiler runs, then it converts typescript code into javascript code just like lib.ts into the lib.js file.
  • And, this JS file has no type information. It’s ready to execute in a browser.

Feature of compilation:

  • NgModule Scopes:
    Ivy_New_Angular_Compiler_03
  • Partial Evaluation:
    The compiler will evaluate

    • Literals (Objects and Arrays),
    • Constant/Variables,
    • Binary/ternary/logic Expressions
    • String Templates
    • Function calls
    • Property chains
    • Imports/Exports
  • Template Type Checking:
    The significant challenge is that the Typescript compiler doesn’t support checking the HTML code. That’s why the approach is:

    • Transform angular expression code into TS code.
    • Set up a typescript program and feed it with this ‘type check blocks’.
    • Gather any error and map them back to the original template

Type checking:

Ivy_New_Angular_Compiler_04

  • <account-view> should be a selector component with an ‘account’ @input.
  • getAccount() should take two arguments and should return and Observables/Promises.
  • ‘user’  should be an object with an ‘id’ property.
  • [account] should accept null values.

Advantages

  • Smaller bundle sizes
  • Faster testing
  • Better debugging
  • Improved CSS class and style binding
  • Improved type checking
  • Improved build errors
  • Improved build times, enabling AOT(true) on by default
  • Improved Internationalization
Ivy_New_Angular_Compiler_05
Small Apps: 30% decrease in bundle size, Medium Size apps: Decreases Minimally, Large Apps: 25-40% decrease in bundle size.

How does it work?

It is “tree-shaking friendly,” which means that it automatically removes unused code (including unused Angular features!), shrinking your bundles. Another feature is that it compiles each file separately, reducing rebuild times. In short — you get minified builds, faster rebuild times and simpler generated code.

Running Ivy

  • Created the new angular Project
    Ivy_New_Angular_Compiler_06
  • Enabling Ivy by adding the following lines
    Ivy_New_Angular_Compiler_07
  • Run the compiler by executing ngc commandIvy_New_Angular_Compiler_08
  • Let’s look at the template of the AppComponent
    Ivy_New_Angular_Compiler_09
  • Code generated for this template inside the dist/out-tsc/src/app/app.component.js
    Ivy_New_Angular_Compiler_10

Understanding the Generated Code

If we look on the top of the generated file we get the following statement:

Ivy_New_Angular_Compiler_11

  • iɵ is actually just the core Angular module, and these are the all functions exported by Angular
  • The letter ɵ indicates that some method is private to the framework and must not be called directly by the user.
  • Similarly, ɵT stands for text, and ɵe for elementEnd

References

Related Posts

Latest Posts

  • All Posts
  • AI Powered Knowledge
  • ai/ml
  • CEO India Magazine
  • CMMI level 5 Certification
  • e-learning
  • Fintech
  • gaming
  • Generative AI
  • healthcare
  • manufacturing
  • News
  • OTT
  • Portfolio
  • supply chain
  • travel and hospitality
  • Tudip's AI Hackathon
  • Voxlearn Enterprises
    •   Back
    • Android
    • iOS
    • Java
    • PHP
    • MEAN
    • Ruby
    • DotNet
    • IoT
    • Cloud
    • Testing
    • Roku
    • CMS
    • Python
The Future of Workplace Learning: AI-Powered Knowledge on Demand

The Future of Workplace Learning: AI-Powered Knowledge on Demand

June 12, 2026

A few months ago, I was sitting in a meeting with a team lead who looked genuinely frustrated. Not because…

Read More
We Did It Again: Tudip Successfully Renews Its CMMI Level 5 Certification

We Did It Again: Tudip Successfully Renews Its CMMI Level 5 Certification

June 9, 2026

Nobody around here needed a memo to know something worth celebrating had happened. The message from the CMMI Institute said…

Read More
CEO India Magazine Features Dipti Agrawal: The Woman Behind Intelligent Enterprise Solutions

CEO India Magazine Features Dipti Agrawal: The Woman Behind Intelligent Enterprise Solutions

June 9, 2026

There are moments at work that just stop you in your tracks. Not the big quarterly reviews or the product…

Read More

India

Plot No. 11/2, Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, India – 411057.
info@tudip.com
+91-96-8990-0537

United States

1999 S. Bascom Ave Suite 700, Campbell CA. 95008, USA.
info@tudip.com
+1-408-216-8162

Canada

64 Caracas Road North York, Toronto Ontario M2K 1B1, Canada.
info@tudip.com

Mexico

Calle Amado Nervo #785 Interior B Colonia Ladron De Guevara 44600 Guadalajara, Jalisco, Mexico.
info@tudip.com

Singapore

77 High Street, #10-12B High Street Plaza, Singapore 179433.
info@tudip.com

Colombia

Cra. 9 # 113-53 Of. 1405 Bogotá D.C., Colombia.
info@tudip.com

UAE

Tudip Information Technologies L.L.C Office No 109, ABU HAIL BUILDING 13, Abu Hail, Dubai, UAE.
info@tudip.com

Nigeria

22 Kumasi Crescent, Wuse 2, Abuja, Nigeria.
info@tudip.com