Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
Why Angular 9 has to pre-compile itself code?

I've just upgraded my project to Angular 9 and the first thing that I noticed is that the build time increased significantly in my CI (From 2 minutes to 4 minutes).

Analysing the logs, every time the tests or the build is performed, the CLI performs a pre-compilation. This is due to the new Ivy architecture, but from my understading, this compilation should only happen to code that isn't Ivy compatible.

So why I'm seeing lots of Compiling @angular/common : es2015 as esm2015 (Mostly from @angular packages) in my build ? Shouldn't Angular code itself be compatible with Ivy ?

Note: This also happens with a fresh project (Just with few libraries).

Update This happens with all commands that requires a build. Ex:

  • ng test --code-coverage=true --watch=false --browsers=ChromeHeadle
  • ng b -c=staging --aot

Update 2

I'm adding my builds for comparison: pre angular 9 and after angular 9 migration (The build still failing, but we can use the unit test as reference, from ~2 minutes to ~4 minutes of total execution)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This article helpfully explains why Angular 9 compiles dependencies with ngcc and the Ivy compilation road map.

In short, because Ivy instruction set will be stabilized in Angular 10 only, Angular team recommends not yet to publish packages compiled to Angular 9 Ivy. After Angular 10, package maintainers will be encouraged to publish Ivy packages; View Engine packages will still be supported, but not encouraged.

From this, I conclude some time after Angular 10 release, we will see significantly less ngcc compilation going on, in some cases none, depending on packages used by particular project. In Angular 9, ngcc compilation step is a necessary compromise you'll have hard time getting rid of.

As for CI speed, the official docs suggest ngcc can be executed explicitly. I think it might be possible to cache this step in CI, but not being aware of your particular setup, I can't suggest anything beyond research direction.

Update 1: Angular 9.1 promises ngcc build speed improvements.

Update 2: Angular 12 deprecates legacy compilation and View Engine rendering pipeline.

Update 3: Angular 13 has removed ViewEngine

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!