Babel
  • Docs
  • Setup
  • Try it out
  • Videos
  • Blog
  • Donate
  • Team
  • GitHub

›All Blog Posts

All Blog Posts

  • 7.18.0 Released: Destructuring private elements and TypeScript 4.7
  • 7.17.0 Released: RegExp 'v' mode and ... 🥁 decorators!
  • 7.16.0 Released: ESLint 8 and TypeScript 4.5
  • 7.15.0 Released: Hack-style pipelines, TypeScript const enums and Rhino target support
  • Babel is used by millions, so why are we running out of money?
  • 7.14.0 Released: New class features enabled by default, TypeScript 4.3, and better CommonJS interop
  • 7.13.0 Released: Records and Tuples, granular compiler assumptions, and top-level targets
  • 7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks
  • 7.11.0 Released: ECMAScript 2021 support in preset-env, TypeScript 4.0 support, printing config and the future of `babel-eslint`
  • The State of babel-eslint
  • 7.10.0 Released: Class Fields in preset-env, '#private in' checks and better React tree-shaking
  • 7.9.0 Released: Smaller preset-env output, Typescript 3.8 support and a new JSX transform
  • 7.8.0 Released: ECMAScript 2020, .mjs configuration files and @babel/cli improvements
  • Babel's Funding Plans
  • 7.7.0 Released: Error recovery and TypeScript 3.7
  • 7.6.0 Released: Private static accessors and V8 intrinsic syntax
  • 7.5.0 Released: dynamic import and F# pipelines
  • The Babel Podcast
  • 7.4.0 Released: core-js 3, static private methods and partial application
  • 7.3.0 Released: Named capturing groups, private instance accessors and smart pipelines
  • 7.2.0 Released: Private Instance Methods
  • TC39 Standards Track Decorators in Babel
  • 7.1.0 Released: Decorators, Private Static Fields
  • Babel 7 Released
  • Removing Babel's Stage Presets
  • What's Happening With the Pipeline (|>) Proposal?
  • Announcing Babel's New Partnership with trivago!
  • On Consuming (and Publishing) ES2015+ Packages
  • Nearing the 7.0 Release
  • Babel Turns Three
  • Planning for 7.0
  • Zero-config code transformation with babel-plugin-macros
  • Contributing to Babel: Three Lessons to Remember
  • Personal Experiences at Babel #1 — A PR with Unusually High Number of Reviews
  • Babel and Summer of Code 2017
  • Upgrade to Babel 7 (moved)
  • Upgrade to Babel 7 for Tool Authors (WIP)
  • 6.23.0 Released
  • The State of Babel
  • 6.19.0 Released
  • 6.18.0 Released
  • 6.16.0 Released
  • Babili (babel-minify)
  • 6.14.0 Released
  • Babel Doctor
  • Setting up Babel 6
  • 6.0.0 Released
  • React on ES6+
  • Function Bind Syntax
  • 5.0.0 Released
  • Babel <3 React
  • Not Born to Die
  • 2to3
  • 6to5 + esnext

7.16.0 Released: ESLint 8 and TypeScript 4.5

October 29, 2021

Babel Team

We just published Babel 7.16.0!

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.

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

You can read the whole changelog on GitHub.

If you or your company want to support Babel and the evolution of JavaScript, but aren't sure how, you can donate to us on our Open Collective and, better yet, work with us on the implementation of new ECMAScript proposals directly! As a volunteer-driven project, we rely on the community's support to fund our efforts in supporting the wide range of JavaScript users. Reach out at team@babeljs.io if you'd like to discuss more!

Highlights

Class static blocks enabled by default (#13713)

class MyClass {
  static {
    doSomeInitialization(MyClass);
    console.log("MyClass initialized!");
  }
}

Static blocks, that reached Stage 4 in August, are now enabled by default in @babel/parser and @babel/preset-env.

If you were using the classStaticBlock parser plugin, or @babel/plugin-syntax-class-static-block, you can safely remove them from your config.

If you already use @babel/preset-env, you can now remove @babel/plugin-proposal-class-static-block from your config.

TypeScript 4.5 features (#13802, #13838)

TypeScript 4.5 introduces a new syntax for marking imports as type-only: rather than marking the whole import statement, you can mark a single specifier:

// TypeScript 4.4
import type { Foo } from "my-module";
import { fooInstance } from "my-module";

// TypeScript 4.5
import { type Foo, fooInstance } from "my-module";

It also supports two new file extensions: .mts and .cts, that mirror .mjs and .cjs. When passing an .mts or .cts file to Babel with @babel/preset-typescript enabled, it uses the file extension to detect the desired source type ("module" or "script").

.mts and .cts file cannot contain JSX code by default, but they cannot contain TypeScript annotations that would be ambiguous with JSX (<Type> cast and <T>() => {}).

You can read the full TypeScript 4.5 release post on their blog.

^ topic token for Hack-style pipes (#13749)

The champions of the pipeline operator proposal are considering various topic tokens (the reference to the value from the previous pipeline step).

@babel/plugin-proposal-pipeline-operator (and the "pipelineOperator" parser plugin) now support three of them: #, ^ and %.

let values = getNames()
  |> ["default"].concat(^)
  |> await loadValues(^);

You can enable the current version of the pipeline operator proposal using the proposal: "hack" option, and you can choose the topic token using topicToken: "^":

{
  "plugins": [
    ["@babel/plugin-proposal-pipeline-operator", {
      "proposal": "hack",
      "topicToken": "^"
    }]
  ]
}

ESLint 8 support in @babel/eslint-parser (#13782)

@babel/eslint-parser now supports ESLint 8: you can update your "eslint" dependency and it will just work.

If you are an ESLint plugin author, pay attention to the breaking change in the AST for class fields and private methods: when using ESLint 7 they follow the Babel AST shape; when using ESLint 8 they follow ESLint and the ESTree specification. This is because ESLint introduced support for these new class features starting from ESLint 8.

Recent Posts
  • Highlights
    • Class static blocks enabled by default (#13713)
    • TypeScript 4.5 features (#13802, #13838)
    • ^ topic token for Hack-style pipes (#13749)
    • ESLint 8 support in @babel/eslint-parser (#13782)
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site