跳到主要内容

· 阅读需 5 分钟

Babel 7.14.0 is out!

This release enables class fields and private methods by default (they were promoted to Stage 4 during the recent April TC39 meeting!) and adds brand checks for private fields and static class blocks to @babel/preset-env's shippedProposals option.

We added support for Stage 1 async do expressions (using @babel/plugin-proposal-async-do-expressions), which extends the Stage 1 do expression proposal.

Thanks to Sosuke Suzuki and Pig Fang, Babel can now handle TypeScript 4.3 features. @babel/parser also has a new option to correctly parse TypeScript declaration files.

Finally, we introduced a new importInterop: node option to make it easier to produce dual modules by compiling ECMAScript imports to CommonJS that follow Node.js semantics.

You can read the whole changelog on GitHub.

· 阅读需 7 分钟

We just published Babel 7.13.0, the first minor release of 2021!

This release includes some important features to @babel/core: a targets option (similar to @babel/preset-env's one) that can be shared across different plugins, an assumptions option to precisely tune your configuration to produce a smaller compilation output, and support for plugins and presets written using native ECMAScript modules.

Babel now supports transforming the Records and Tuples ECMAScript proposal, which brings immutable data structures and structural equality to JavaScript, and parsing the Module Blocks proposal.

Additionally, we added support for some new Flow and TypeScript features.

You can read the full changelog on GitHub.

· 阅读需 4 分钟

We just published a new minor version of Babel!

This release includes support for the new TypeScript 4.1 beta features: template literal types and key remapping in mapped types.

Additionally, we implemented two new ECMAScript proposals: class static blocks and imports and exports with string names.

Lastly, we renamed @babel/plugin-syntax-module-attributes (and the corresponding parser plugin moduleAttributes) to @babel/plugin-syntax-import-assertions (and importAssertions), to match the recent proposal updates. The old plugin will work until Babel 8, but it's deprecated now.

You can read the whole changelog on GitHub.

· 阅读需 5 分钟

We just released a new minor version of Babel!

This 7.11 release includes:

  • preset-env support for Logical Assignments (??=), Numeric Separators (1_2) and Namespace re-exports (export * as ns from ...)
  • TypeScript 4.0 support
  • Parser support for the Stage-1 Decimal proposal (7.11m)
  • An environment flag to print the resolved Babel configuration for a given file (BABEL_SHOW_CONFIG_FOR)

In addition to this, we are now releasing the successor of babel-eslint: @babel/eslint-parser!

You can read the whole changelog on GitHub.

· 阅读需 9 分钟

We just released a new minor version of Babel!

This 7.10 release includes:

  • Full support for the new Stage 1 proposal, #prop in obj checks for private fields proposal.
  • @babel/preset-env now compiles ES2015-style Unicode escapes (\u{Babe1}) to the equivalent legacy syntax (\uDAAA\uDFE1).
  • Two improvements to the Optional Chaining operator (?.)
  • Parser support for the new Stage 1 Module Attributes proposal (import a from "./a.json" with type: "json").
  • Better tree-shaking support for React code (i.e. React.memo)!
  • Setting up RFCs repo and GitHub Discussions pages!

You can read the whole changelog on GitHub.

· 阅读需 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.

· 阅读需 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.

· 阅读需 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.