Skip to content

Commit

Permalink
Rename -proposal-s that became standard to -transform- (#15614)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed May 22, 2023
1 parent 63755ca commit f42e24d
Show file tree
Hide file tree
Showing 2,524 changed files with 2,161 additions and 1,992 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/reminders.yml
@@ -0,0 +1,37 @@
name: Open issue to remind doing something
on:
schedule:
- cron: 0 0 15 07 *

permissions:
issues: write

jobs:
npm_deprecate:
name: Create issue for deprecating npm packages
runs-on: ubuntu-latest
steps:
- name: Issue Bot Action
uses: imjohnbo/issue-bot@v3.4.3
with:
assignees: nicolo-ribaudo
title: "Deprecate renamed npm packages"
body: |-
Please run these commands:
```
npm deprecate @babel/plugin-proposal-class-static-block "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-static-block instead."
npm deprecate @babel/plugin-proposal-private-property-in-object "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead."
npm deprecate @babel/plugin-proposal-class-properties "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead."
npm deprecate @babel/plugin-proposal-private-methods "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead."
npm deprecate @babel/plugin-proposal-numeric-separator "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead."
npm deprecate @babel/plugin-proposal-logical-assignment-operators "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead."
npm deprecate @babel/plugin-proposal-nullish-coalescing-operator "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead."
npm deprecate @babel/plugin-proposal-optional-chaining "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead."
npm deprecate @babel/plugin-proposal-json-strings "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead."
npm deprecate @babel/plugin-proposal-optional-catch-binding "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead."
npm deprecate @babel/plugin-proposal-async-generator-functions "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead."
npm deprecate @babel/plugin-proposal-object-rest-spread "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead."
npm deprecate @babel/plugin-proposal-unicode-property-regex "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead."
npm deprecate @babel/plugin-proposal-export-namespace-from "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead."
npm deprecate @babel/plugin-proposal-dynamic-import "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead."
```
6 changes: 4 additions & 2 deletions Gulpfile.mjs
Expand Up @@ -404,6 +404,8 @@ function buildRollup(packages, buildStandalone) {
"packages/babel-preset-env/data/*.js",
// Rollup doesn't read export maps, so it loads the cjs fallback
"packages/babel-compat-data/*.js",
// Used by @babel/standalone
"packages/babel-compat-data/scripts/data/legacy-plugin-aliases.js",
"packages/*/src/**/*.cjs",
],
dynamicRequireTargets: [
Expand Down Expand Up @@ -677,8 +679,8 @@ if (bool(process.env.BABEL_8_BREAKING)) {
libBundles = [
"packages/babel-parser",
"packages/babel-plugin-proposal-destructuring-private",
"packages/babel-plugin-proposal-object-rest-spread",
"packages/babel-plugin-proposal-optional-chaining",
"packages/babel-plugin-transform-object-rest-spread",
"packages/babel-plugin-transform-optional-chaining",
"packages/babel-preset-react",
"packages/babel-plugin-transform-destructuring",
"packages/babel-preset-typescript",
Expand Down
2 changes: 0 additions & 2 deletions constraints.pro
Expand Up @@ -33,8 +33,6 @@ gen_enforced_field(WorkspaceCwd, 'engines.node', '>=6.9.0') :-
\+ workspace_field(WorkspaceCwd, 'private', true),
% Get the workspace name
workspace_ident(WorkspaceCwd, WorkspaceIdent),
% Exempt from the rule as it supports '>=4'. TODO: remove with the next major
WorkspaceIdent \= '@babel/plugin-proposal-unicode-property-regex',
% Exempt from the rule as it supports '>=6.0.0'. TODO: remove with the next major
WorkspaceIdent \= '@babel/parser',
% Skip '@babel/eslint*' workspaces. TODO: remove with the next major
Expand Down
4 changes: 2 additions & 2 deletions eslint/babel-eslint-shared-fixtures/config/babel.config.js
Expand Up @@ -8,10 +8,10 @@ module.exports = {
],
plugins: [
"@babel/plugin-syntax-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-class-properties",
["@babel/plugin-proposal-decorators", { version: "2021-12" }],
["@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" }],
"@babel/plugin-proposal-private-methods",
"@babel/plugin-transform-private-methods",
"@babel/plugin-proposal-do-expressions",
],
};
4 changes: 2 additions & 2 deletions eslint/babel-eslint-shared-fixtures/package.json
Expand Up @@ -6,12 +6,12 @@
"dependencies": {
"@babel/core": "workspace:^",
"@babel/eslint-parser": "workspace:^",
"@babel/plugin-proposal-class-properties": "workspace:^",
"@babel/plugin-proposal-decorators": "workspace:^",
"@babel/plugin-proposal-do-expressions": "workspace:^",
"@babel/plugin-proposal-pipeline-operator": "workspace:^",
"@babel/plugin-proposal-private-methods": "workspace:^",
"@babel/plugin-syntax-export-default-from": "workspace:^",
"@babel/plugin-transform-class-properties": "workspace:^",
"@babel/plugin-transform-private-methods": "workspace:^",
"@babel/preset-env": "workspace:^",
"@babel/preset-flow": "workspace:^",
"@babel/preset-react": "workspace:^",
Expand Down
50 changes: 25 additions & 25 deletions packages/babel-core/src/parser/util/missing-plugin-helper.ts
Expand Up @@ -147,8 +147,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators",
},
transform: {
name: "@babel/plugin-proposal-async-generator-functions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-async-generator-functions",
name: "@babel/plugin-transform-async-generator-functions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions",
},
},
classProperties: {
Expand All @@ -157,8 +157,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties",
},
transform: {
name: "@babel/plugin-proposal-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties",
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties",
},
},
classPrivateProperties: {
Expand All @@ -167,8 +167,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties",
},
transform: {
name: "@babel/plugin-proposal-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties",
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties",
},
},
classPrivateMethods: {
Expand All @@ -177,8 +177,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties",
},
transform: {
name: "@babel/plugin-proposal-private-methods",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-methods",
name: "@babel/plugin-transform-private-methods",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods",
},
},
classStaticBlock: {
Expand All @@ -187,8 +187,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block",
},
transform: {
name: "@babel/plugin-proposal-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-static-block",
name: "@babel/plugin-transform-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block",
},
},
dynamicImport: {
Expand All @@ -203,8 +203,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from",
},
transform: {
name: "@babel/plugin-proposal-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-namespace-from",
name: "@babel/plugin-transform-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from",
},
},
importMeta: {
Expand All @@ -219,8 +219,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators",
},
transform: {
name: "@babel/plugin-proposal-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-logical-assignment-operators",
name: "@babel/plugin-transform-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators",
},
},
moduleStringNames: {
Expand All @@ -235,8 +235,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator",
},
transform: {
name: "@babel/plugin-proposal-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-numeric-separator",
name: "@babel/plugin-transform-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator",
},
},
nullishCoalescingOperator: {
Expand All @@ -245,7 +245,7 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator",
},
transform: {
name: "@babel/plugin-proposal-nullish-coalescing-operator",
name: "@babel/plugin-transform-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator",
},
},
Expand All @@ -255,8 +255,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread",
},
transform: {
name: "@babel/plugin-proposal-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-object-rest-spread",
name: "@babel/plugin-transform-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread",
},
},
optionalCatchBinding: {
Expand All @@ -265,8 +265,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding",
},
transform: {
name: "@babel/plugin-proposal-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-catch-binding",
name: "@babel/plugin-transform-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding",
},
},
optionalChaining: {
Expand All @@ -275,8 +275,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining",
},
transform: {
name: "@babel/plugin-proposal-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-chaining",
name: "@babel/plugin-transform-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining",
},
},
privateIn: {
Expand All @@ -285,8 +285,8 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object",
},
transform: {
name: "@babel/plugin-proposal-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-property-in-object",
name: "@babel/plugin-transform-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object",
},
},
});
Expand Down
@@ -1,5 +1,5 @@
{
"compact": false,
"presets": [["env", { "targets": { "browsers": "ie 6" } }]],
"plugins": ["proposal-object-rest-spread"]
"plugins": ["transform-object-rest-spread"]
}
Expand Up @@ -58,7 +58,7 @@ function getPropRef(
const prop = node.property;
if (isPrivateName(prop)) {
throw new Error(
"We can't generate property ref for private name, please install `@babel/plugin-proposal-class-properties`",
"We can't generate property ref for private name, please install `@babel/plugin-transform-class-properties`",
);
}
const key = toComputedKey(node, prop);
Expand Down
26 changes: 13 additions & 13 deletions packages/babel-helper-create-class-features-plugin/src/features.ts
Expand Up @@ -22,9 +22,9 @@ export const FEATURES = Object.freeze(
);

const featuresSameLoose = new Map([
[FEATURES.fields, "@babel/plugin-proposal-class-properties"],
[FEATURES.privateMethods, "@babel/plugin-proposal-private-methods"],
[FEATURES.privateIn, "@babel/plugin-proposal-private-property-in-object"],
[FEATURES.fields, "@babel/plugin-transform-class-properties"],
[FEATURES.privateMethods, "@babel/plugin-transform-private-methods"],
[FEATURES.privateIn, "@babel/plugin-transform-private-property-in-object"],
]);

// We can't use a symbol because this needs to always be the same, even if
Expand Down Expand Up @@ -88,9 +88,9 @@ export function enableFeature(file: File, feature: number, loose: boolean) {
continue;
} else if (resolvedLoose === !loose) {
throw new Error(
"'loose' mode configuration must be the same for @babel/plugin-proposal-class-properties, " +
"@babel/plugin-proposal-private-methods and " +
"@babel/plugin-proposal-private-property-in-object (when they are enabled).",
"'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, " +
"@babel/plugin-transform-private-methods and " +
"@babel/plugin-transform-private-property-in-object (when they are enabled).",
);
} else {
resolvedLoose = loose;
Expand All @@ -106,8 +106,8 @@ export function enableFeature(file: File, feature: number, loose: boolean) {
`Though the "loose" option was set to "${!resolvedLoose}" in your @babel/preset-env ` +
`config, it will not be used for ${name} since the "loose" mode option was set to ` +
`"${resolvedLoose}" for ${higherPriorityPluginName}.\nThe "loose" option must be the ` +
`same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods ` +
`and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can ` +
`same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods ` +
`and @babel/plugin-transform-private-property-in-object (when they are enabled): you can ` +
`silence this warning by explicitly adding\n` +
`\t["${name}", { "loose": ${resolvedLoose} }]\n` +
`to the "plugins" section of your Babel config.`,
Expand Down Expand Up @@ -181,17 +181,17 @@ export function shouldTransform(path: NodePath<t.Class>, file: File): boolean {
"Decorators are not enabled." +
"\nIf you are using " +
'["@babel/plugin-proposal-decorators", { "version": "legacy" }], ' +
'make sure it comes *before* "@babel/plugin-proposal-class-properties" ' +
'make sure it comes *before* "@babel/plugin-transform-class-properties" ' +
"and enable loose mode, like so:\n" +
'\t["@babel/plugin-proposal-decorators", { "version": "legacy" }]\n' +
'\t["@babel/plugin-proposal-class-properties", { "loose": true }]',
'\t["@babel/plugin-transform-class-properties", { "loose": true }]',
);
}

if (privateMethodPath && !hasFeature(file, FEATURES.privateMethods)) {
throw privateMethodPath.buildCodeFrameError(
"Class private methods are not enabled. " +
"Please add `@babel/plugin-proposal-private-methods` to your configuration.",
"Please add `@babel/plugin-transform-private-methods` to your configuration.",
);
}

Expand All @@ -207,14 +207,14 @@ export function shouldTransform(path: NodePath<t.Class>, file: File): boolean {
) {
throw path.buildCodeFrameError(
"Class fields are not enabled. " +
"Please add `@babel/plugin-proposal-class-properties` to your configuration.",
"Please add `@babel/plugin-transform-class-properties` to your configuration.",
);
}

if (staticBlockPath && !hasFeature(file, FEATURES.staticBlocks)) {
throw path.buildCodeFrameError(
"Static class blocks are not enabled. " +
"Please add `@babel/plugin-proposal-class-static-block` to your configuration.",
"Please add `@babel/plugin-transform-class-static-block` to your configuration.",
);
}

Expand Down
Expand Up @@ -15,8 +15,8 @@ export function assertFieldTransformed(
`@babel/plugin-transform-typescript.\n` +
`If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` +
`that it runs before any plugin related to additional class features:\n` +
` - @babel/plugin-proposal-class-properties\n` +
` - @babel/plugin-proposal-private-methods\n` +
` - @babel/plugin-transform-class-properties\n` +
` - @babel/plugin-transform-private-methods\n` +
` - @babel/plugin-proposal-decorators`,
);
}
Expand Down
@@ -1,7 +1,7 @@
{
"plugins": [
"proposal-class-properties",
"transform-class-properties",
"@babel/plugin-syntax-class-static-block"
],
"throws": "Static class blocks are not enabled. Please add `@babel/plugin-proposal-class-static-block` to your configuration."
"throws": "Static class blocks are not enabled. Please add `@babel/plugin-transform-class-static-block` to your configuration."
}
@@ -1,5 +1,5 @@
{
"plugins": ["proposal-class-properties"],
"plugins": ["transform-class-properties"],
"assumptions": {
"privateFieldsAsProperties": true,
"privateFieldsAsSymbols": true
Expand Down

0 comments on commit f42e24d

Please sign in to comment.