7.29.0 Released: The last Babel 7 minor release
Babel 7.29.0 is out!
This is the last minor release of Babel 7, as we are getting ready to release Babel 8.0.0. Babel 8.0.0-rc is also out today: go try it out!
This release include support for defining transpilation targets in @babel/standalone through a data-target attribute on <script> elements. It also adds support for the @babel/core async API to @babel/standalone.
Both of these changes are meant to ease the migration from Babel 7 to Babel 8.
You can read the whole changelog on GitHub. If you are already using Babel 8 beta, all the new 7.28.0 features are included in v8.0.0-rc.1.
If you or your company want to support Babel and the evolution of JavaScript but aren't sure how, you can donate to us on our Open Collective and, better yet, work with us on the implementation of new ECMAScript proposals directly! As a volunteer-driven project, we rely on the community's support to fund our efforts in supporting the wide range of JavaScript users. Reach out at team@babeljs.io if you'd like to discuss more!
Highlights
@babel/standalone support for data-targets attribute (#17482)
By default @babel/preset-env transforms your code all the way down to ES5. This is changing in Babel 8, where it will default to Browserslist's defaults query.
It is recommended to always specify your targets explicitly, already starting in Babel 7, so that your output will not change with the major upgrade. This new attribute makes it possible to do so when using @babel/standalone to automatically transform <script> tags:
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" data-targets="firefox 97, chrome 102">
const getMessage = () => "Hello World";
document.getElementById("output").innerHTML = getMessage();
</script>
Note that Browserslist does not support specifying "current browser" as a target: it's your reponsability to pick old enough targets that your users' browsers are supported.
Babel 8.0.0-rc.1
After years in the making, Babel 8 is finally ready. We are releasing it as 8.0.0-rc.1, so that more users can try it out and report problems before the final release. There are no further changes that we plan to introduce, unless due to feedback from users trying the latest pre-releases.
A guiding principle for the breaking changes we've introduced is that updating to Babel 8 should be easy: most of them have been already introduced in Babel 7 behind an option, so that you can start adapting your code before actually performing the update.
We've prepared some great resources to navigate through what's needed to upgrade from Babel 7 to Babel 8:
- a migration guide for Babel users;
- a migration guide for developers using Babel's API, such as Babel plugin authors or direct consumers of our AST;
- the website with the Babel 8 documentation, currently hosted at https://next.babeljs.io/ until Babel 8 becomes stable.
There are many breaking changes that hopefully will not impact our users, but of which we are incredibly excited about: an example is that Babel 8 will ship as an ESM-only package. We've been trying to figure out how to make this work for very long time, and finally with the require(esm) support shipped in Node.js 20 we are comfortable with not providing a CommonJS alternative.
You can also read the full changelog of each Babel 8 pre-release on GitHub.