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

Opt out of core-js-bundle polyfill? #1285

Closed
LeviticusMB opened this issue Aug 24, 2023 · 2 comments
Closed

Opt out of core-js-bundle polyfill? #1285

LeviticusMB opened this issue Aug 24, 2023 · 2 comments
Labels

Comments

@LeviticusMB
Copy link

I'm using latest core-js-bundle/minified.js in a very old runtime (Crosswalk, Chromium 53; previously, we used core-js/client/shim.js from 2.6.12).

Unfortunately, JSON.stringify is unusable slow. Is there a way to opt out of only that polyfill in this situation?

@zloirock
Copy link
Owner

zloirock commented Aug 24, 2023

Sure.

  • You could use core-js-builder and exclude es.json.stringify and esnext.json.raw-json.
  • You could use core-js/configurator (from another copy of core-js since it's missed in core-js-bundle) and specify it in useNative.

@zloirock
Copy link
Owner

zloirock commented Aug 24, 2023

Hmm... I forgot that for a legacy reason, before the next major release, es.symbol depends on es.json.stringify, so the first way also requires the exclusion of the Symbol constructor polyfill.

As an option, you could try to exclude only esnext.json.raw-json that should make JSON.stringify faster without an extra wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants