Angular build could be quicker and leaner (circa Angular8)
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://
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.
Changed in evergreen: | |
importance: | Undecided → Medium |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
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.