Babel is highly extensible and can be customized based on additional plugins. Developers can create their own transformation pipeline by adding their own plugins. Also, Babel comes with a debugger.
There’s no bulky runtime in Babel; this compiler tries to run as lightweight as possible. As this can’t always be done, the “loose” options for specific transformations trade a light footprint for readability, file size, and speed.
Additionally, Babel can convert JSX syntax with a React preset. Used in conjunction with the babel-sublime package, this makes syntax highlighting easier than ever. Babel can also strip out type annotations with the
So, what’s in Babel 7? Mostly a bunch of new tools and features:
- Upgrading is now a cinch with
babel-upgrade, a tool designed to automatically make upgrade changes.
- There’s also
babel.config.jsfor config resolutions.
- Selective configuration per glob with
- Optimized code for faster build times
- Support for preset and plugin options
- Pure annotation support
Other changes include some syntax changes, improved TypeScript support for functions like
Flow, and JSX fragment support. There’s an experimental feature called automatic polyfills, which will only import the polyfill bits that are necessary to enable features without support in the targeted environment. Plus, Babel macros are now a thing!
Future features include things like plugin ordering, better validation/errors, speed, re-thinking loose/spec options, caching, using Babel asynchronously, building against itself from CI, smoke tests, running test262. As an open source project, Babel is supported by developers like you. Volunteers are highly welcome to join the project and help make these features a reality.
SEE ALSO: A developer’s introduction to React
Getting Babel 7
Want to try it out? There’s a REPL available for developers to tool around and test Babel out.
The latest release of Babel is available on GitHub for free and sundry.