Skip to content

Commit

Permalink
Rename stable plugins from -proposal- to -transform-
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed May 22, 2023
1 parent 2581612 commit 2a648b7
Show file tree
Hide file tree
Showing 37 changed files with 182 additions and 169 deletions.
21 changes: 17 additions & 4 deletions _redirects
Expand Up @@ -64,12 +64,25 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301!
/docs/plugins/minify-* /docs/babel-plugin-minify-:splat
/docs/plugins/external-helpers/ /docs/babel-plugin-external-helpers

/docs/en/babel-plugin-transform-async-generator-functions /docs/babel-plugin-proposal-async-generator-functions
/docs/en/babel-plugin-transform-class-properties /docs/babel-plugin-proposal-class-properties
# Plugins renamed from -proposal- to -transform-
/docs/babel-plugin-proposal-class-static-block /docs/babel-plugin-transform-class-static-block
/docs/babel-plugin-proposal-private-property-in-object /docs/babel-plugin-transform-private-property-in-object
/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-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
/docs/babel-plugin-proposal-json-strings /docs/babel-plugin-transform-json-strings
/docs/babel-plugin-proposal-optional-catch-binding /docs/babel-plugin-transform-optional-catch-binding
/docs/babel-plugin-proposal-async-generator-functions /docs/babel-plugin-transform-async-generator-functions
/docs/babel-plugin-proposal-object-rest-spread /docs/babel-plugin-transform-object-rest-spread
/docs/babel-plugin-proposal-unicode-property-regex /docs/babel-plugin-transform-unicode-property-regex
/docs/babel-plugin-proposal-export-namespace-from /docs/babel-plugin-transform-export-namespace-from

# Legacy redirects
/docs/en/babel-plugin-transform-decorators /docs/babel-plugin-proposal-decorators
/docs/en/babel-plugin-transform-do-expressions /docs/babel-plugin-proposal-do-expressions
/docs/en/babel-plugin-transform-export-extensions /docs/babel-plugin-proposal-export-namespace
/docs/en/babel-plugin-transform-object-rest-spread /docs/babel-plugin-proposal-object-rest-spread

/docs/plugins/check-es2015-constants/ /docs/babel-plugin-check-es2015-constants
/docs/plugins/transform-es2015-constants /docs/babel-plugin-check-es2015-constants
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Expand Up @@ -158,7 +158,7 @@ npx babel --out-file script-compiled.js < script.js
Use the `--plugins` option to specify plugins to use in compilation

```sh title="Shell"
npx babel script.js --out-file script-compiled.js --plugins=@babel/proposal-class-properties,@babel/transform-modules-amd
npx babel script.js --out-file script-compiled.js --plugins=@babel/transform-class-properties,@babel/transform-modules-amd
```

