Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internally rename proposal-* to transform-* in preset-env #14976

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/babel-compat-data/data/overlapping-plugins.json
Expand Up @@ -16,6 +16,9 @@
"transform-template-literals": [
"bugfix/transform-tagged-template-caching"
],
"transform-optional-chaining": [
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
],
"proposal-optional-chaining": [
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
]
Expand Down
11 changes: 11 additions & 0 deletions packages/babel-compat-data/data/plugin-bugfixes.json
Expand Up @@ -88,6 +88,17 @@
"ios": "13.4",
"electron": "13.0"
},
"transform-optional-chaining": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "74",
"safari": "13.1",
"node": "14",
"ios": "13.4",
"samsung": "13",
"electron": "8.0"
},
"proposal-optional-chaining": {
"chrome": "80",
"opera": "67",
Expand Down
153 changes: 153 additions & 0 deletions packages/babel-compat-data/data/plugins.json
@@ -1,4 +1,12 @@
{
"transform-class-static-block": {
"chrome": "94",
"opera": "80",
"edge": "94",
"firefox": "93",
"node": "16.11",
"electron": "15.0"
},
"proposal-class-static-block": {
"chrome": "94",
"opera": "80",
Expand All @@ -7,6 +15,16 @@
"node": "16.11",
"electron": "15.0"
},
"transform-private-property-in-object": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "90",
"safari": "15",
"node": "16.9",
"ios": "15",
"electron": "13.0"
},
"proposal-private-property-in-object": {
"chrome": "91",
"opera": "77",
Expand All @@ -17,6 +35,17 @@
"ios": "15",
"electron": "13.0"
},
"transform-class-properties": {
"chrome": "74",
"opera": "62",
"edge": "79",
"firefox": "90",
"safari": "14.1",
"node": "12",
"ios": "15",
"samsung": "11",
"electron": "6.0"
},
"proposal-class-properties": {
"chrome": "74",
"opera": "62",
Expand All @@ -28,6 +57,17 @@
"samsung": "11",
"electron": "6.0"
},
"transform-private-methods": {
"chrome": "84",
"opera": "70",
"edge": "84",
"firefox": "90",
"safari": "15",
"node": "14.6",
"ios": "15",
"samsung": "14",
"electron": "10.0"
},
"proposal-private-methods": {
"chrome": "84",
"opera": "70",
Expand All @@ -39,6 +79,18 @@
"samsung": "14",
"electron": "10.0"
},
"transform-numeric-separator": {
"chrome": "75",
"opera": "62",
"edge": "79",
"firefox": "70",
"safari": "13",
"node": "12.5",
"ios": "13",
"samsung": "11",
"rhino": "1.7.14",
"electron": "6.0"
},
"proposal-numeric-separator": {
"chrome": "75",
"opera": "62",
Expand All @@ -51,6 +103,17 @@
"rhino": "1.7.14",
"electron": "6.0"
},
"transform-logical-assignment-operators": {
"chrome": "85",
"opera": "71",
"edge": "85",
"firefox": "79",
"safari": "14",
"node": "15",
"ios": "14",
"samsung": "14",
"electron": "10.0"
},
"proposal-logical-assignment-operators": {
"chrome": "85",
"opera": "71",
Expand All @@ -62,6 +125,17 @@
"samsung": "14",
"electron": "10.0"
},
"transform-nullish-coalescing-operator": {
"chrome": "80",
"opera": "67",
"edge": "80",
"firefox": "72",
"safari": "13.1",
"node": "14",
"ios": "13.4",
"samsung": "13",
"electron": "8.0"
},
"proposal-nullish-coalescing-operator": {
"chrome": "80",
"opera": "67",
Expand All @@ -73,6 +147,16 @@
"samsung": "13",
"electron": "8.0"
},
"transform-optional-chaining": {
"chrome": "91",
"opera": "77",
"edge": "91",
"firefox": "74",
"safari": "13.1",
"node": "16.9",
"ios": "13.4",
"electron": "13.0"
},
"proposal-optional-chaining": {
"chrome": "91",
"opera": "77",
Expand All @@ -83,6 +167,18 @@
"ios": "13.4",
"electron": "13.0"
},
"transform-json-strings": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "62",
"safari": "12",
"node": "10",
"ios": "12",
"samsung": "9",
"rhino": "1.7.14",
"electron": "3.0"
},
"proposal-json-strings": {
"chrome": "66",
"opera": "53",
Expand All @@ -95,6 +191,17 @@
"rhino": "1.7.14",
"electron": "3.0"
},
"transform-optional-catch-binding": {
"chrome": "66",
"opera": "53",
"edge": "79",
"firefox": "58",
"safari": "11.1",
"node": "10",
"ios": "11.3",
"samsung": "9",
"electron": "3.0"
},
"proposal-optional-catch-binding": {
"chrome": "66",
"opera": "53",
Expand All @@ -115,6 +222,17 @@
"samsung": "5",
"electron": "0.37"
},
"transform-async-generator-functions": {
"chrome": "63",
"opera": "50",
"edge": "79",
"firefox": "57",
"safari": "12",
"node": "10",
"ios": "12",
"samsung": "8",
"electron": "3.0"
},
"proposal-async-generator-functions": {
"chrome": "63",
"opera": "50",
Expand All @@ -126,6 +244,17 @@
"samsung": "8",
"electron": "3.0"
},
"transform-object-rest-spread": {
"chrome": "60",
"opera": "47",
"edge": "79",
"firefox": "55",
"safari": "11.1",
"node": "8.3",
"ios": "11.3",
"samsung": "8",
"electron": "2.0"
},
"proposal-object-rest-spread": {
"chrome": "60",
"opera": "47",
Expand All @@ -148,6 +277,17 @@
"samsung": "8",
"electron": "3.0"
},
"transform-unicode-property-regex": {
"chrome": "64",
"opera": "51",
"edge": "79",
"firefox": "78",
"safari": "11.1",
"node": "10",
"ios": "11.3",
"samsung": "9",
"electron": "3.0"
},
"proposal-unicode-property-regex": {
"chrome": "64",
"opera": "51",
Expand Down Expand Up @@ -462,6 +602,19 @@
"rhino": "1.7.13",
"electron": "0.20"
},
"transform-export-namespace-from": {
"chrome": "72",
"and_chr": "72",
"edge": "79",
"firefox": "80",
"and_ff": "80",
"node": "13.2",
"opera": "60",
"op_mob": "51",
"samsung": "11.0",
"android": "72",
"electron": "5.0"
},
"proposal-export-namespace-from": {
"chrome": "72",
"and_chr": "72",
Expand Down
9 changes: 7 additions & 2 deletions packages/babel-compat-data/scripts/build-bugfixes-targets.js
Expand Up @@ -4,7 +4,12 @@

const path = require("path");

const { generateData, environments, writeFile } = require("./utils-build-data");
const {
generateData,
environments,
writeFile,
defineLegacyPluginAliases,
} = require("./utils-build-data");

const pluginBugfixes = require("./data/plugin-bugfixes");
const pluginFeatures = require("./data/plugin-features");
Expand Down Expand Up @@ -34,7 +39,7 @@ for (const [filename, data] of [
]) {
const dataPath = path.join(__dirname, `../data/${filename}.json`);

if (!writeFile(data, dataPath, filename)) {
if (!writeFile(defineLegacyPluginAliases(data), dataPath, filename)) {
process.exitCode = 1;
break;
}
Expand Down
15 changes: 12 additions & 3 deletions packages/babel-compat-data/scripts/build-data.js
Expand Up @@ -3,13 +3,18 @@
const path = require("path");
const compatData = require("@mdn/browser-compat-data").javascript;
const { process } = require("./build-modules-support");
const { generateData, environments, writeFile } = require("./utils-build-data");
const {
generateData,
environments,
writeFile,
defineLegacyPluginAliases,
} = require("./utils-build-data");

for (const target of ["plugin", "corejs2-built-in"]) {
// We ignore 'overlapping' here, because it's already generated by
// built-bugfixes-targets.js which has a complete view over all the
// plugins that we have data for.
const { data: newData } = generateData(
let { data: newData } = generateData(
environments,
require(`./data/${target}-features`)
);
Expand All @@ -21,7 +26,11 @@ for (const target of ["plugin", "corejs2-built-in"]) {
// the node.js compat data is 12.0, the first node version ships `export *` behind a flag
// here we overwrite to 13.2 which is the first unflagged version
exportNamespaceFromCompatData.node = "13.2";
newData["proposal-export-namespace-from"] = exportNamespaceFromCompatData;
newData["transform-export-namespace-from"] = exportNamespaceFromCompatData;

// Add proposal-* aliases for backward compatibility.
// TODO(Babel 7): This won't be needed anymore.
newData = defineLegacyPluginAliases(newData);
}
const dataPath = path.join(__dirname, `../data/${target}s.json`);

Expand Down
20 changes: 20 additions & 0 deletions packages/babel-compat-data/scripts/data/legacy-plugin-aliases.js
@@ -0,0 +1,20 @@
// TODO(Babel 7): This won't be needed anymore

// prettier-ignore
module.exports = {
__proto__: null,
"transform-class-static-block": "proposal-class-static-block",
"transform-private-property-in-object": "proposal-private-property-in-object",
"transform-class-properties": "proposal-class-properties",
"transform-private-methods": "proposal-private-methods",
"transform-numeric-separator": "proposal-numeric-separator",
"transform-logical-assignment-operators": "proposal-logical-assignment-operators",
"transform-nullish-coalescing-operator": "proposal-nullish-coalescing-operator",
"transform-optional-chaining": "proposal-optional-chaining",
"transform-json-strings": "proposal-json-strings",
"transform-optional-catch-binding": "proposal-optional-catch-binding",
"transform-async-generator-functions": "proposal-async-generator-functions",
"transform-object-rest-spread": "proposal-object-rest-spread",
"transform-unicode-property-regex": "proposal-unicode-property-regex",
"transform-export-namespace-from": "proposal-export-namespace-from",
};
2 changes: 1 addition & 1 deletion packages/babel-compat-data/scripts/data/plugin-bugfixes.js
Expand Up @@ -43,6 +43,6 @@ module.exports = {
features: [
"optional chaining operator (?.) / spread parameters after optional chaining",
],
replaces: "proposal-optional-chaining",
replaces: "transform-optional-chaining",
},
};