Skip to content

Commit

Permalink
chore: update stage preset in babel-standalone (#11395)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 9, 2020
1 parent 8b976b0 commit eb6d5c6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions packages/babel-standalone/package.json
Expand Up @@ -38,9 +38,7 @@
"@babel/plugin-syntax-class-properties": "^7.8.3",
"@babel/plugin-syntax-decorators": "^7.8.3",
"@babel/plugin-syntax-do-expressions": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.0",
"@babel/plugin-syntax-export-default-from": "^7.8.3",
"@babel/plugin-syntax-export-namespace-from": "^7.8.3",
"@babel/plugin-syntax-flow": "^7.8.3",
"@babel/plugin-syntax-function-bind": "^7.8.3",
"@babel/plugin-syntax-function-sent": "^7.8.3",
Expand All @@ -49,6 +47,7 @@
"@babel/plugin-syntax-object-rest-spread": "^7.8.0",
"@babel/plugin-syntax-optional-catch-binding": "^7.8.0",
"@babel/plugin-syntax-pipeline-operator": "^7.8.3",
"@babel/plugin-syntax-record-and-tuple": "^7.9.0",
"@babel/plugin-syntax-top-level-await": "^7.8.3",
"@babel/plugin-syntax-typescript": "^7.8.3",
"@babel/plugin-transform-arrow-functions": "^7.8.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-standalone/scripts/pluginConfig.json
Expand Up @@ -4,9 +4,7 @@
"syntax-class-properties",
"syntax-decorators",
"syntax-do-expressions",
"syntax-dynamic-import",
"syntax-export-default-from",
"syntax-export-namespace-from",
"syntax-flow",
"syntax-function-bind",
"syntax-function-sent",
Expand All @@ -15,6 +13,7 @@
"syntax-object-rest-spread",
"syntax-optional-catch-binding",
"syntax-pipeline-operator",
"syntax-record-and-tuple",
"syntax-top-level-await",
"syntax-typescript",
"proposal-async-generator-functions",
Expand Down
9 changes: 3 additions & 6 deletions packages/babel-standalone/src/generated/plugins.js
Expand Up @@ -8,9 +8,7 @@ import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators";
import syntaxClassProperties from "@babel/plugin-syntax-class-properties";
import syntaxDecorators from "@babel/plugin-syntax-decorators";
import syntaxDoExpressions from "@babel/plugin-syntax-do-expressions";
import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import";
import syntaxExportDefaultFrom from "@babel/plugin-syntax-export-default-from";
import syntaxExportNamespaceFrom from "@babel/plugin-syntax-export-namespace-from";
import syntaxFlow from "@babel/plugin-syntax-flow";
import syntaxFunctionBind from "@babel/plugin-syntax-function-bind";
import syntaxFunctionSent from "@babel/plugin-syntax-function-sent";
Expand All @@ -19,6 +17,7 @@ import syntaxJsx from "@babel/plugin-syntax-jsx";
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator";
import syntaxRecordAndTuple from "@babel/plugin-syntax-record-and-tuple";
import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await";
import syntaxTypescript from "@babel/plugin-syntax-typescript";
import proposalAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions";
Expand Down Expand Up @@ -98,9 +97,7 @@ export {
syntaxClassProperties,
syntaxDecorators,
syntaxDoExpressions,
syntaxDynamicImport,
syntaxExportDefaultFrom,
syntaxExportNamespaceFrom,
syntaxFlow,
syntaxFunctionBind,
syntaxFunctionSent,
Expand All @@ -109,6 +106,7 @@ export {
syntaxObjectRestSpread,
syntaxOptionalCatchBinding,
syntaxPipelineOperator,
syntaxRecordAndTuple,
syntaxTopLevelAwait,
syntaxTypescript,
proposalAsyncGeneratorFunctions,
Expand Down Expand Up @@ -189,9 +187,7 @@ export const all = {
"syntax-class-properties": syntaxClassProperties,
"syntax-decorators": syntaxDecorators,
"syntax-do-expressions": syntaxDoExpressions,
"syntax-dynamic-import": syntaxDynamicImport,
"syntax-export-default-from": syntaxExportDefaultFrom,
"syntax-export-namespace-from": syntaxExportNamespaceFrom,
"syntax-flow": syntaxFlow,
"syntax-function-bind": syntaxFunctionBind,
"syntax-function-sent": syntaxFunctionSent,
Expand All @@ -200,6 +196,7 @@ export const all = {
"syntax-object-rest-spread": syntaxObjectRestSpread,
"syntax-optional-catch-binding": syntaxOptionalCatchBinding,
"syntax-pipeline-operator": syntaxPipelineOperator,
"syntax-record-and-tuple": syntaxRecordAndTuple,
"syntax-top-level-await": syntaxTopLevelAwait,
"syntax-typescript": syntaxTypescript,
"proposal-async-generator-functions": proposalAsyncGeneratorFunctions,
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-standalone/src/preset-stage-1.js
Expand Up @@ -9,6 +9,7 @@ export default (_: any, opts: Object = {}) => {
decoratorsLegacy = false,
decoratorsBeforeExport,
pipelineProposal = "minimal",
recordAndTupleSyntax: recordAndTupleSyntax = "hash",
} = opts;

return {
Expand All @@ -19,8 +20,8 @@ export default (_: any, opts: Object = {}) => {
],
],
plugins: [
[babelPlugins.syntaxRecordAndTuple, { syntaxType: recordAndTupleSyntax }],
babelPlugins.proposalExportDefaultFrom,
babelPlugins.proposalLogicalAssignmentOperators,
[babelPlugins.proposalPipelineOperator, { proposal: pipelineProposal }],
babelPlugins.proposalDoExpressions,
],
Expand Down
2 changes: 0 additions & 2 deletions packages/babel-standalone/src/preset-stage-2.js
Expand Up @@ -18,8 +18,6 @@ export default (_: any, opts: Object = {}) => {
{ legacy: decoratorsLegacy, decoratorsBeforeExport },
],
babelPlugins.proposalFunctionSent,
babelPlugins.proposalExportNamespaceFrom,
babelPlugins.proposalNumericSeparator,
babelPlugins.proposalThrowExpressions,
],
};
Expand Down
5 changes: 4 additions & 1 deletion packages/babel-standalone/src/preset-stage-3.js
Expand Up @@ -10,12 +10,15 @@ export default (_: any, opts: Object) => {

return {
plugins: [
babelPlugins.syntaxDynamicImport,
babelPlugins.syntaxImportMeta,
babelPlugins.syntaxTopLevelAwait,
babelPlugins.proposalExportNamespaceFrom,
babelPlugins.proposalLogicalAssignmentOperators,
[babelPlugins.proposalOptionalChaining, { loose }],
[babelPlugins.proposalNullishCoalescingOperator, { loose }],
[babelPlugins.proposalClassProperties, { loose }],
babelPlugins.proposalJsonStrings,
babelPlugins.proposalNumericSeparator,
[babelPlugins.proposalPrivateMethods, { loose }],
],
};
Expand Down

0 comments on commit eb6d5c6

Please sign in to comment.