Skip to main content

特性时间表

我们在每个 Babel 版本中引入了哪些主要的新特性?此页面包含每个次要版本的非常简短的摘要,或者你可以阅读完整的更新日志 在 GitHub 上!此外,使用此时间线来跟踪其他一些重要的工作,例如 babel-polyfills 项目。

¥Which major new features did we introduce in each Babel version? This page includes a very short summary for each minor release, or you can read the full changelog on GitHub! Additionally, use this timeline to track some other important efforts, such as the babel-polyfills project.

  1. Babel 7.24.0

    博文

    ¥blog post

  2. Babel 7.23.0

    博文

    ¥blog post

  3. Babel 7.22.0

    博文

    ¥blog post

    • 默认启用 Stage 4 正则表达式 v 标志 提案

      ¥Enable the Stage 4 RegExp v flag proposal by default

    • 支持 明确的资源管理 提案 Stage 3 提案,包括 异步版本

      ¥Support for the explicit resource management proposal Stage 3 proposal, including the async version

      JavaScript
      {
      await using db = connect(databaseURL);
      let user = await db.getUserById(userId);
      await db.createPost(user.name, "Hi! :)");
      } // Automatically close the db
    • 支持更新 2023 年 3 月和 2023 年 5 月 TC39 会议达成共识的 decorators 提案

      ¥Support for the updates of the decorators proposal that reached consensus in the March 2023 and May 2023 TC39 meetings

    • 对 Stage 3 导入属性 提案(以前称为 "导入断言")的解析支持

      ¥Parsing support for the Stage 3 import attributes proposal, previously known as "import assertions"

      JavaScript
      import data from "./data.json" with { type: "json" };
  4. Babel 7.21.0

    博文

    ¥blog post

  5. Babel 7.20.0

    博文

    ¥blog post

    babel-loader 9.0.0

    release

  6. Babel 7.19.0

    博文

    ¥blog post

  7. Babel 7.18.0

    博文

    ¥blog post

    • TypeScript 4.7 支持

      ¥TypeScript 4.7 support

    • 转变对 私有解构 Stage 2 提案的支持

      ¥Transform support for the Private destructuring Stage 2 proposal

      JavaScript
      class A {
      #x = 2;
      method() {
      const { #x: x } = this;
      }
      }
    • 编译生成器时不再需要手动包含 regenerator-runtime 助手

      ¥No more need to manually include the regenerator-runtime helper when compiling generators

  8. Babel 7.17.0

    博文

    ¥blog post

  9. Babel 7.16.0

    博文

    ¥blog post

  10. Babel 7.15.0

    博文

    ¥blog post

    • 默认启用解析 顶层 await Stage 4 提案

      ¥Enable parsing for the top-level await Stage 4 proposal by default

      JavaScript
      import db from "db";
      await db.connect();
    • 默认启用 私有品牌检查 Stage 4 提案

      ¥Enable the Private Brand Checks Stage 4 proposal by default

      JavaScript
      class A {
      static { initialize(A); } // static block
      #field;
      is(obj) {
      return #field in obj; // private brand check
      }
      }
    • 支持 "黑客风格" 管道运算符 Stage 2 提案

      ¥Support the "Hack-style" pipeline operator Stage 2 proposal

      JavaScript
      const result = "World" |> `Hello, ${%}!` |> alert(%);
    • TypeScript 4.4 支持

      ¥TypeScript 4.4 support

  11. Babel 7.14.0

    博文

    ¥blog post

  12. Babel 7.13.0

    博文

    ¥blog post

  13. Babel 7.12.0

    博文

    ¥blog post

  14. Babel 7.11.0

    博文

    ¥blog post

  15. @babel/eslint-parser

    博文

    ¥blog post

  16. Babel 7.10.0

    博文

    ¥blog post

  17. babel-polyfills

    repository

  18. Babel 7.9.0

    博文

    ¥blog post

    • @babel/preset-env 中的 bugfixes 选项,用于解决浏览器错误而不是编译整个功能

      ¥bugfixes option in @babel/preset-env, to workaround browsers bugs rather than compiling whole Features

    • TypeScript 3.8 支持

      ¥TypeScript 3.8 support

    • 支持 Flow declare 类字段

      ¥Support for Flow declare class fields

    • 支持 automatic JSX 运行时

      ¥Support for the automatic JSX runtime

  19. Babel 7.8.0

    博文

    ¥blog post

  20. Babel 7.7.0

    博文

    ¥blog post

    • 顶层 await 提案的解析器支持

      ¥Parser support for the top-level await proposal

      JavaScript
      import db from "./database.js";

      await db.connect();
    • @babel/parser 中的早期错误添加错误恢复支持

      ¥Add error recovery support for Early Errors in @babel/parser

    • 支持 .json.cjs 配置文件

      ¥Support .json and .cjs configuration files

    • TypeScript 3.7 支持

      ¥TypeScript 3.7 support

  21. Babel 7.6.0

    博文

    ¥blog post

    • 支持静态私有访问器,静态类特性 提案的一部分

      ¥Support for static private accessors, part of the static class features proposal

      JavaScript
      class Dog {
      static get #className() { return "Dog"; }
      }
  22. Babel 7.5.0

    博文

    ¥blog post

  23. Babel 7.4.0

    博文

    ¥blog post

  24. Babel 7.3.0

    博文

    ¥blog post

    • 支持实例私有访问器,私有方法 提案的一部分

      ¥Support for instance private accessors, part of the private methods proposal

      JavaScript
      class Dog {
      get #randomId() { return Math.random(); }
      }
    • 支持 智能管道运算符 提案

      ¥Support for the smart pipeline operator proposal

      JavaScript
      num |> add(2, #) |> double
    • 支持正则表达式中的 命名捕获组

      ¥Support for named capturing groups in regular expressions

      JavaScript
      str.match({String.raw`/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/`})
    • TypeScript 3.2 和 2.9 支持

      ¥TypeScript 3.2 and 2.9 support

  25. Babel 7.2.0

    博文

    ¥blog post

    • 支持实例私有方法,私有方法 提案的一部分

      ¥Support for instance private methods, part of the private methods proposal

      JavaScript
      class Dog {
      #bark() { console.log("Mew!") }
      }
  26. Babel 7.1.0

    博文

    ¥blog post

    • 支持 2018 年 9 月指定的 decorators 提案

      ¥Support for the decorators proposal, as it was specified in September 2018

      JavaScript
      class Person {
      @autoIncrement age;
      }
    • 支持静态私有字段,静态类特性 提案的一部分

      ¥Support for static private fields, part of the static class features proposal

      JavaScript
      class Person {
      static #classId = 3;
      }
  27. Babel 7

    博文

    ¥blog post

    自从它是 2 年的预发布以来,这有更多的变化。

    ¥This has a lot more changes since it was 2 years of pre-releases.