* Replace lodash 'values' usage with Object.keys => .map(obj[key]) * Block scoping: refactor letReferences, outsideLetReferences as objects of type Map * Remove lodash dependency from babel-plugin-transform-block-scoping * Fixup: Add missing Object.keys call * Fixup: Update remaining property accessors * Coerce Map.values() iterator results into an array via spread operator * Fixup: Map.put -> Map.set * Fixup: undo incorrect variable de-duplication * Replace array-spread-plus-map combination with Array.from call * Extract an extendMap function as an attempt to create an optimization boundary * Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map ) * Fixup: perform String cast on map keys, not values * Revert "Fixup: perform String cast on map keys, not values" This reverts commit abdd147438fa74f51ac50ef1f96bb462810cd3f2. * Revert "Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )" This reverts commit a4035c885b37bfd6e926a0362bda9dcf5b5a52c2. * Experiment: filter keys via Object.prototype.hasOwnProperty.call * Revert "Experiment: filter keys via Object.prototype.hasOwnProperty.call" This reverts commit 491c093f213c6229815b2e6dc9243245376265b0. * Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access * Revert "Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access" This reverts commit 2119acc7f0d78ced3b9ad77820b4b72e5ad67475. * Iterate over a clone of outsideRefs keys * Revert "Extract an extendMap function as an attempt to create an optimization boundary" This reverts commit 85689f2bfc180d0b5c0e674e5de7954470c7ec69. * Fixup: migrate remaining Object property access to Map.get in tdz module
The compiler for writing next generation JavaScript.
Supporting Babel
Babel (pronounced "babble") is a community-driven project used by many companies and projects, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:
- Giving developer time on the project. (Message us on Twitter or Slack for guidance!)
- Giving funds by becoming a sponsor on Open Collective or Patreon!
Sponsors
Our top sponsors are shown below! [Become a sponsor]
Intro
Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.
In
// ES2020 nullish coalescing
function greet(input) {
return input ?? "Hello world";
}
Out
function greet(input) {
return input != null ? input : "Hello world";
}
Try it out at our REPL.
FAQ
Who maintains Babel?
Mostly a handful of volunteers, funded by you! Please check out our team page!
Is there a Babel song?
I'm so glad you asked: Hallelujah —— In Praise of Babel by @angus-c, audio version by @swyx. Tweet us your recordings!
Looking for support?
For questions and support please join our Slack Community (you can sign-up here for an invite), ask a question on Stack Overflow, or ping us on Twitter.
Where are the docs?
Check out our website: babeljs.io, and report issues/features at babel/website.
Want to report a bug or request a feature?
Please read through our CONTRIBUTING.md and fill out the issue template at babel/issues!
Want to contribute to Babel?
Check out:
- Our #development Slack channel and say hi (signup)!
- Issues with the good first issue and help wanted label. We suggest also looking at the closed ones to get a sense of the kinds of issues you can tackle.
Some resources:
- Our CONTRIBUTING.md to get started with setting up the repo.
- Our discussions/notes/roadmap: babel/notes
- Our progress on TC39 proposals: babel/proposals
- Our blog which contains release posts and explanations: /blog
- Our videos page with talks about open source and Babel: /videos
- Our podcast
How is the repo structured?
The Babel repo is managed as a monorepo that is composed of many npm packages.