Skip to content

Commit

Permalink
docs(en): merging all conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
docschina-bot committed Jul 6, 2024
2 parents a90f03b + 449f038 commit 595ba6c
Show file tree
Hide file tree
Showing 21 changed files with 205 additions and 67 deletions.
3 changes: 2 additions & 1 deletion _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
45 changes: 45 additions & 0 deletions docs/plugin-bugfix-firefox-class-in-computed-class-key.md
Original file line number Diff line number Diff line change
@@ -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"],
});
```
2 changes: 1 addition & 1 deletion docs/plugin-proposal-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "@babel/plugin-proposal-duplicate-named-capturing-groups-regex"
sidebar_label: duplicate-named-capturing-groups-regex
---

This plugin transforms regular expression _literals_ to support duplicate named capturing groups. It does not patch the `new RegExp` constructor, since its arguments cannot be pre-transformed statically: to handle runtime behavior of functions/classes, you will need to use a polyfill instead.

## Examples

**In**
Expand Down
10 changes: 6 additions & 4 deletions docs/plugin-proposal-optional-chaining-assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
]
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-dotall-regex.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ sidebar_label: dotall-regex
This plugin is included in `@babel/preset-env`, in [ES2018](https://github.com/tc39/proposals/blob/master/finished-proposals.md)
:::

This plugin transforms regular expression _literals_ to support the `/s` flag. It does not patch the `new RegExp` constructor, since its arguments cannot be pre-transformed statically: to handle runtime behavior of functions/classes, you will need to use a polyfill instead.

## Example

**In**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
---

Expand Down Expand Up @@ -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
Expand All @@ -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"
]
}
Expand All @@ -93,15 +93,15 @@ 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

```js title="JavaScript"
require("@babel/core").transformSync("code", {
plugins: [
"@babel/plugin-proposal-dynamic-import",
"@babel/plugin-transform-dynamic-import",
"@babel/plugin-transform-modules-systemjs"
],
});
Expand Down
2 changes: 2 additions & 0 deletions docs/plugin-transform-named-capturing-groups-regex.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ functionalities. If you need to support older browsers, use either
the `runtime: false` option or import a proper polyfill (e.g. `core-js`).
:::

This plugin transforms regular expression _literals_ to support named capturing groups. It does not patch the `new RegExp` constructor, since its arguments cannot be pre-transformed statically: to handle runtime behavior of functions/classes, you will need to use a polyfill instead.

## Examples

**In**
Expand Down
Loading

0 comments on commit 595ba6c

Please sign in to comment.