zloirock/core-js

Opt out of core-js-bundle polyfill?

LeviticusMB opened this issue · 2 comments

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?

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.

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.