- Angular 8 - Discussion
- Angular 8 - Useful Resources
- Angular 8 - Quick Guide
- Angular 9 - What’s New?
- Angular 8 - Working Example
- Angular 8 - Backward Compatibility
- Angular 8 - Building with Bazel
- Angular 8 - Ivy Compiler
- Angular 8 - Testing
- Angular 8 - CLI Commands
- Angular 8 - Accessibility
- Angular 8 - Internationalization (i18n)
- Angular 8 - Server Side Rendering
- Service Workers and PWA
- Angular 8 - Web Workers
- Authentication and Authorization
- Angular 8 - Form Validation
- Angular 8 - Forms
- Angular 8 - Animations
- Routing and Navigation
- Angular 8 - Angular Material
- Angular 8 - Http Client Programming
- Services and Dependency Injection
- Angular 8 - Reactive Programming
- Angular 8 - Pipes
- Angular 8 - Directives
- Angular 8 - Data Binding
- Angular Components and Templates
- Angular 8 - Architecture
- Creating First Application
- Angular 8 - Installation
- Angular 8 - Introduction
- Angular 8 - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Angular 8 - Ivy Compiler
Ivy Compiler is the latest compiler for Angular apppcation released by Angular Team. Currently, Angular is using View Engine compiler to compile Angular apppcation.
In general, Angular compiler has two options to compile an apppcation.
Just In Time (JIT) Compiler
In Just In Time (JIT) compilation, the compiler will be bundled along with the apppcation and send to the browser. Angular apppcation will be compiled in the browser and run just before the execution of apppcation.
Eventhough JIT provides certain advanced feature, JIT slows down the compilation and also the app bundle will be double the size produced by AOT compiler as it includes compiler as well.
Ahead Of Time (AOT) Compiler
In AOT compilation, the compiler will emit optimised code ready to run inside the browser without any addition step. It will reduce the size of the bundle as well as reduce the compilation time and startup time of the apppcation.
Advantages of Ivy Compiler
Ivy Compiler is the optimised and advanced compiler for Angular. As of Angular 8, it is not yet complete even though it is useable at this stage. Angular Team is recommending the developer to use it in Angular 8.
The main advantages of Ivy Compiler are as follows −
Optimised code.
Faster build time.
Reduced bundle size.
Better performance.
How to use Ivy?
Ivy Compiler can be used in Angular 8 apppcation by changing the project setting as specified below −
Open angular.json and set the aot option (projects -> -> architect -> build -> configurations -> production) of the project to true.
{ "projects": { "my-existing-project": { "architect": { "build": { "options": { ... "aot": true, } } } } } }
Open tsconfig.app.json and set enableIvy to true under angularCompilerOptions.
{ ... "angularCompilerOptions": { "enableIvy": true }
Compile and run the apppcation and get benefited by Ivy Compiler.
Advertisements