跳到主要内容

7.9.0 Released: Smaller preset-env output, Typescript 3.8 support and a new JSX transform

· 阅读需 9 分钟

While preparing the Babel 8.0.0 release (in the next months), we just finished working on a new minor release which includes updates related to @babel/preset-env, TypeScript 3.8, Flow, and JSX!

A few months ago, Jason Miller started working on @babel/preset-modules: an experiment to greatly reduce bundle sizes when using the module/nomodule pattern. We are excited to announce that its functionality has now been merged into @babel/preset-env! This means that its optimizations can be applied to all preset-env targets values, without a separate preset.

Note: These optimizations will be enabled by default in Babel 8. They can be manually enabled in Babel 7.9 by passing in the option { bugfixes: true } to preset-env.

This release also has full support for TypeScript 3.8, which introduced explicit type-only imports and exports (i.e. export type { foo }), and for Flow 0.120, which introduced the declare modifier for class fields (i.e. class C { declare foo: string }).

We also worked with the React team to provide a new JSX transform, which will make it possible for React and React-like libraries to further optimize the creation of JSX elements with the addition of the jsx function vs. React.createElement.

Lastly, @babel/parser now supports an additional ECMAScript proposal: Record & Tuple. Please note that this is only parser support, and the transforms are still being worked on.

You can read the whole changelog on GitHub.

7.8.0 Released: ECMAScript 2020, .mjs configuration files and @babel/cli improvements

· 阅读需 8 分钟

This is the first release of the year! 🎉

Babel 7.8.0 supports the new ECMAScript 2020 features by default: you don't need to enable individual plugins for nullish coalescing (??), optional chaining (?.) and dynamic import() anymore with preset-env.

We also finished aligning our different configuration files with the formats natively supported by Node.js, a process that we started in the 7.7.0 release.

Lastly, Babel's CLI now supports two new options: --out-file-extension and --copy-ignored.

You can read the whole changelog on GitHub.

Babel's Funding Plans

· 阅读需 9 分钟

One of the greatest strengths of open source software is that it is open and free for anyone to contribute. This also leads to one of its greatest challenges, which is to support consistent, sustainable maintenance.

Babel isn't a company. As mentioned in the 7.0.0 post, the all-volunteer Babel team (sans Henry) has been doing its best to steward the project and handle all the expectations of the community. We're glad that we have continued to make releases, but even keeping up-to-date with reported issues is difficult to manage, let alone our integrations with other tools, new proposals, and effect on the greater ecosystem.

In March 2018, Henry left his job to start working on securing more funding for Babel. After a lot of work and support from the community, the team was able to fund Henry as a full-time maintainer.

This has been a big win for the team, but we're finding that it is not enough.

7.7.0 Released: Error recovery and TypeScript 3.7

· 阅读需 9 分钟

Today we are releasing Babel 7.7.0!

This release includes new parser features like top-level await (await x(), Stage 3) and Flow enum declarations (Flow proposal). And now, @babel/parser has the option of recovering from certain syntax errors!

We've also added support for TypeScript 3.7: Babel can parse and transform private class fields with type annotations, public class fields annotations defined using the declare keyword, type assertion function signatures and template literals in enum declarations.

Babel now understands three new configuration files: babel.config.json, babel.config.cjs and .babelrc.cjs, which behave the same as babel.config.js and .babelrc.js files.

Lastly, Babel 7.7.0 uses 20% less memory than 7.6.0.

You can read the whole changelog on GitHub.

7.5.0 Released: dynamic import and F# pipelines

· 阅读需 7 分钟

Today we are releasing Babel 7.5.0!

This release includes improved support for a few ECMAScript proposals: the F# variant of the Stage 1 pipeline operator and an official plugin for the Stage 4 dynamic import() proposal (along with preset-env support). It also has support for TypeScript namespaces (experimental) and for Browserslist's default query in preset-env.

You can read the whole changelog on GitHub.

The Babel Podcast

· 阅读需 5 分钟

Today we're announcing the The Babel Podcast!

You probably use Babel, directly or as a dependency. But do you ever wonder who works on it? Henry Zhu chats with other members of the team, TC39, and the JS community about the future of JavaScript and how it's all maintained. Please join us in babbling about Babel (and everything else)!

Subscribe with: Apple | Google | Spotify | RSS

7.4.0 Released: core-js 3, static private methods and partial application

· 阅读需 11 分钟

Today we are releasing Babel 7.4.0!

This release includes support for TypeScript 3.4, the proposal for partial application in function calls, and static private methods.

We added support for meaningful parenthesized expressions in @babel/parser, and also made it more spec compliant than ever!

Last but not least, both @babel/preset-env and @babel/transform-runtime now support core-js@3, and @babel/template has some sweet new syntax!

You can read the whole changelog on GitHub.