Skip to content

Commit b9a6258

Browse files
committed
[api-minor] Stop translating logical assignment in non-legacy builds (PR 12887 follow-up)
When we started using logical assignment operators in the PDF.js project, the feature was new enough that browser support was somewhat limited. That should no longer be the case, since logical assignment has now been available for approximately one year. Hence this patch, which (basically) reverts PR 12887, since using the Babel plugin unconditionally was never intended to be a permanent thing. For browsers/environments without native logical assignment support, users will now have to use a `legacy` build instead. Please refer to the browser compatibility information on MDN: - https://wiki.mozilla.org/RapidRelease/Calendar - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment#browser_compatibility - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_nullish_assignment#browser_compatibility Note also the release information for the major browsers: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_nullish_assignment#browser_compatibility - https://en.wikipedia.org/wiki/Google_Chrome_version_history - https://en.wikipedia.org/wiki/Safari_version_history#Safari_14
1 parent e9146b1 commit b9a6258

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

gulpfile.js

-7
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ function createWebpackConfig(
208208
}
209209
const babelExcludeRegExp = new RegExp(`(${babelExcludes.join("|")})`);
210210

211-
// Since logical assignment operators is a fairly new ECMAScript feature,
212-
// for now we translate these regardless of the `SKIP_BABEL` value (with the
213-
// exception of `MOZCENTRAL`/`TESTING`-builds where this isn't an issue).
214211
const babelPlugins = [
215212
"@babel/plugin-transform-modules-commonjs",
216213
[
@@ -221,9 +218,6 @@ function createWebpackConfig(
221218
},
222219
],
223220
];
224-
if (!bundleDefines.MOZCENTRAL && !bundleDefines.TESTING) {
225-
babelPlugins.push("@babel/plugin-proposal-logical-assignment-operators");
226-
}
227221

228222
const plugins = [];
229223
if (!disableLicenseHeader) {
@@ -1416,7 +1410,6 @@ function buildLibHelper(bundleDefines, inputStream, outputDir) {
14161410
sourceType: "module",
14171411
presets: skipBabel ? undefined : ["@babel/preset-env"],
14181412
plugins: [
1419-
"@babel/plugin-proposal-logical-assignment-operators",
14201413
"@babel/plugin-transform-modules-commonjs",
14211414
[
14221415
"@babel/plugin-transform-runtime",

0 commit comments

Comments
 (0)