Remove deprecated core-js version from production builds #15898
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several dependencies used by Vault UI were using a now deprecated version of core-js (2.6.11) which was causing vulnerability scans to fail. To resolve this, the following steps were taken to remove the deprecated version of core-js from production builds:
ember-auto-import
to 2.4.2 - apps are now responsible for requiring webpackember-cli-element-closest-polyfill
- Element.closest() is supported by all target browsersember-maybe-import-regenerator
- ES6 generators are supported by all target browsers@babel/polyfill
use (now deprecated and uses deprecated core-js version) viaember-cli-babel
configeslint-plugin-compat
for linting code compatibility against target browsersDoing a search in the vendor file of a production ember build after the changes yields zero results for core-js and/or 2.6.11. Additionally, the build time dropped significantly from 6 minutes to just over 1 minute:
Before
After
It would be ideal to use @babel/plugin-transform-runtime with core-js 3 but I couldn't get it working with
ember-cli-babel
and theuseBabelConfig
option. Hopefullyember-cli-babel
will be updated to remove the@babel/polyfill
entirely and support the recommendation to use core-js directly.Related
ember-cli-babel
issues:emberjs/ember-cli-babel#443
emberjs/ember-cli-babel#444
emberjs/ember-cli-babel#417
emberjs/ember-cli-babel#446