Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CoreJS polyfills to modern build #20676

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

steverep
Copy link
Member

Proposed change

Currently, we deliberately ignore all CoreJS polyfills for the modern build. This change allows Babel to inject them just like the legacy build, except obviously with the modern targets. This ensures that when we serve the modern build to an older browser, it gets the polyfills it needs (so in reality this is a bug fix for any such problems). It also allows us to more seamlessly develop with new ECMA features as they begin to be implemented in browsers.

This is a perfectly valid PR on its own, but is meant to compliment #16506. This increases the bundle size a bit because the modern target browsers are so old, and then that PR would then eliminate nearly all of the increase by shifting the targets to be much more modern.

This change also removes the custom polyfill we manually add for Array.prototype.flat. It's unnecessary as the equivalent polyfill from CoreJS will be injected where needed.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@github-actions github-actions bot added the Build Related to building the code label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Related to building the code cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant