Rename all proposal plugins to -proposal- from -transform- (#6570)
This commit is contained in:
parent
a94aa54230
commit
c41abd79a1
@ -208,8 +208,8 @@ If you need to check for an error that is thrown you can add to the `options.jso
|
||||
```js
|
||||
// options.json example
|
||||
{
|
||||
"plugins": [["@babel/transform-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/transform-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
"plugins": [["@babel/proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ This option is useful if there is a bug in a native implementation, or a combina
|
||||
|
||||
For example, Node 4 supports native classes but not spread. If `super` is used with a spread argument, then the `transform-es2015-classes` transform needs to be `include`d, as it is not possible to transpile a spread with `super` otherwise.
|
||||
|
||||
> NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `transform-do-expressions` or excluding `transform-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.
|
||||
> NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `proposal-do-expressions` or excluding `proposal-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.
|
||||
|
||||
### `exclude`
|
||||
|
||||
@ -253,7 +253,7 @@ An array of plugins to always exclude/remove.
|
||||
|
||||
The possible options are the same as the `include` option.
|
||||
|
||||
This option is useful for "blacklisting" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/transform-async-generator-functions/).
|
||||
This option is useful for "blacklisting" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/proposal-async-generator-functions/).
|
||||
|
||||
### `useBuiltIns`
|
||||
|
||||
@ -569,4 +569,4 @@ Using polyfills:
|
||||
|
||||
## Issues
|
||||
|
||||
If you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.
|
||||
If you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.
|
||||
|
||||
@ -228,17 +228,17 @@
|
||||
"opera": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-async-generator-functions": {
|
||||
"proposal-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"firefox": "57",
|
||||
"opera": "50"
|
||||
},
|
||||
"transform-object-rest-spread": {
|
||||
"proposal-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"firefox": "55",
|
||||
"node": "8.3",
|
||||
"opera": "47"
|
||||
},
|
||||
"transform-optional-catch-binding": {},
|
||||
"transform-unicode-property-regex": {}
|
||||
"proposal-optional-catch-binding": {},
|
||||
"proposal-unicode-property-regex": {}
|
||||
}
|
||||
|
||||
@ -6,17 +6,17 @@ const builtIns = {
|
||||
};
|
||||
|
||||
const features = {
|
||||
"transform-async-generator-functions": "Asynchronous Iterators",
|
||||
"transform-object-rest-spread": "object rest/spread properties",
|
||||
"transform-optional-catch-binding": "optional catch binding",
|
||||
"transform-unicode-property-regex": "RegExp Unicode Property Escapes",
|
||||
"proposal-async-generator-functions": "Asynchronous Iterators",
|
||||
"proposal-object-rest-spread": "object rest/spread properties",
|
||||
"proposal-optional-catch-binding": "optional catch binding",
|
||||
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes",
|
||||
};
|
||||
|
||||
const pluginSyntaxMap = new Map([
|
||||
["transform-async-generator-functions", "syntax-async-generators"],
|
||||
["transform-object-rest-spread", "syntax-object-rest-spread"],
|
||||
["transform-optional-catch-binding", "syntax-optional-catch-binding"],
|
||||
["transform-unicode-property-regex", null],
|
||||
["proposal-async-generator-functions", "syntax-async-generators"],
|
||||
["proposal-object-rest-spread", "syntax-object-rest-spread"],
|
||||
["proposal-optional-catch-binding", "syntax-optional-catch-binding"],
|
||||
["proposal-unicode-property-regex", null],
|
||||
]);
|
||||
|
||||
module.exports = { builtIns, features, pluginSyntaxMap };
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"@babel/plugin-syntax-async-generators": "7.0.0-beta.3",
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.3",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-async-generator-functions": "7.0.0-beta.3",
|
||||
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-es2015-arrow-functions": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-es2015-block-scoped-functions": "7.0.0-beta.3",
|
||||
@ -41,10 +41,10 @@
|
||||
"@babel/plugin-transform-es2015-unicode-regex": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-new-target": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-object-rest-spread": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-optional-catch-binding": "7.0.0-beta.3",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.3",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-regenerator": "7.0.0-beta.3",
|
||||
"@babel/plugin-transform-unicode-property-regex": "7.0.0-beta.3",
|
||||
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.3",
|
||||
"browserslist": "^2.4.0",
|
||||
"invariant": "^2.2.2",
|
||||
"semver": "^5.3.0"
|
||||
|
||||
@ -4,7 +4,7 @@ export default {
|
||||
"syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
|
||||
"syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
|
||||
"transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
|
||||
"transform-async-generator-functions": require("@babel/plugin-transform-async-generator-functions"),
|
||||
"proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
|
||||
"transform-es2015-arrow-functions": require("@babel/plugin-transform-es2015-arrow-functions"),
|
||||
"transform-es2015-block-scoped-functions": require("@babel/plugin-transform-es2015-block-scoped-functions"),
|
||||
"transform-es2015-block-scoping": require("@babel/plugin-transform-es2015-block-scoping"),
|
||||
@ -29,8 +29,8 @@ export default {
|
||||
"transform-es2015-unicode-regex": require("@babel/plugin-transform-es2015-unicode-regex"),
|
||||
"transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"),
|
||||
"transform-new-target": require("@babel/plugin-transform-new-target"),
|
||||
"transform-object-rest-spread": require("@babel/plugin-transform-object-rest-spread"),
|
||||
"transform-optional-catch-binding": require("@babel/plugin-transform-optional-catch-binding"),
|
||||
"proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"),
|
||||
"proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"),
|
||||
"transform-regenerator": require("@babel/plugin-transform-regenerator"),
|
||||
"transform-unicode-property-regex": require("@babel/plugin-transform-unicode-property-regex"),
|
||||
"proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex"),
|
||||
};
|
||||
|
||||
@ -8,10 +8,10 @@ Using targets:
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
transform-async-generator-functions { "chrome":"60" }
|
||||
proposal-async-generator-functions { "chrome":"60" }
|
||||
syntax-object-rest-spread { "chrome":"60" }
|
||||
transform-optional-catch-binding { "chrome":"60" }
|
||||
transform-unicode-property-regex { "chrome":"60" }
|
||||
proposal-optional-catch-binding { "chrome":"60" }
|
||||
proposal-unicode-property-regex { "chrome":"60" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
|
||||
@ -29,10 +29,10 @@ Using plugins:
|
||||
transform-regenerator {}
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
transform-async-generator-functions {}
|
||||
transform-object-rest-spread {}
|
||||
transform-optional-catch-binding {}
|
||||
transform-unicode-property-regex {}
|
||||
proposal-async-generator-functions {}
|
||||
proposal-object-rest-spread {}
|
||||
proposal-optional-catch-binding {}
|
||||
proposal-unicode-property-regex {}
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# @babel/plugin-transform-async-generator-functions
|
||||
# @babel/plugin-proposal-async-generator-functions
|
||||
|
||||
> Turn async generator functions and for-await statements to ES2015 generators
|
||||
|
||||
@ -73,7 +73,7 @@ forEach(genAnswers(), function(val) { output += val.value })
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-transform-async-generator-functions
|
||||
npm install --save-dev @babel/plugin-proposal-async-generator-functions
|
||||
```
|
||||
|
||||
## Usage
|
||||
@ -84,21 +84,21 @@ npm install --save-dev @babel/plugin-transform-async-generator-functions
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/transform-async-generator-functions"]
|
||||
"plugins": ["@babel/proposal-async-generator-functions"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/transform-async-generator-functions script.js
|
||||
babel --plugins @babel/proposal-async-generator-functions script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/transform-async-generator-functions"]
|
||||
plugins: ["@babel/proposal-async-generator-functions"]
|
||||
});
|
||||
```
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-async-generator-functions",
|
||||
"name": "@babel/plugin-proposal-async-generator-functions",
|
||||
"version": "7.0.0-beta.3",
|
||||
"description": "Turn async generator functions into ES2015 generators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-generator-functions",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-async-to-generator",
|
||||
"transform-async-generator-functions"
|
||||
"proposal-async-generator-functions"
|
||||
],
|
||||
"presets": ["es2015"],
|
||||
"parserOpts": {
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "proposal-async-generator-functions"]
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-async-to-generator",
|
||||
"transform-async-generator-functions"
|
||||
"proposal-async-generator-functions"
|
||||
],
|
||||
"presets": ["es2015"],
|
||||
"parserOpts": {
|
||||
@ -2,7 +2,7 @@
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-async-to-generator",
|
||||
"transform-async-generator-functions"
|
||||
"proposal-async-generator-functions"
|
||||
],
|
||||
"presets": ["es2015"],
|
||||
"parserOpts": {
|
||||
@ -2,6 +2,6 @@
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-async-to-generator",
|
||||
"transform-async-generator-functions"
|
||||
"proposal-async-generator-functions"
|
||||
]
|
||||
}
|
||||
@ -2,6 +2,6 @@
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-async-to-generator",
|
||||
["transform-class-properties", {"loose": true}]
|
||||
"proposal-async-generator-functions"
|
||||
]
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
# @babel/plugin-transform-class-properties
|
||||
# @babel/plugin-proposal-class-properties
|
||||
|
||||
> This plugin transforms class properties
|
||||
|
||||
@ -37,7 +37,7 @@ Below is a class with four class properties which will be transformed.
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-transform-class-properties
|
||||
npm install --save-dev @babel/plugin-proposal-class-properties
|
||||
```
|
||||
|
||||
## Usage
|
||||
@ -50,7 +50,7 @@ Without options:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/transform-class-properties"]
|
||||
"plugins": ["@babel/proposal-class-properties"]
|
||||
}
|
||||
```
|
||||
|
||||
@ -59,7 +59,7 @@ With options:
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@babel/transform-class-properties", { "loose": true }]
|
||||
["@babel/proposal-class-properties", { "loose": true }]
|
||||
]
|
||||
}
|
||||
```
|
||||
@ -67,14 +67,14 @@ With options:
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/transform-class-properties script.js
|
||||
babel --plugins @babel/proposal-class-properties script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/transform-class-properties"]
|
||||
plugins: ["@babel/proposal-class-properties"]
|
||||
});
|
||||
```
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-class-properties",
|
||||
"name": "@babel/plugin-proposal-class-properties",
|
||||
"version": "7.0.0-beta.3",
|
||||
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-typescript", ["proposal-class-properties", {"loose": true }]]
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-typescript", "proposal-class-properties"]
|
||||
}
|
||||
4
packages/babel-plugin-proposal-class-properties/test/fixtures/general/foobar/options.json
vendored
Normal file
4
packages/babel-plugin-proposal-class-properties/test/fixtures/general/foobar/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "proposal-class-properties"],
|
||||
"presets": ["stage-0", "es2015"]
|
||||
}
|
||||
3
packages/babel-plugin-proposal-class-properties/test/fixtures/general/options.json
vendored
Normal file
3
packages/babel-plugin-proposal-class-properties/test/fixtures/general/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "proposal-class-properties", "transform-es2015-classes", "transform-es2015-block-scoping", "syntax-class-properties"]
|
||||
}
|
||||
@ -2,6 +2,6 @@
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-async-to-generator",
|
||||
["transform-class-properties"]
|
||||
["proposal-class-properties"]
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user