Skip to main content

新增特性时间轴

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

    • Enable the Stage 4 RegExp v flag proposal by default
    • 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
    • Support for the updates of the decorators proposal that reached consensus in the March 2023 and May 2023 TC39 meetings
    • 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

    • TypeScript 5.0 support
    • Support for the updates of the decorators proposal that reached consensus in the January 2023 TC39 meeting
    • Support for the inline RegExp modifiers Stage 3 proposal
      JavaScript
      /(?i-m:a.)/m.exec("a\nAb"); // ["Ab"]
  5. Babel 7.20.0

    blog post

    • TypeScript 4.9 support
    • Parser support for the explicit resource management Stage 2 proposal
      JavaScript
      {
      using handle = openFile(name, "w+");
      write(handle, "Hi!\n");
      write(handle, ":)\n");
      } // Automatically close the file
    • Parser support for the import reflection Stage 2 proposal
      JavaScript
      import module mod from "./mod.js";

      // later ...
      import(mod);

    babel-loader 9.0.0

    release

  6. Babel 7.19.0

    blog post

    • Support for the Stage 3 version of the decorators proposal
    • Transform support for the duplicate named capturing groups Stage 3 proposal
      JavaScript
      /(?<year>\d\d\d\d)-(?<month>\d\d)|(?<month>\d\d)-(?<year>\d\d\d\d)/
  7. Babel 7.18.0

    blog post

    • TypeScript 4.7 support
    • Transform support for the Private destructuring Stage 2 proposal
      JavaScript
      class A {
      #x = 2;
      method() {
      const { #x: x } = this;
      }
      }
    • No more need to manually include the regenerator-runtime helper when compiling generators
  8. Babel 7.17.0

    blog post

    • Support for the new version of the decorators Stage 2 proposal
      JavaScript
      class A {
      @reactive #x = 2;

      @logger
      method() {
      this.#x++;
      }
      }
    • Support for the RegExp set notation and properties of strings Stage 2 proposal
      JavaScript
      /[\p{RGI_Emoji}&&[\0-\uFFFF]]/v;
    • Parser support for the private destructuring Stage 2 proposal
      JavaScript
      class A {
      #x = 2;
      method() {
      const { #x: x } = this;
      }
      }
  9. Babel 7.16.0

    blog post

  10. Babel 7.15.0

    blog post

    • Enable parsing for the top-level await Stage 4 proposal by default
      JavaScript
      import db from "db";
      await db.connect();
    • 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
      }
      }
    • Support the "Hack-style" pipeline operator Stage 2 proposal
      JavaScript
      const result = "World" |> `Hello, ${%}!` |> alert(%);
    • TypeScript 4.4 support
  11. Babel 7.14.0

    blog post

  12. Babel 7.13.0

    博客公告

  13. Babel 7.12.0

    博客公告

  14. Babel 7.11.0

    博客公告

  15. @babel/eslint-parser

    博客公告

  16. Babel 7.10.0

    博客公告

  17. babel-polyfills

    仓库地址

  18. Babel 7.9.0

    博客公告

    • @babel/preset-env 中新增 bugfixes 选项, 以支持更灵活地解决游览器漏洞,而不是重新编译整个特性。
    • 支持 TypeScript 3.8
    • 支持 Flow declare 类字段。
    • 自动支持全新的 JSX 运行环境
  19. Babel 7.8.0

    博客公告

  20. Babel 7.7.0

    博客公告

    • Parser support for the top-level await proposal
      JavaScript
      import db from "./database.js";

      await db.connect();
    • @babel/parser 为早期错误添加错误恢复支持。
    • 支持 .json and .cjs 文件类型
    • 支持 TypeScript 3.7
  21. Babel 7.6.0

    博客公告

    • 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

    博客公告

    • Support for the F# pipeline operator proposal
      JavaScript
      num |> add(2) |> double
    • 支持 TypeScript namespace
  23. Babel 7.4.0

    博客公告

    • Support for injecting core-js@3 polyfills
    • Support for the Partial Application proposal
      JavaScript
      strings.map(parseInt(?));
    • Support for static private methods, part of the static class features proposal
      JavaScript
      class Dog {
      static #register() { /* ... */ }
      }
    • 支持 TypeScript 3.4
  24. Babel 7.3.0

    博客公告

    • 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
    • 在正则表达式中支持 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
  25. Babel 7.2.0

    博客公告

    • Support for instance private methods, part of the private methods proposal
      JavaScript
      class Dog {
      #bark() { console.log("Mew!") }
      }
  26. Babel 7.1.0

    博客公告

    • 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

    博客公告

    此处列出了许多变化,因为它们是两年内将要发布的内容。