Angular: use the aot compiler for ng build

Bug #1895395 reported by Jane Sandberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

Currently, `ng build --prod` uses the ahead-of-time (AOT) compiler, while `ng build` uses the just-in-time (JIT) compiler.

As of angular 9, the angular documentation recommends using the AOT compiler for both: https://angular.io/guide/ivy

This would provide a bit more consistency for developers (since some errors only display in AOT, others only display in JIT, and we want to make sure that the AOT in particular is error-free so that builds don't break).

Branch forthcoming.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Branch available for your review at user/sandbergja/lp1895395_ng_build_aot

Here's a link: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1895395_ng_build_aot

Changed in evergreen:
milestone: none → 3.6-beta
tags: added: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Hi, while I agree with this in theory, it will add a significant roadblock to speedy development. My dev VM is currently taking about 22 seconds to compile after each change, compared to JIT which is practically instantaneous. There will be times, especially early in the dev process for an interface, where AOT has to be disabled.

If we can force JIT via command line, it's probably fine. We may need to publicize this capability and provide some guidance on when/if to us it.

My approach thus far has been to do all development with JIT then do my final testing with AOT, fwiw.

Revision history for this message
Galen Charlton (gmc) wrote :

Pushed for inclusion in 3.6. Thanks, Jane!

Changed in evergreen:
status: Confirmed → Fix Committed
Revision history for this message
Galen Charlton (gmc) wrote :

In light of Bill's comments, I'm taking another look at this.

Revision history for this message
Galen Charlton (gmc) wrote :

OK, for me it was the difference between 0.8 seconds and 2 seconds, which wasn't enough to matter, but on the other hand the box I was using had plenty of memory and was all SSD. I've gone ahead and pushed a revert pending further discussion. Apologies for jumping the gun.

Changed in evergreen:
status: Fix Committed → Confirmed
Revision history for this message
Galen Charlton (gmc) wrote :

As far as the command line is concerned, it looks like the following works to override the angular.json setting when Jane's patch is applied:

ng build --watch --aot false

Changed in evergreen:
milestone: 3.6-beta → 3.6-beta2
assignee: Galen Charlton (gmc) → nobody
Galen Charlton (gmc)
Changed in evergreen:
milestone: 3.6-beta2 → 3.next
Michele Morgan (mmorgan)
tags: added: needsdiscussion
removed: pullrequest
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.