### Using Presets
Expand Down
16 changes: 8 additions & 8 deletions docs/features-timeline.md
Expand Up @@ -442,18 +442,18 @@ This has a lot more changes since it was 2 years of pre-releases.
- Support TypeScript via `@babel/preset-typescript`
- Support JSX Fragments `<></>`
- Support a ton of TC39 proposals:
- [Unicode Property Regex](plugin-proposal-unicode-property-regex.md)
- [JSON Superset](plugin-proposal-json-strings.md)
- [Unicode Property Regex](plugin-transform-unicode-property-regex.md)
- [JSON Superset](plugin-transform-json-strings.md)
- [`new.target`](plugin-transform-new-target.md)
- [Class Private Instance Fields](plugin-proposal-class-properties.md) (`class A { #b = 2 }`)
- [Optional Catch Binding](plugin-proposal-optional-catch-binding.md) `try { throw 0 } catch { do() }`
- [Class Private Instance Fields](plugin-transform-class-properties.md) (`class A { #b = 2 }`)
- [Optional Catch Binding](plugin-transform-optional-catch-binding.md) `try { throw 0 } catch { do() }`
- [BigInt](plugin-syntax-bigint.md) (syntax only)
- [`import.meta`](plugin-syntax-import-meta.md) (syntax only) (`import.meta.url`)
- [Numeric Separators](plugin-proposal-numeric-separator.md) (`1_000`)
- [Numeric Separators](plugin-transform-numeric-separator.md) (`1_000`)
- [`function.sent`](plugin-proposal-function-sent.md)
- [Optional Chaining](plugin-proposal-optional-chaining.md) (`a?.b`)
- [Logical Assignment Operators](plugin-proposal-logical-assignment-operators.md) (`a &&= b; a ||= b`)
- [Nullish Coalescing Operator](plugin-proposal-nullish-coalescing-operator.md) (`a ?? b`)
- [Optional Chaining](plugin-transform-optional-chaining.md) (`a?.b`)
- [Logical Assignment Operators](plugin-transform-logical-assignment-operators.md) (`a &&= b; a ||= b`)
- [Nullish Coalescing Operator](plugin-transform-nullish-coalescing-operator.md) (`a ?? b`)
- [Pipeline Operator](plugin-proposal-pipeline-operator.md) (`a |> b`)
- [Throw Expressions](plugin-proposal-throw-expressions.md) (`() => throw new Error("a")`)
Expand Down
10 changes: 5 additions & 5 deletions docs/helper-compilation-targets.md
Expand Up @@ -198,9 +198,9 @@ Given browser targets `targets`, query the `compatData` whether plugin `name` is
module.exports = api => {
const targets = api.targets();
// The targets have native optional chaining support
// if `proposal-optional-chaining` is _not_ required
// if `transform-optional-chaining` is _not_ required
const optionalChainingSupported = !isRequired(
"proposal-optional-chaining",
"transform-optional-chaining",
targets
);
};
Expand All @@ -213,9 +213,9 @@ Plugin authors can use `isRequired` to optimize plugin output given different `t
module.exports = api => {
const targets = api.targets();
// The targets have native optional chaining support
// if `proposal-optional-chaining` is _not_ required
// if `transform-optional-chaining` is _not_ required
const optionalChainingSupported = !isRequired(
"proposal-optional-chaining",
"transform-optional-chaining",
targets
);
const visited = new WeakSet();
Expand All @@ -239,4 +239,4 @@ module.exports = api => {
};
```

[`@babel/plugin-proposal-object-rest-spread`](https://github.com/babel/babel/blob/962d81483ef6a57a4a3eca8230ae40795b695147/packages/babel-plugin-proposal-object-rest-spread/src/index.js#L23) uses `isRequired` to determine whether targets already have native `Object.assign` support.
[`@babel/plugin-transform-object-rest-spread`](https://github.com/babel/babel/blob/962d81483ef6a57a4a3eca8230ae40795b695147/packages/babel-plugin-transform-object-rest-spread/src/index.js#L23) uses `isRequired` to determine whether targets already have native `Object.assign` support.
2 changes: 1 addition & 1 deletion docs/parser.md
Expand Up @@ -264,7 +264,7 @@ You should enable these features only if you are using an older version.
| `logicalAssignment` ([proposal](https://github.com/tc39/proposal-logical-assignment)) | `a &&= b` |
| `moduleStringNames` ([proposal](https://github.com/tc39/ecma262/pull/2154)) | `import { "😄" as smile } from "emoji";` |
| `nullishCoalescingOperator` ([proposal](https://github.com/babel/proposals/issues/14)) | `a ?? b` |
| `numericSeparator` ([proposal](https://github.com/samuelgoto/proposal-numeric-separator)) | `1_000_000` |
| `numericSeparator` ([proposal](https://github.com/tc39/proposal-numeric-separator)) | `1_000_000` |
| `objectRestSpread` ([proposal](https://github.com/tc39/proposal-object-rest-spread)) | `var a = { b, ...c };` |
| `optionalCatchBinding` ([proposal](https://github.com/babel/proposals/issues/7)) | `try {throw 0;} catch{do();}` |
| `optionalChaining` ([proposal](https://github.com/tc39/proposal-optional-chaining)) | `a?.b` |
Expand Down
12 changes: 6 additions & 6 deletions docs/plugin-proposal-decorators.md
Expand Up @@ -134,27 +134,27 @@ Use `version: "legacy"` instead. This option is a legacy alias.

Use the legacy (stage 1) decorators syntax and behavior.

#### NOTE: Compatibility with `@babel/plugin-proposal-class-properties`
#### NOTE: Compatibility with `@babel/plugin-transform-class-properties`

If you are including your plugins manually and using `@babel/plugin-proposal-class-properties` or `@babel/plugin-private-methods` and legacy decorators, make sure that `@babel/plugin-proposal-decorators` comes _before_ `@babel/plugin-proposal-class-properties`.
If you are including your plugins manually and using `@babel/plugin-transform-class-properties` or `@babel/plugin-private-methods` and legacy decorators, make sure that `@babel/plugin-proposal-decorators` comes _before_ `@babel/plugin-transform-class-properties`.

```diff title="babel.config.json"
{
"plugins": [
- "@babel/plugin-proposal-class-properties",
- "@babel/plugin-transform-class-properties",
["@babel/plugin-proposal-decorators", { "version": "2023-01" }]
+ "@babel/plugin-proposal-class-properties"
+ "@babel/plugin-transform-class-properties"
]
}
```

If you are already using `@babel/preset-env`, you can safely remove `@babel/plugin-proposal-class-properties` and `@babel/plugin-private-methods`:
If you are already using `@babel/preset-env`, you can safely remove `@babel/plugin-transform-class-properties` and `@babel/plugin-private-methods`:

```diff title="babel.config.json"
{
"presets": ["@babel/preset-env"],
"plugins": [
- "@babel/plugin-proposal-class-properties",
- "@babel/plugin-transform-class-properties",
["@babel/plugin-proposal-decorators", { "version": "2023-01" }]
]
}
Expand Down
4 changes: 2 additions & 2 deletions docs/plugin-proposal-destructuring-private.md
Expand Up @@ -50,13 +50,13 @@ npm install --save-dev @babel/plugin-proposal-destructuring-private
}
```

Because the output code includes private fields, if you are already using other class feature plugins (e.g. [`@babel/plugin-proposal-class-properties](plugin-proposal-class-properties.md)), be sure to place it _before_ the others.
Because the output code includes private fields, if you are already using other class feature plugins (e.g. [`@babel/plugin-transform-class-properties](plugin-transform-class-properties.md)), be sure to place it _before_ the others.

```json title="babel.config.json"
{
"plugins": [
"@babel/plugin-proposal-destructuring-private",
"@babel/plugin-proposal-class-properties"
"@babel/plugin-transform-class-properties"
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-async-generators.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-async-generators

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-async-generators](plugin-proposal-async-generator-functions.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-async-generators](plugin-transform-async-generator-functions.md) to _both_ parse and transform this syntax.
## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-class-properties.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-class-properties

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-class-properties](plugin-proposal-class-properties.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-class-properties](plugin-transform-class-properties.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-class-static-block.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-class-static-block

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-class-static-block](plugin-proposal-class-static-block.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-class-static-block](plugin-transform-class-static-block.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-export-namespace-from.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-export-namespace-from

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-export-namespace-from](plugin-proposal-export-namespace-from.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-export-namespace-from](plugin-transform-export-namespace-from.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-json-strings.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-json-strings

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-json-strings](plugin-proposal-json-strings.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-json-strings](plugin-transform-json-strings.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-logical-assignment-operators.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-logical-assignment-operators

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-logical-assignment-operators](plugin-proposal-logical-assignment-operators.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-logical-assignment-operators](plugin-transform-logical-assignment-operators.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-nullish-coalescing-operator.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-nullish-coalescing-operator

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-nullish-coalescing-operator](plugin-proposal-nullish-coalescing-operator.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-nullish-coalescing-operator](plugin-transform-nullish-coalescing-operator.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-numeric-separator.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-numeric-separator

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-numeric-separator](plugin-proposal-numeric-separator.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-numeric-separator](plugin-transform-numeric-separator.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-object-rest-spread.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-object-rest-spread

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-object-rest-spread](plugin-proposal-object-rest-spread.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-object-rest-spread](plugin-transform-object-rest-spread.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-optional-catch-binding.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-optional-catch-binding

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-optional-catch-binding](plugin-proposal-optional-catch-binding.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-optional-catch-binding](plugin-transform-optional-catch-binding.md) to _both_ parse and transform this syntax.
## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-syntax-optional-chaining.md
Expand Up @@ -6,7 +6,7 @@ sidebar_label: syntax-optional-chaining

> #### Syntax only
>
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-proposal-optional-chaining](plugin-proposal-optional-chaining.md) to _both_ parse and transform this syntax.
> It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use [plugin-transform-optional-chaining](plugin-transform-optional-chaining.md) to _both_ parse and transform this syntax.
## Installation

Expand Down
@@ -1,6 +1,6 @@
---
id: babel-plugin-proposal-async-generator-functions
title: "@babel/plugin-proposal-async-generator-functions"
id: babel-plugin-transform-async-generator-functions
title: "@babel/plugin-transform-async-generator-functions"
sidebar_label: async-generator-functions
---

Expand Down Expand Up @@ -78,7 +78,7 @@ forEach(genAnswers(), function(val) {
## Installation

```shell npm2yarn
npm install --save-dev @babel/plugin-proposal-async-generator-functions
npm install --save-dev @babel/plugin-transform-async-generator-functions
```

## Usage
Expand All @@ -87,21 +87,21 @@ npm install --save-dev @babel/plugin-proposal-async-generator-functions

```json title="babel.config.json"
{
"plugins": ["@babel/plugin-proposal-async-generator-functions"]
"plugins": ["@babel/plugin-transform-async-generator-functions"]
}
```

### Via CLI

```sh title="Shell"
babel --plugins @babel/plugin-proposal-async-generator-functions script.js
babel --plugins @babel/plugin-transform-async-generator-functions script.js
```

### Via Node API

```js title="JavaScript"
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-proposal-async-generator-functions"],
plugins: ["@babel/plugin-transform-async-generator-functions"],
});
```

Expand Down
@@ -1,6 +1,6 @@
---
id: babel-plugin-proposal-class-properties
title: "@babel/plugin-proposal-class-properties"
id: babel-plugin-transform-class-properties
title: "@babel/plugin-transform-class-properties"
sidebar_label: class-properties
---

Expand Down Expand Up @@ -40,7 +40,7 @@ console.log(Bork.staticFunction()); // > "babelIsCool"
## Installation

```shell npm2yarn
npm install --save-dev @babel/plugin-proposal-class-properties
npm install --save-dev @babel/plugin-transform-class-properties
```

## Usage
Expand All @@ -51,29 +51,29 @@ Without options:

```json title="babel.config.json"
{
"plugins": ["@babel/plugin-proposal-class-properties"]
"plugins": ["@babel/plugin-transform-class-properties"]
}
```

With options:

```json title="babel.config.json"
{
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": true }]]
"plugins": [["@babel/plugin-transform-class-properties", { "loose": true }]]
}
```

### Via CLI

```sh title="Shell"
babel --plugins @babel/plugin-proposal-class-properties script.js
babel --plugins @babel/plugin-transform-class-properties script.js
```

### Via Node API

```js title="JavaScript"
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-proposal-class-properties"],
plugins: ["@babel/plugin-transform-class-properties"],
});
```

Expand Down

0 comments on commit 2a648b7

Please sign in to comment.