diff --git a/_redirects b/_redirects index 79bef5c1d..83a360c41 100644 --- a/_redirects +++ b/_redirects @@ -70,6 +70,7 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301! /docs/babel-plugin-proposal-class-properties /docs/babel-plugin-transform-class-properties /docs/babel-plugin-proposal-private-methods /docs/babel-plugin-transform-private-methods /docs/babel-plugin-proposal-numeric-separator /docs/babel-plugin-transform-numeric-separator +/docs/babel-plugin-proposal-dynamic-import /docs/babel-plugin-transform-dynamic-import /docs/babel-plugin-proposal-logical-assignment-operators /docs/babel-plugin-transform-logical-assignment-operators /docs/babel-plugin-proposal-nullish-coalescing-operator /docs/babel-plugin-transform-nullish-coalescing-operator /docs/babel-plugin-proposal-optional-chaining /docs/babel-plugin-transform-optional-chaining @@ -93,7 +94,7 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301! # Blog rewrites /7.24.0 /blog/2024/02/28/7.24.0 -/7.23.0 /blog/2023/09/25/7.22.0 +/7.23.0 /blog/2023/09/25/7.23.0 /7.22.0 /blog/2023/05/26/7.22.0 /7.21.0 /blog/2023/02/20/7.21.0 /7.20.0 /blog/2022/10/27/7.20.0 diff --git a/docs/parser.md b/docs/parser.md index 91cb21e6b..d80cd613b 100644 --- a/docs/parser.md +++ b/docs/parser.md @@ -118,7 +118,8 @@ It is based on [ESTree spec][] with the following deviations: - [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][] - [ClassMethod][], [ClassPrivateMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node. - [ChainExpression][] is replaced with [OptionalMemberExpression][] and [OptionalCallExpression][] -- [ImportExpression][] is replaced with a [CallExpression][] whose `callee` is an [Import] node. +- [ImportExpression][] is replaced with a [CallExpression][] whose `callee` is an [Import] node. This change will be reversed in Babel 8. +- [ExportAllDeclaration][] with `exported` field is replaced with an [ExportNamedDeclaration][] containing an [ExportNamespaceSpecifier][] node. :::tip There is now an `estree` plugin which reverts these deviations @@ -134,6 +135,7 @@ AST for JSX code is based on [Facebook JSX AST][]. [propertydefinition]: https://github.com/estree/estree/blob/master/es2022.md#propertydefinition [chainexpression]: https://github.com/estree/estree/blob/master/es2020.md#chainexpression [importexpression]: https://github.com/estree/estree/blob/master/es2020.md#importexpression +[exportalldeclaration]: https://github.com/estree/estree/blob/master/es2020.md#exportalldeclaration [privateidentifier]: https://github.com/estree/estree/blob/master/es2022.md#privateidentifier [stringliteral]: https://github.com/babel/babel/tree/main/packages/babel-parser/ast/spec.md#stringliteral [numericliteral]: https://github.com/babel/babel/tree/main/packages/babel-parser/ast/spec.md#numericliteral @@ -157,6 +159,8 @@ AST for JSX code is based on [Facebook JSX AST][]. [optionalcallexpression]: https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#optionalcallexpression [callexpression]: https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#callexpression [import]: https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#import +[exportnameddeclaration]: https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#exportnameddeclaration +[exportnamespacespecifier]: https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#exportnamespacespecifier [facebook jsx ast]: https://github.com/facebook/jsx/blob/master/AST.md ### Semver diff --git a/docs/plugin-bugfix-firefox-class-in-computed-class-key.md b/docs/plugin-bugfix-firefox-class-in-computed-class-key.md new file mode 100644 index 000000000..84082a515 --- /dev/null +++ b/docs/plugin-bugfix-firefox-class-in-computed-class-key.md @@ -0,0 +1,45 @@ +--- +id: babel-plugin-bugfix-firefox-class-in-computed-class-key +title: "@babel/plugin-bugfix-firefox-class-in-computed-class-key" +sidebar_label: bugfix-firefox-class-in-computed-class-key +--- + +This bugfix plugin transforms classes inside computed keys of other classes to workaround a [SpiderMonkey bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1887677) with private class elements. + +:::tip +This plugin is included in `@babel/preset-env`, and Babel will automatically enable this plugin for you when your `targets` are affected by the browser bug. +::: + +:::warning +Terser versions older than 5.30.2 will undo the transform done by this plugin. Make sure to use at least version 5.30.2, or set the Terser's [`compress.inline`](https://terser.org/docs/options/#compress-options) option to `false`. +::: + +## Installation + +```shell npm2yarn +npm install --save-dev @babel/plugin-bugfix-firefox-class-in-computed-class-key +``` + +## Usage + +### With a configuration file (Recommended) + +```json title="babel.config.json" +{ + "plugins": ["@babel/plugin-bugfix-firefox-class-in-computed-class-key"] +} +``` + +### Via CLI + +```sh title="Shell" +babel --plugins @babel/plugin-bugfix-firefox-class-in-computed-class-key script.js +``` + +### Via Node API + +```js title="JavaScript" +require("@babel/core").transformSync("code", { + plugins: ["@babel/plugin-bugfix-firefox-class-in-computed-class-key"], +}); +``` diff --git a/docs/plugin-proposal-decorators.md b/docs/plugin-proposal-decorators.md index 63b6e8dda..559dbe948 100644 --- a/docs/plugin-proposal-decorators.md +++ b/docs/plugin-proposal-decorators.md @@ -110,7 +110,7 @@ Selects the decorators proposal to use: `"2023-11"`, `"2023-05"`, `"2023-01"`, `"2022-03"`, `"2021-12"`, `"2018-09"` or `"legacy"`. Selects the decorators proposal to use: -- `"2023-11"` is the proposal version after the updates that reached consensus in the November 2023 TC30 meetings, intergrating [this change](https://github.com/pzuraq/ecma262/pull/12) +- `"2023-11"` is the proposal version after the updates that reached consensus in the November 2023 TC39 meetings, intergrating [this change](https://github.com/pzuraq/ecma262/pull/12) - `"2023-05"` is the proposal version after the updates that reached consensus in the March and May 2023 TC39 meetings, integrating [these changes](https://github.com/pzuraq/ecma262/compare/e86128e13b63a3c2efc3728f76c8332756752b02...c4465e44d514c6c1dba810487ec2721ccd6b08f9). - `"2023-01"` is the proposal version after the updates that reached consensus in the January 2023 TC39 meeting, integrating [`pzuraq/ecma262#4`](https://github.com/pzuraq/ecma262/pull/4). - `"2022-03"` is the proposal version that reached consensus for Stage 3 in the March 2022 TC39 meeting. You can read more about it at [`tc39/proposal-decorators@8ca65c046d`](https://github.com/tc39/proposal-decorators/tree/8ca65c046dd5e9aa3846a1fe5df343a6f7efd9f8). diff --git a/docs/plugin-proposal-optional-chaining-assign.md b/docs/plugin-proposal-optional-chaining-assign.md index e359b4b48..9a687e226 100644 --- a/docs/plugin-proposal-optional-chaining-assign.md +++ b/docs/plugin-proposal-optional-chaining-assign.md @@ -34,10 +34,12 @@ npm install --save-dev @babel/plugin-proposal-optional-chaining-assign ```json title="babel.config.json" { "plugins": [ - "@babel/plugin-proposal-optional-chaining-assign", - { - "version": "2023-07" - } + [ + "@babel/plugin-proposal-optional-chaining-assign", + { + "version": "2023-07" + } + ] ] } ``` diff --git a/docs/plugin-proposal-dynamic-import.md b/docs/plugin-transform-dynamic-import.md similarity index 88% rename from docs/plugin-proposal-dynamic-import.md rename to docs/plugin-transform-dynamic-import.md index 439f68779..89c0c478b 100644 --- a/docs/plugin-proposal-dynamic-import.md +++ b/docs/plugin-transform-dynamic-import.md @@ -1,6 +1,6 @@ --- -id: babel-plugin-proposal-dynamic-import -title: "@babel/plugin-proposal-dynamic-import" +id: babel-plugin-transform-dynamic-import +title: "@babel/plugin-transform-dynamic-import" sidebar_label: dynamic-import --- @@ -74,7 +74,7 @@ will be transformed to ## Installation ```shell npm2yarn -npm install --save-dev @babel/plugin-proposal-dynamic-import +npm install --save-dev @babel/plugin-transform-dynamic-import ``` ## Usage @@ -84,7 +84,7 @@ npm install --save-dev @babel/plugin-proposal-dynamic-import ```json title="babel.config.json" { "plugins": [ - "@babel/plugin-proposal-dynamic-import", + "@babel/plugin-transform-dynamic-import", "@babel/plugin-transform-modules-commonjs" ] } @@ -93,7 +93,7 @@ npm install --save-dev @babel/plugin-proposal-dynamic-import ### Via CLI ```sh title="Shell" -babel --plugins=@babel/plugin-proposal-dynamic-import,@babel/plugin-transform-modules-amd script.js +babel --plugins=@babel/plugin-transform-dynamic-import,@babel/plugin-transform-modules-amd script.js ``` ### Via Node API @@ -101,7 +101,7 @@ babel --plugins=@babel/plugin-proposal-dynamic-import,@babel/plugin-transform-mo ```js title="JavaScript" require("@babel/core").transformSync("code", { plugins: [ - "@babel/plugin-proposal-dynamic-import", + "@babel/plugin-transform-dynamic-import", "@babel/plugin-transform-modules-systemjs" ], }); diff --git a/docs/plugin-transform-runtime.md b/docs/plugin-transform-runtime.md index e71d55d0a..65c7296ea 100644 --- a/docs/plugin-transform-runtime.md +++ b/docs/plugin-transform-runtime.md @@ -5,10 +5,14 @@ title: "@babel/plugin-transform-runtime" A plugin that enables the re-use of Babel's injected helper code to save on codesize. +::::babel7 + :::note Instance methods such as `"foobar".includes("foo")` will only work with `core-js@3`. If you need to polyfill them, you can directly import `"core-js"` or use `@babel/preset-env`'s `useBuiltIns` option. ::: +:::: + ## Installation Install it as development dependency. @@ -35,10 +39,14 @@ Babel uses very small helpers for common functions such as `_extend`. By default This is where the `@babel/plugin-transform-runtime` plugin comes in: all of the helpers will reference the module `@babel/runtime` to avoid duplication across your compiled output. The runtime will be compiled into your build. +::::babel7 + Another purpose of this transformer is to create a sandboxed environment for your code. If you directly import [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](polyfill.md) and the built-ins it provides such as `Promise`, `Set` and `Map`, those will pollute the global scope. While this might be ok for an app or a command line tool, it becomes a problem if your code is a library which you intend to publish for others to use or if you can't exactly control the environment in which your code will run. The transformer will alias these built-ins to `core-js` so you can use them seamlessly without having to require the polyfill. +:::: + See the [technical details](#technical-details) section for more information on how this works and the types of transformations that occur. ## Usage @@ -90,6 +98,21 @@ require("@babel/core").transformSync("code", { ## Options + +### `absoluteRuntime` + +`boolean` or `string`, defaults to `false`. + +This allows users to run `transform-runtime` broadly across a whole project. By default, `transform-runtime` imports from `@babel/runtime/foo` directly, but that only works if `@babel/runtime` is in the `node_modules` of the file that is being compiled. This can be problematic for nested `node_modules`, npm-linked modules, or CLIs that reside outside the user's project, among other cases. To avoid worrying about how the runtime module's location is resolved, this allows users to resolve the runtime once up front, and then insert absolute paths to the runtime into the output code. + +Using absolute paths is not desirable if files are compiled for use at a later time, but in contexts where a file is compiled and then immediately consumed, they can be quite helpful. + +:::tip +You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) +::: + +::::babel7 + ### `corejs` `false`, `2`, `3` or `{ version: 2 | 3, proposals: boolean }`, defaults to `false`. @@ -118,6 +141,12 @@ This option requires changing the dependency used to provide the necessary runti | `2` | `npm install --save @babel/runtime-corejs2` | | `3` | `npm install --save @babel/runtime-corejs3` | +:::caution + +The `corejs` option will be removed in Babel 8. To inject polyfills, you can use [`babel-plugin-polyfill-corejs3`](https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs3/README.md) or [`babel-plugin-polyfill-corejs2`](https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs2/README.md) directly. + +::: + ### `helpers` `boolean`, defaults to `true`. @@ -126,6 +155,14 @@ Toggles whether or not inlined Babel helpers (`classCallCheck`, `extends`, etc.) For more information, see [Helper aliasing](#helper-aliasing). +:::caution + +The `helpers` option will be removed in Babel 8, as this plugin will only be used to inject helpers (including `regeneratorRuntime`, which will be handled as any other Babel helper). + +::: + +:::: + ### `moduleName`
@@ -147,42 +184,22 @@ This option controls which package of helpers `@babel/plugin-transform-runtime` Note that specifying the [`corejs`](#corejs) option will internally enable the corresponding `babel-plugin-polyfill-corejs*` plugin, thus it has an effect on the final module name. -### `polyfill` - -:::danger -This option was removed in v7. -::: +::::babel7 ### `regenerator` `boolean`, defaults to `true`. -Toggles whether or not generator functions are transformed to use a regenerator runtime that does not pollute the global scope. +In older Babel version, this option used to toggles whether or not generator functions were transformed to use a regenerator runtime that does not pollute the global scope. For more information, see [Regenerator aliasing](#regenerator-aliasing). -### `useBuiltIns` - -:::danger -This option was removed in v7. +:::caution +The `regenerator` option will be removed in Babel 8, as it will not be necessary anymore. ::: ### `useESModules` -::::babel8 - -:::danger -This option was removed in v8. -::: - -:::: - -::::babel7 - -:::caution -This option has been deprecated and will be removed in Babel 8: starting from version `7.13.0`, `@babel/runtime`'s `package.json` uses `"exports"` option to automatically choose between CJS and ESM helpers. -::: - `boolean`, defaults to `false`.
@@ -219,46 +236,59 @@ export default function(instance, Constructor) { } ``` +:::caution +The `useESModules` option has been deprecated and will be removed in Babel 8: starting from version `7.13.0`, `@babel/runtime`'s `package.json` uses `"exports"` option to automatically choose between CJS and ESM helpers. +::: + :::: -### `absoluteRuntime` +### `version` -`boolean` or `string`, defaults to `false`. +::::babel7 -This allows users to run `transform-runtime` broadly across a whole project. By default, `transform-runtime` imports from `@babel/runtime/foo` directly, but that only works if `@babel/runtime` is in the `node_modules` of the file that is being compiled. This can be problematic for nested `node_modules`, npm-linked modules, or CLIs that reside outside the user's project, among other cases. To avoid worrying about how the runtime module's location is resolved, this allows users to resolve the runtime once up front, and then insert absolute paths to the runtime into the output code. +By default transform-runtime assumes that `@babel/runtime@7.0.0` is installed. If you have later versions of +`@babel/runtime` (or their corejs counterparts e.g. `@babel/runtime-corejs3`) installed or listed as a dependency, transform-runtime can use more advanced features. -Using absolute paths is not desirable if files are compiled for use at a later time, but in contexts where a file is compiled and then immediately consumed, they can be quite helpful. +For example if you depend on `@babel/runtime@^7.24.0` you can transpile your code with -:::tip -You can read more about configuring plugin options [here](https://babeljs.io/docs/en/plugins#plugin-options) -::: +```json title="babel.config.json" +{ + "plugins": [ + ["@babel/plugin-transform-runtime", { + "version": "^7.24.0" + }] + ] +} +``` -### `version` +:::: -By default transform-runtime assumes that `@babel/runtime@7.0.0` is installed. If you have later versions of +::::babel8 + +By default transform-runtime assumes that `@babel/runtime@8.0.0` is installed. If you have later versions of `@babel/runtime` (or their corejs counterparts e.g. `@babel/runtime-corejs3`) installed or listed as a dependency, transform-runtime can use more advanced features. -For example if you depend on `@babel/runtime-corejs2@7.7.4` you can transpile your code with + +For example if you depend on `@babel/runtime@^8.1.0` you can transpile your code with ```json title="babel.config.json" { "plugins": [ - [ - "@babel/plugin-transform-runtime", - { - "absoluteRuntime": false, - "corejs": 2, - "version": "^7.7.4" - } - ] + ["@babel/plugin-transform-runtime", { + "version": "^8.1.0" + }] ] } ``` +:::: + which results in a smaller bundle size. ## Technical details +::::babel7 + The `transform-runtime` transformer plugin does three things: - Automatically requires `@babel/runtime/regenerator` when you use generators/async functions (toggleable with the `regenerator` option). @@ -381,6 +411,8 @@ without worrying about where they come from. ### Helper aliasing +:::: + Usually Babel will place helpers at the top of your file to do common tasks to avoid duplicating the code around in the current file. Sometimes these helpers can get a little bulky and add unnecessary duplication across files. The `runtime` @@ -425,3 +457,18 @@ var Person = function Person() { (0, _classCallCheck3.default)(this, Person); }; ``` + +## Removed options + +:::babel8 + +The following options where removed in Babel 8.0.0: +- `corejs` +- `helpers` +- `regenerator` + +::: + +The following options where removed in Babel 7.0.0: +- `useBuiltIns` +- `polyfill` diff --git a/docs/plugin-transform-typescript.md b/docs/plugin-transform-typescript.md index 6a8111118..35abf8095 100644 --- a/docs/plugin-transform-typescript.md +++ b/docs/plugin-transform-typescript.md @@ -116,7 +116,7 @@ Forcibly enables `jsx` parsing. Otherwise angle brackets will be treated as Type ### `jsxPragma` -`string`, defaults to `React` +`string`, defaults to `React.createElement` Replace the function used when compiling JSX expressions. This is so that we know that the import is not a type import, and should not be removed. diff --git a/docs/preset-typescript.md b/docs/preset-typescript.md index b2ce2a5a2..93bb8901e 100644 --- a/docs/preset-typescript.md +++ b/docs/preset-typescript.md @@ -205,7 +205,7 @@ Added in: `v7.23.0` When set to `true`, Babel will rewrite `.ts`/`.mts`/`.cts` extensions in import declarations to `.js`/`.mjs`/`.cjs`. -This option, when used together with TypeScript's [`allowImportingTsExtension`](https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions) option, allows to write complete relative specifiers in import declaratoinss while using the same extension used by the source files. +This option, when used together with TypeScript's [`allowImportingTsExtension`](https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions) option, allows to write complete relative specifiers in import declarations while using the same extension used by the source files. As an example, given this project structure (where `src` contains the source files, and `dist` the compiled files): ``` diff --git a/docs/types.md b/docs/types.md index 118a30256..636f582a8 100644 --- a/docs/types.md +++ b/docs/types.md @@ -290,7 +290,7 @@ See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts AST Node `CallExpression` shape: - `callee`: `Expression | Super | V8IntrinsicIdentifier` (required) -- `arguments`: `Array` (required) +- `arguments`: `Array` (required) - `optional`: `true | false` (default: `null`, excluded from builder function) - `typeArguments`: `TypeParameterInstantiation` (default: `null`, excluded from builder function) - `typeParameters`: `TSTypeParameterInstantiation` (default: `null`, excluded from builder function) @@ -1915,7 +1915,7 @@ See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)` AST Node `NewExpression` shape: - `callee`: `Expression | Super | V8IntrinsicIdentifier` (required) -- `arguments`: `Array` (required) +- `arguments`: `Array` (required) - `optional`: `true | false` (default: `null`, excluded from builder function) - `typeArguments`: `TypeParameterInstantiation` (default: `null`, excluded from builder function) - `typeParameters`: `TSTypeParameterInstantiation` (default: `null`, excluded from builder function) @@ -2232,7 +2232,7 @@ See also `t.isOptionalCallExpression(node, opts)` and `t.assertOptionalCallExpre AST Node `OptionalCallExpression` shape: - `callee`: `Expression` (required) -- `arguments`: `Array` (required) +- `arguments`: `Array` (required) - `optional`: `boolean` (required) - `typeArguments`: `TypeParameterInstantiation` (default: `null`, excluded from builder function) - `typeParameters`: `TSTypeParameterInstantiation` (default: `null`, excluded from builder function) diff --git a/docs/v8-migration-api.md b/docs/v8-migration-api.md index 73845fb16..9544b48e4 100644 --- a/docs/v8-migration-api.md +++ b/docs/v8-migration-api.md @@ -284,6 +284,10 @@ Check out the [v8-migration guide](v8-migration.md) for other user-level changes **Migration**: Adapt to the new token design. If you want to restore to the Babel 7 behaviour, manually transform them to the Babel 7 tokens ([example](https://github.com/babel/babel/blob/7e60a93897f9a134506251ea51269faf4d02a86c/packages/babel-parser/src/parser/statement.ts#L116-L188)). +- Remove `extra.shorthand` from `ObjectProperty` nodes ([#16521](https://github.com/babel/babel/pull/16521)) + + **Migration**: Use `node.shorthand` rather than `node.extra.shorthand`. + ### `@babel/traverse` ![low](https://img.shields.io/badge/risk%20of%20breakage%3F-low-yellowgreen.svg) diff --git a/docs/v8-migration.md b/docs/v8-migration.md index bc751c055..7d1327979 100644 --- a/docs/v8-migration.md +++ b/docs/v8-migration.md @@ -13,9 +13,9 @@ Refer users to this document when upgrading to Babel 8 from Babel 7. If you are ### Node.js support -All Babel 8 packages require Node.js `^16.20.0 || ^18.16.0 || >=20.0.0`. +All Babel 8 packages require Node.js `^18.20.0 || ^20.10.0 || >=21.0.0`. -We highly encourage you to use a newer version of Node.js (LTS v18) since the previous versions are not maintained. +We highly encourage you to use a newer version of Node.js (LTS v20) since the previous versions are not maintained. See [nodejs/Release](https://github.com/nodejs/Release) for more information. This just means Babel _itself_ won't run on older versions of Node. It can still _output_ code that runs on old Node versions. @@ -403,12 +403,22 @@ The following syntax plugins are no longer needed, you can safely remove them fr ### `@babel/plugin-transform-runtime` +![medium](https://img.shields.io/badge/risk%20of%20breakage%3F-medium-yellow.svg) + +- The `corejs` option has been removed ([#16311](https://github.com/babel/babel/pull/16311)) + + **Migration**: To inject polyfills, you can use [`babel-plugin-polyfill-corejs3`](https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs3/README.md) or [babel-plugin-polyfill-corejs2](https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs2/README.md) directly. + ![low](https://img.shields.io/badge/risk%20of%20breakage%3F-low-yellowgreen.svg) - The `useESModules` option has been removed ([#16141](https://github.com/babel/babel/pull/16141)) **Migration**: Delete it from your configuration. `@babel/runtime` will now automatically expose ES modules when needed, using `package.json#exports`. +- The `runtime` and `helpers` options have been removed ([#16311](https://github.com/babel/babel/pull/16311)) + + **Migration**: Delete them from your configuration: `@babel/runtime` will now always import helpers. If you don't want to inject imports to helpers, remove `@babel/plugin-transform-runtime` from your config. + ### `@babel/node` ![low](https://img.shields.io/badge/risk%20of%20breakage%3F-low-yellowgreen.svg) diff --git a/website/data/tools/node/usage.md b/website/data/tools/node/usage.md index bd621077b..d477f332b 100644 --- a/website/data/tools/node/usage.md +++ b/website/data/tools/node/usage.md @@ -6,6 +6,10 @@ require("@babel/core").transform("code", {

+<<<<<<< HEAD 关于 Babel 的完整 API 文档请查阅使用文档。 +======= + Explore the @babel/core documentation for the full API. +>>>>>>> 806e689059427195cf081e42583da76be2fb63ec

diff --git a/website/sidebars.js b/website/sidebars.js index 13f4eec00..edfea9acd 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -70,7 +70,7 @@ module.exports = { type: "category", label: "ES2020", items: [ - "babel-plugin-proposal-dynamic-import", + "babel-plugin-transform-dynamic-import", "babel-plugin-transform-export-namespace-from", "babel-plugin-transform-nullish-coalescing-operator", "babel-plugin-transform-optional-chaining", @@ -152,6 +152,7 @@ module.exports = { type: "category", label: "Bugfix", items: [ + "babel-plugin-bugfix-firefox-class-in-computed-class-key", "babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression", "babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining", ],