From 629a534e8d5f22848f9d6b9440fd688d4d3afb5c Mon Sep 17 00:00:00 2001 From: Houtan <62800782+houtan-rocky@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:37:32 +0330 Subject: [PATCH 1/4] [FIX] broken link (#2883) Co-authored-by: Brian Ng --- website/data/tools/node/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/data/tools/node/usage.md b/website/data/tools/node/usage.md index a59b7b37d..b1d3e3948 100644 --- a/website/data/tools/node/usage.md +++ b/website/data/tools/node/usage.md @@ -6,6 +6,6 @@ require("@babel/core").transform("code", {

- For full documentation on the Babel API see the usage docs. + Explore the @babel/core documentation for the full API.

From 90125ef8248bcd02a4e55038272f380bdc718fe0 Mon Sep 17 00:00:00 2001 From: Tom Zajac Date: Fri, 29 Mar 2024 13:35:47 +0100 Subject: [PATCH 2/4] Update plugin-proposal-optional-chaining-assign.md (#2884) --- docs/plugin-proposal-optional-chaining-assign.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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" + } + ] ] } ``` From 6678bf7d8d8ba5bb107246179c2beee58b1c7b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 3 Apr 2024 18:14:20 +0200 Subject: [PATCH 3/4] Add docs for bugfix-firefox-class-in-computed-class-key (#2885) --- ...fix-firefox-class-in-computed-class-key.md | 45 +++++++++++++++++++ website/sidebars.js | 1 + 2 files changed, 46 insertions(+) create mode 100644 docs/plugin-bugfix-firefox-class-in-computed-class-key.md 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/website/sidebars.js b/website/sidebars.js index 13f4eec00..f4c6a258d 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -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", ], From 85c50ccf2bb460f155f0e51140af3c726285a67a Mon Sep 17 00:00:00 2001 From: Adam Skoufis Date: Wed, 10 Apr 2024 17:46:04 +1000 Subject: [PATCH 4/4] Fix typo in preset-typescript.md (#2886) --- docs/preset-typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): ```