Skip to main content

7.22.0 发布:支持显式资源管理和导入属性解析

· 11 min read

Babel 7.22.0 已经发布,支持解析/转换 显式资源管理 提案,包括同步和异步两种版本,并且支持解析 导入属性(这是旧的 导入断言 提案的发展版)。

🌐 Babel 7.22.0 is out, with parsing/transform support for the Explicit Resource Management proposal, including both the sync and async variants, and with parsing support for the Import Attributes (an evolution of the old Import Assertions proposal).

我们也根据提案中的一些变化更新了装饰器的实现,并新增了对 TypeScript import ... = 和 export ... = 语句的支持。

🌐 We also updated our implementation of decorators following some changes in the proposal, and added support for the TypeScript import ... = and export ... = statements.

@babel/preset-env 现在默认支持 v 正则表达式标志的转换功能,这个标志最近作为 ECMAScript 标准的一部分被批准了。最后,我们把所有用于 稳定 ECMAScript 特性的插件名称从 -proposal- 改成了 -transform-。

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.21.0 发布:内联正则表达式修饰符、TypeScript 5.0 和装饰器更新

· 8 min read

我们刚刚发布了 Babel 7.21.0!

🌐 We just published Babel 7.21.0!

Babel 现在支持 Inline RegExp modifiers 提案、最新版本的 Decorators 提案,以及新的 TypeScript 5.0 语法。

🌐 Babel now supports the Inline RegExp modifiers proposal, the latest version of the Decorators proposal, and the new TypeScript 5.0 syntax.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.20.0 发布:Deno 目标和 TypeScript 4.9

· 6 min read

我们刚刚发布了 Babel 7.20.0!

🌐 We just published Babel 7.20.0!

这个版本增加了对 TypeScript 4.9 的支持,并且解析器现在支持 Import Reflection 和 Explicit Resource Management 阶段 2 的提案。此外,你现在还可以将 Deno 用作你的编译目标之一。

🌐 This release includes support for TypeScript 4.9, and parser support for the Import Reflection and Explicit Resource Management Stage 2 proposals. Additionally, you can now use Deno as one of your compilation targets.

在过去的几个版本中,我们对 @babel/generator 的代码位置跟踪进行了逐步改进,这提高了源映射的质量,并改善了生成输出中注释的位置。

🌐 In the past few releases we have made gradual improvements @babel/generator's code location tracking, which lead to higher source map quality and better positioning of comments in the generated output.

我们也发布了 babel-loader 的 9.0.0 版本,这是 Webpack 的 Babel 加载器。

🌐 We are also releasing version 9.0.0 of babel-loader, the Babel loader for Webpack.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.19.0 发布:第三阶段装饰器和更多正则表达式功能!

· 6 min read

我们刚刚发布了 Babel 7.19.0!

🌐 We just published Babel 7.19.0!

这个版本更新了我们对 装饰器提案 的实现,该提案在三月达到了第三阶段。它还包括对正则表达式中新 重复命名捕获组提案 的支持。

🌐 This release updates our implementation of the decorators proposal, which reached Stage 3 in March. It also includes support for the new duplicate named capturing groups proposal for regular expressions.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.17.0 发布:RegExp 的 'v' 模式和……🥁 装饰器!

· 9 min read

我们刚刚发布了 Babel 7.17.0!

🌐 We just published Babel 7.17.0!

经过多年的迭代、重写和调整,看起来装饰器提案终于在一个新的设计上再次稳定下来了!这个版本包括了对新提案的解析和转换支持。

🌐 After years of iterations, rewrites and adjustments it looks like the decorators proposal has finally stabilized again on a new design! This release includes both parse and transform support for the new proposal.

我们还实现了RegExp v 标志提案,并增加了对解构私有字段的解析支持,这两者目前都处于 Stage 2。最后,还有一个 @babel/register 的新实验性实现。

🌐 We also implemented the RegExp v flag proposal and added parsing support for destructuring private fields, both currently Stage 2. Lastly, a new experimental implementation of @babel/register.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.16.0 发布:ESLint 8 和 TypeScript 4.5

· 6 min read

我们刚刚发布了 Babel 7.16.0!

🌐 We just published Babel 7.16.0!

这个版本默认启用了class 静态初始化块。它还支持pipeline 操作符 提案的新变体,并兼容 TypeScript 4.5。

🌐 This release enables class static initialization blocks by default. It includes support for a new variant of the pipeline operator proposal, as well as TypeScript 4.5 compatibility.

此外,@babel/eslint-parser 现在支持 ESLint 8。

🌐 Furthermore, @babel/eslint-parser now supports ESLint 8.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.15.0 发布:黑客风格的流水线、TypeScript const 枚举和 Rhino 目标支持

· 8 min read

这个版本默认支持解析顶层 await(在五月会议上达到第 4 阶段)以及转换私有字段的人性化品牌检查(在七月会议上达到第 4 阶段)。现在还支持Hack 风格的管道操作符。我们还改进了 TypeScript 支持,实现了对 const 枚举和命名空间别名的转换支持,并扩展了我们的启发式方法,将 .displayName 添加到由 React.createContext() 创建的 React 组件中(#13501)。

🌐 This release enables parsing top-level await (Stage 4 at the May meeting) and transforming ergonomic brand checks for private fields (Stage 4 at the July meeting) by default. There is also now support for the Hack-style pipeline operator. We also improved our TypeScript support, implementing transform support for const enums and namespace aliases, and we expanded our heuristics to add .displayName to React components created by React.createContext() (#13501).

我们还引入了一个新的编译器假设 noIncompleteNsImportDetection,在将 ECMAScript 模块编译为 CommonJS 时,可以生成更小的输出,同时不用担心模块循环导致的部分初始化的命名空间导入问题。

🌐 We also introduced a new compiler assumption, noIncompleteNsImportDetection, to produce a smaller output when compiling ECMAScript modules to CommonJS without worrying about partially initialized namespace imports caused by module cycles.

另外,你现在可以指定 Rhino 作为编译目标。

🌐 Additionally, you can now specify Rhino as a compilation target.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.

7.14.0 发布:新类功能默认启用,支持 TypeScript 4.3,以及更好的 CommonJS 互操作

· 11 min read

Babel 7.14.0 发布啦!

🌐 Babel 7.14.0 is out!

这个版本默认启用了类字段和私有方法(它们在最近四月的 TC39 会议 中被提升到第四阶段!),并且为 @babel/preset-env 的 shippedProposals 选项增加了私有字段和静态类块的品牌检查。

🌐 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.

我们增加了对阶段 1 异步 do 表达式(使用 @babel/plugin-proposal-async-do-expressions)的支持,这扩展了阶段 1 do 表达式 提案。

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

多亏了 Sosuke Suzuki 和 Pig Fang,Babel 现在可以处理 TypeScript 4.3 的功能了。@babel/parser 也有了一个新选项,可以正确解析 TypeScript 声明 文件。

🌐 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.

最后,我们引入了一个新的 importInterop: node 选项,使得通过将 ECMAScript 导入编译为遵循 Node.js 语义的 CommonJS 来生成双模块更加容易。

🌐 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.

你可以在 GitHub 上阅读完整的更新日志。

🌐 You can read the whole changelog on GitHub.