3.36.0 • Published 1 month ago

core-js-compat v3.36.0

Weekly downloads
13,150,093
License
MIT
Repository
github
Last release
1 month ago

logo

fundraising PRs welcome version core-js-compat downloads

I highly recommend reading this: So, what's next?

core-js-compat package contains data about the necessity of core-js modules and API for getting a list of required core-js modules by browserslist query.

import compat from 'core-js-compat';

const {
  list,                       // array of required modules
  targets,                    // object with targets for each module
} = compat({
  targets: '> 1%',            // browserslist query or object of minimum environment versions to support, see below
  modules: [                  // optional list / filter of modules - regex, string or an array of them:
    'core-js/actual',         // - an entry point
    'esnext.array.unique-by', // - a module name (or just a start of a module name)
    /^web\./,                 // - regex that a module name must satisfy
  ],
  exclude: [                  // optional list / filter of modules to exclude, the signature is similar to `modules` option
    'web.atob',
  ],
  version: '3.36',            // used `core-js` version, by default - the latest
  inverse: false,             // inverse of the result - shows modules that are NOT required for the target environment
});

console.log(targets);
/* =>
{
  'es.error.cause': { ios: '14.5-14.8' },
  'es.aggregate-error.cause': { ios: '14.5-14.8' },
  'es.array.at': { ios: '14.5-14.8' },
  'es.array.find-last': { firefox: '100', ios: '14.5-14.8' },
  'es.array.find-last-index': { firefox: '100', ios: '14.5-14.8' },
  'es.array.includes': { firefox: '100' },
  'es.array.push': { chrome: '100', edge: '101', ios: '14.5-14.8', safari: '15.4' },
  'es.array.unshift': { ios: '14.5-14.8', safari: '15.4' },
  'es.object.has-own': { ios: '14.5-14.8' },
  'es.regexp.flags': { chrome: '100', edge: '101' },
  'es.string.at-alternative': { ios: '14.5-14.8' },
  'es.typed-array.at': { ios: '14.5-14.8' },
  'es.typed-array.find-last': { firefox: '100', ios: '14.5-14.8' },
  'es.typed-array.find-last-index': { firefox: '100', ios: '14.5-14.8' },
  'esnext.array.group': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.group-by': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.group-by-to-map': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.group-to-map': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.to-reversed': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.to-sorted': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.to-spliced': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.unique-by': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.array.with': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.typed-array.to-reversed': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.typed-array.to-sorted': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.typed-array.to-spliced': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'esnext.typed-array.with': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'web.dom-exception.stack': { chrome: '100', edge: '101', ios: '14.5-14.8', safari: '15.4' },
  'web.immediate': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' },
  'web.structured-clone': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }
}
*/

targets option

targets could be a browserslist query or a targets object that specifies minimum environment versions to support:

// browserslist query:
'defaults, not IE 11, maintained node versions'
// object (sure, all those fields optional):
{
  android: '4.0',         // Android WebView version
  bun: '0.1.2',           // Bun version
  chrome: '38',           // Chrome version
  'chrome-android': '18', // Chrome for Android version
  deno: '1.12',           // Deno version
  edge: '13',             // Edge version
  electron: '5.0',        // Electron framework version
  firefox: '15',          // Firefox version
  'firefox-android': '4', // Firefox for Android version
  hermes: '0.11',         // Hermes version
  ie: '8',                // Internet Explorer version
  ios: '13.0',            // iOS Safari version
  node: 'current',        // NodeJS version, you can use 'current' for set it to currently used
  opera: '12',            // Opera version
  'opera-android': '7',   // Opera for Android version
  phantom: '1.9',         // PhantomJS headless browser version
  quest: '5.0',           // Meta Quest Browser version
  'react-native': '0.70', // React Native version (default Hermes engine)
  rhino: '1.7.13',        // Rhino engine version
  safari: '14.0',         // Safari version
  samsung: '14.0',        // Samsung Internet version
  esmodules: true,        // That option set target to minimum supporting ES Modules versions of all browsers
  browsers: '> 0.25%',    // Browserslist query or object with target browsers
}

Additional API:

// equals of of the method from the example above
require('core-js-compat/compat')({ targets, modules, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } }
// or
require('core-js-compat').compat({ targets, modules, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } }

// full compat data:
require('core-js-compat/data'); // => { [ModuleName]: { [EngineName]: EngineVersion } }
// or
require('core-js-compat').data; // => { [ModuleName]: { [EngineName]: EngineVersion } }

// map of modules by `core-js` entry points:
require('core-js-compat/entries'); // => { [EntryPoint]: Array<ModuleName> }
// or
require('core-js-compat').entries; // => { [EntryPoint]: Array<ModuleName> }

// full list of modules:
require('core-js-compat/modules'); // => Array<ModuleName>
// or
require('core-js-compat').modules; // => Array<ModuleName>

// the subset of modules which available in the passed `core-js` version:
require('core-js-compat/get-modules-list-for-target-version')('3.36'); // => Array<ModuleName>
// or
require('core-js-compat').getModulesListForTargetVersion('3.36'); // => Array<ModuleName>

If you wanna help to improve this data, you could take a look at the related section of CONTRIBUTING.md. The visualization of compatibility data and the browser tests runner is available here, the example:

compat-table

@babel/preset-envbabel-plugin-polyfill-corejs3archetype-library@dinert/utilseasy-select-rnvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-image@cashremit/cr-streamline-iconsnuxt-compactairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@ihikmawan/tailwindcss-multi-theme-l2@borisovart/atol-kkt-moduledeneme323112@texttree/demo-bsa-reference-rcl@startdt/next-preset-app@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjames@startdt/babel-preset-appreact-native-covid-sdkgql_din_modouisys-components-library@l1nyanm1ng/react-picture-viewer@saeon/ol-react@saeon/quick-form@olivervorasai/sliderreact-native-printer-brothersrn-pdf-reader-offlinecbmis-ai-toolboxreact-native-shekhar-bridge-testasterjscogoportutilswilscanner@oiti/documentoscopy-react-nativequoc-testreact-native-slider-kf@saaspe/componentshyperpass-sdkexpand-react-bridgeopea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-1388jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgondp149-tablesklif-ui@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@brantalikp/rn-resize@badpingpong/placeholderimage@behzadebrhm/utils@bhzdbash/utils@bezael-challenge/innoit-date-format@blueking/babel-preset-bk@blusalt-sdk/react-native-blusalt-document-verification@baloochat/react-native-svg-uri@aristidenf/streak-counter@assystant/firebase@assystant/grid-component@assystant/permissionscandlelabssdk@contagt/metismenu@caary-capital/caary-accounting@caary-capital/caary-accounting2@bkui/babel-preset-bk@blkmarketco/components-library@carhoo/widget-dealers@barr-media/avatar-builder@batbayar/superset-plugin-chart-hello-world@beldore/react-otp-input@chiaraani/bouncing-ballcanvaslib_hlcanvas-render--root@simstudio/htmldiff@itayn-fireberry-org/itayn-testpnm-yph-react-native-custom-componentspolyglot-component-library@iarani/opendata@kylesferrazza/graphql-relay-updatedreact-credo@lapanoid/ts-rock-deps@lanz1/v-money3@lljj/babel-preset-appreact-form-component-libraryreact-native-badge-controlreact-native-biometric-authenticatereact-native-create-video-thumbnailreact-native-cplusreact-native-expendable-viewreact-native-meon-edoc
3.36.0

1 month ago

3.35.1

2 months ago

3.35.0

3 months ago

3.34.0

3 months ago

3.33.3

4 months ago

3.32.0

8 months ago

3.32.1

7 months ago

3.32.2

6 months ago

3.33.0

6 months ago

3.33.1

5 months ago

3.33.2

5 months ago

3.31.1

9 months ago

3.31.0

9 months ago

3.30.2

11 months ago

3.30.0

12 months ago

3.30.1

11 months ago

3.29.1

1 year ago

3.29.0

1 year ago

3.28.0

1 year ago

3.27.1

1 year ago

3.27.0

1 year ago

3.27.2

1 year ago

3.25.5

1 year ago

3.25.4

1 year ago

3.26.0

1 year ago

3.26.1

1 year ago

3.25.1

2 years ago

3.25.3

1 year ago

3.25.2

1 year ago

3.24.0

2 years ago

3.24.1

2 years ago

3.25.0

2 years ago

3.23.3

2 years ago

3.23.2

2 years ago

3.23.5

2 years ago

3.23.4

2 years ago

3.22.6

2 years ago

3.22.5

2 years ago

3.22.8

2 years ago

3.22.7

2 years ago

3.23.1

2 years ago

3.23.0

2 years ago

3.22.0

2 years ago

3.22.2

2 years ago

3.22.1

2 years ago

3.22.4

2 years ago

3.22.3

2 years ago

3.20.0

2 years ago

3.20.2

2 years ago

3.20.1

2 years ago

3.20.3

2 years ago

3.19.3

2 years ago

3.19.2

2 years ago

3.21.1

2 years ago

3.21.0

2 years ago

3.19.1

2 years ago

3.19.0

2 years ago

3.18.3

2 years ago

3.18.2

2 years ago

3.18.1

2 years ago

3.18.0

2 years ago

3.17.3

3 years ago

3.17.2

3 years ago

3.17.0

3 years ago

3.17.1

3 years ago

3.16.4

3 years ago

3.16.3

3 years ago

3.16.2

3 years ago

3.16.1

3 years ago

3.16.0

3 years ago

3.15.2

3 years ago

3.15.1

3 years ago

3.15.0

3 years ago

3.13.1

3 years ago

3.14.0

3 years ago

3.13.0

3 years ago

3.11.3

3 years ago

3.12.1

3 years ago

3.12.0

3 years ago

3.10.2

3 years ago

3.11.0

3 years ago

3.11.2

3 years ago

3.11.1

3 years ago

3.10.1

3 years ago

3.10.0

3 years ago

3.9.1

3 years ago

3.9.0

3 years ago

3.8.3

3 years ago

3.8.2

3 years ago

3.8.1

3 years ago

3.8.0

3 years ago

3.7.0

3 years ago

3.6.5

4 years ago

3.6.4

4 years ago

3.6.3

4 years ago

3.6.2

4 years ago

3.6.1

4 years ago

3.6.0

4 years ago

3.5.0

4 years ago

3.4.8

4 years ago

3.4.7

4 years ago

3.4.6

4 years ago

3.4.5

4 years ago

3.4.4

4 years ago

3.4.3

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.6

4 years ago

3.3.5

4 years ago

3.3.4

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

3.0.0-beta.20

5 years ago

3.0.0-beta.19

5 years ago

3.0.0-beta.18

5 years ago

3.0.0-beta.17

5 years ago

3.0.0-beta.16

5 years ago

3.0.0-beta.15

5 years ago

3.0.0-beta.14

5 years ago

3.0.0-beta.13

5 years ago

3.0.0-beta.12

5 years ago

3.0.0-beta.11

5 years ago

3.0.0-beta.10

5 years ago

3.0.0-beta.9

5 years ago

3.0.0-beta.8

5 years ago

3.0.0-beta.7

5 years ago

3.0.0-beta.6

5 years ago