Contributing

December 23, 2025 ยท View on GitHub

Contributions are always welcome. Feel free to ask @zloirock if you have some questions.

I want to help with code, but I don't know how

There is always some "help wanted" issues. You can look at them first. Sure, other help is also required - you could ask @zloirock about it or open issues if you have some ideas.

How to add a new polyfill

A simple example of adding a new polyfill.

How to update core-js-compat data

For updating core-js-compat data:

  • If you want to add a new data for a browser, run in this browser tests/compat/index.html (tests and results for the actual release are available at http://zloirock.github.io/core-js/master/compat) and you will see what core-js modules are required for this browser.

compat-table

  • If you want to add new data for NodeJS, run npm run compat-node with the installed required NodeJS version and you will see the results in the console. Use npm run compat-node json if you want to get the result as JSON.
  • If you want to add new data for Deno, run npm run compat-deno with the installed required Deno version and you will see the results in the console. Use npm run compat-deno json if you want to get the result as JSON.
  • If you want to add new data for Bun, run npm run compat-bun with the installed required Bun version and you will see the results in the console.
  • If you want to add new data for Rhino, run npm run compat-rhino YOUR_PATH_TO_RHINO and you will see the results in the console.
  • If you want to add new data for Hermes (incl. shipped with React Native), run npm run compat-hermes YOUR_PATH_TO_HERMES and you will see the results in the console.
  • After getting this data, add it to packages/core-js-compat/src/data.mjs.
  • If you want to add new mapping (for example, to add a new iOS Safari version based on Safari or NodeJS based on Chrome), add it to packages/core-js-compat/src/mapping.mjs.
enginehow to run testsbase data inherits frommandatory checkmapping for a new version
androidbrowser runnerchrome, chrome-android
bunbun runnersafari (only ES)required
chromebrowser runnerrequired
chrome-androidbrowser runnerchrome
denodeno runnerchrome (only ES)non-ES featuresrequired
edgebrowser runnerie, chromerequired (<= 18)
electronbrowser runnerchromerequired
firefoxbrowser runnerrequired
firefox-androidbrowser runnerfirefox
hermeshermes runnerrequired
iebrowser runnerrequired
iosbrowser runnersafariif inconsistent (!= safari)
nodenode runnerchrome (only ES)non-ES featuresrequired
operabrowser runnerchromeif inconsistent (!= chrome - 16)
opera-androidbrowser runneropera, chrome-androidrequired
phantombrowser runnersafari
questbrowser runnerchrome-androidrequired
react-nativehermes runnerhermesrequired
rhinorhino runnerrequired
safaribrowser runnerrequired
samsungbrowser runnerchrome-androidrequired

If you have no access to all required browsers / versions of browsers, use Sauce Labs, BrowserStack or Cloud Browser.

Style and standards

The coding style should follow our eslint.config.js. You can test it by calling npm run lint. Different places have different syntax and standard library limitations:

  • Polyfill implementations should use only ES3 syntax and standard library, they should not use other polyfills from the global scope.
  • Unit tests should use the modern syntax with our minimalistic Babel config. Unit tests for the pure version should not use any modern standard library features.
  • Tools, scripts and tests, performed in NodeJS, should use only the syntax and the standard library available in NodeJS 8.

File names should be in the kebab-case. Name of polyfill modules should follow the naming convention namespace.subnamespace-where-required.feature-name, for example, esnext.set.intersection. The top-level namespace should be es for stable ECMAScript features, esnext for ECMAScript proposals and web for other web standards.

Testing

Before testing, you should prepare monorepo and install dependencies:

npm run prepare-monorepo

You can run the most tests by

npm t

You can run parts of the test case separately:

  • Linting:
    npm run lint
    
  • Unit test case in Karma (modern Chromium, Firefox, WebKit (Playwright), ancient WebKit (PhantomJS), IE11 (if available)):
    npx run-s prepare bundle test-unit-karma
    
  • Unit test case in NodeJS:
    npx run-s prepare bundle test-unit-node
    
  • Unit test case in Bun:
    npx run-s prepare bundle test-unit-bun
    
  • Test262 test case (it's not included to the default tests):
    npx run-s prepare bundle-package test262
    
  • Promises/A+ and ES6 Promise test cases:
    npx run-s prepare test-promises
    
  • ECMAScript Observable test case:
    npx run-s prepare test-observables
    
  • CommonJS entry points tests:
    npx run-s prepare test-entries
    
  • core-js-compat tools tests:
    npx run-s prepare test-compat-tools
    
  • core-js-builder tests:
    npx run-s prepare test-builder
    
  • If you want to run tests in a certain browser, at first, you should build packages and test bundles:
    npx run-s prepare bundle
    
  • For running the global version of the unit test case, use this file:
    tests/unit-browser/global.html
    
  • For running the pure version of the unit test case, use this file:
    tests/unit-browser/pure.html