Skip to content

Commit

Permalink
Add to preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Mar 9, 2022
1 parent 030e461 commit bbd5f92
Show file tree
Hide file tree
Showing 23 changed files with 59 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/babel-preset-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@babel/helper-validator-option": "workspace:^",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "workspace:^",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "workspace:^",
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "workspace:^",
"@babel/plugin-proposal-async-generator-functions": "workspace:^",
"@babel/plugin-proposal-class-properties": "workspace:^",
"@babel/plugin-proposal-class-static-block": "workspace:^",
Expand Down
4 changes: 4 additions & 0 deletions packages/babel-preset-env/src/available-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import bugfixSafariBlockShadowing from "@babel/preset-modules/lib/plugins/transf
import bugfixSafariForShadowing from "@babel/preset-modules/lib/plugins/transform-safari-for-shadowing";
import bugfixSafariIdDestructuringCollisionInFunctionExpression from "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression";
import bugfixV8SpreadParametersInOptionalChaining from "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining";
import bugfixV8StaticClassFieldsRedefineReadonly from "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly";

export default {
"bugfix/transform-async-arrows-in-class": () => bugfixAsyncArrowsInClass,
Expand All @@ -82,6 +83,8 @@ export default {
"bugfix/transform-tagged-template-caching": () => bugfixTaggedTemplateCaching,
"bugfix/transform-v8-spread-parameters-in-optional-chaining": () =>
bugfixV8SpreadParametersInOptionalChaining,
"bugfix/transform-v8-static-class-fields-redefine-readonly": () =>
bugfixV8StaticClassFieldsRedefineReadonly,
"proposal-async-generator-functions": () => proposalAsyncGeneratorFunctions,
"proposal-class-properties": () => proposalClassProperties,
"proposal-class-static-block": () => proposalClassStaticBlock,
Expand Down Expand Up @@ -152,6 +155,7 @@ export default {
export const minVersions = {
"bugfix/transform-safari-id-destructuring-collision-in-function-expression":
"7.16.0",
"bugfix/transform-v8-static-class-fields-redefine-readonly": "7.12.0",
"proposal-class-static-block": "7.12.0",
"proposal-private-property-in-object": "7.10.0",
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
static name = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"targets": { "chrome": 70 },
"presets": ["env"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {}

babelHelpers.defineProperty(A, "name", 2);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
static name = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"targets": { "chrome": 90 },
"presets": ["env"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
static #_ = babelHelpers.defineProperty(this, "name", 2);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
static name = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"targets": { "chrome": 96 },
"presets": ["env"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class A {
static {
babelHelpers.defineProperty(this, "name", 2);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class A {
static name = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"targets": { "chrome": 97 },
"presets": ["env"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class A {
static {
babelHelpers.defineProperty(this, "name", 2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
bugfix/transform-v8-static-class-fields-redefine-readonly { chrome }
proposal-class-static-block { chrome < 94 }
proposal-private-property-in-object { chrome < 91 }
syntax-class-properties
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ __metadata:
languageName: unknown
linkType: soft

"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@workspace:packages/babel-plugin-bugfix-v8-static-class-fields-redefine-readonly":
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@workspace:^, @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@workspace:packages/babel-plugin-bugfix-v8-static-class-fields-redefine-readonly":
version: 0.0.0-use.local
resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@workspace:packages/babel-plugin-bugfix-v8-static-class-fields-redefine-readonly"
dependencies:
Expand Down Expand Up @@ -3388,6 +3388,7 @@ __metadata:
"@babel/helper-validator-option": "workspace:^"
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "workspace:^"
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "workspace:^"
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "workspace:^"
"@babel/plugin-proposal-async-generator-functions": "workspace:^"
"@babel/plugin-proposal-class-properties": "workspace:^"
"@babel/plugin-proposal-class-static-block": "workspace:^"
Expand Down

0 comments on commit bbd5f92

Please sign in to comment.