Angular build could be quicker and leaner (circa Angular8)

Bug #1850955 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Evergreen 3.5

The current Typescipt and browserslist configuration for the Angular app results in building both "es5" and "es2015" targets, which slows compilation and builds a lot of unnecessary files. Additionally, targeting es5/es2015 requires extra polyfills to be added, which are unnecessary given the browsers we target (Chrome/FF).

Proposed fixes:

1. Avoid differential loading (es5 + es2015) and target a single ES version.

2. Bump our ES version from ES5 to ES6. It's supported by all major browsers and I have confirmed Chrome and FF seem perfectly happy with the ES6 builds.

Handy chart: http://kangax.github.io/compat-table/es6/

These will be accomplished by adding a "browserslist" setting package.json and updating the Typescript configs.

For the browser list, I propose:

[
    "last 3 chrome version",
    "last 3 firefox version",
    "last 1 safari version"
],

(I added Safari for good measure. It does not materially affect the build at this point since the 3 browsers are very similar in what they support).

The "browserslist" only acts to guide the compiler in which features need polyfills, differential loading, etc. (It does not prevent other browsers that support the same ES features from working). With a relatively modern set of browser targets, the amount of extra stuff that needs building drops significantly.

Patch en route.

Revision history for this message
Bill Erickson (berick) wrote :

Patches pushed:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1850955-update-ang-build-targets

Contains 2 commits, one to trim/modernize the browser targets, and one to remove some PhantomJS-specific polyfills, which we no longer require.

To test, run various 'ng' builds (ng build, ng build --prod, npm run test) and explore the Angular interfaces in the browser to confirm nothing is breaking.

tags: added: pullrequest
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Jason Boyer (jboyer) wrote :

I tried exercising this by working my way around a lot of /eg2/.* and everything there and in the sandbox worked as expected. My signoff is here, including an update to package-lock.json since it changes as a result: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp1850955_ang_build_signoff / working/user/jboyer/lp1850955_ang_build_signoff

tags: added: signedoff
Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Jason! I'll give it one more test run then merge.

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Rebuilt from scatch.
Ran tests and linter
Dev builds
Prod builds
Tested Chrome, Firefox, and Safari without issue.

Merged to master for 3.5.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
status: New → Fix Committed
Revision history for this message
Bill Erickson (berick) wrote :

And just realized I merged Jason's commit without sign-off. Consider this my sign-off.

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
Changed in evergreen:
status: Fix Committed → Fix Released
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.