@samitouri / QOS-React-2 / commits / c03b8661a9

Upgrade Closure Compiler (#19041)

The Symbol bug has now been fixed so we can remove the hack that renames the global variable.

Sebastian Markbåge committed May 29, 2020 at 09:17 UTC c03b8661a990401bf663d2175597ef8bb6947921
3 files changed +37 -49
package.json
+1 -1
@@ -61,7 +61,7 @@
61 "flow-bin": "0.97",
62 "glob": "^7.1.6",
63 "glob-stream": "^6.1.0",
64 - "google-closure-compiler": "^20200224.0.0",
64 + "google-closure-compiler": "^20200517.0.0",
65 "gzip-size": "^5.1.1",
66 "jasmine-check": "^1.0.0-rc.0",
67 "jest": "^25.2.7",
scripts/rollup/plugins/closure-plugin.js
+2 -14
@@ -19,16 +19,6 @@ function compile(flags) {
19 });
20 }
21
22 -function encodeNativeCalls(code) {
23 - // Closure Compiler tries to install a polyfill if we reference the Symbol global.
24 - // We need to temporarily trick Closure that it's not the built-in it's looking for.
25 - return code.replace(/Symbol/g, 'SymbolTmp');
26 -}
27 -
28 -function decodeNativeCalls(code) {
29 - return code.replace(/SymbolTmp/g, 'Symbol');
30 -}
31 -
22 module.exports = function closure(flags = {}) {
23 return {
24 name: 'scripts/rollup/plugins/closure-plugin',
@@ -36,12 +26,10 @@ module.exports = function closure(flags = {}) {
26 const inputFile = tmp.fileSync();
27 const tempPath = inputFile.name;
28 flags = Object.assign({}, flags, {js: tempPath});
39 - const filteredCode = encodeNativeCalls(code);
40 - await writeFileAsync(tempPath, filteredCode, 'utf8');
29 + await writeFileAsync(tempPath, code, 'utf8');
30 const compiledCode = await compile(flags);
31 inputFile.removeCallback();
43 - const decodedCode = decodeNativeCalls(compiledCode);
44 - return {code: decodedCode};
32 + return {code: compiledCode};
33 },
34 };
35 };
yarn.lock
+34 -34
@@ -6382,46 +6382,46 @@ globby@^6.1.0:
6382 pify "^2.0.0"
6383 pinkie-promise "^2.0.0"
6384
6385 -google-closure-compiler-java@^20200224.0.0:
6386 - version "20200224.0.0"
6387 - resolved "https://registry.yarnpkg.com/google-closure-compiler-java/-/google-closure-compiler-java-20200224.0.0.tgz#03d71aefd0a07010fd8a7057d09c76f6729767bc"
6388 - integrity sha512-palFcDoScauZjWIsGDzMK6h+IctcRb55I3wJX8Ko/DTSz72xwadRdKm0lGt8OoYL7SKEO+IjgD7s8XrAGpLnlQ==
6389 -
6390 -google-closure-compiler-js@^20200224.0.0:
6391 - version "20200224.0.0"
6392 - resolved "https://registry.yarnpkg.com/google-closure-compiler-js/-/google-closure-compiler-js-20200224.0.0.tgz#cf4b598abf7be686c683e530529756805b8af500"
6393 - integrity sha512-70VKN0kbnTRtu2dqxDjWZQGfEQIHj7b7oUUCsYPO5oEXCDfgxNc13oYUJXvrTONLRWlHCNl/I8FNrVOwZ3gY/g==
6394 -
6395 -google-closure-compiler-linux@^20200224.0.0:
6396 - version "20200224.0.0"
6397 - resolved "https://registry.yarnpkg.com/google-closure-compiler-linux/-/google-closure-compiler-linux-20200224.0.0.tgz#d9608b224b4d8f38d4d34e99a24da54bca6b1902"
6398 - integrity sha512-/BaE889EPrXWOKJVolA9++e99xBDMzeFBf7zF7nBB8PUmU5DlvtsoLL82xnT6nbZC1ktHaETlVx+vYGju8zKBQ==
6399 -
6400 -google-closure-compiler-osx@^20200224.0.0:
6401 - version "20200224.0.0"
6402 - resolved "https://registry.yarnpkg.com/google-closure-compiler-osx/-/google-closure-compiler-osx-20200224.0.0.tgz#aee62d8b878a662fc73b92419603168c0c3a35ed"
6403 - integrity sha512-WXVNW9nPUqjvCe38mUIlBGEPVPCTKLtdaXC+q+kQdonkJFHNrpdyYWa746Y8cNP/byQyDNpPsqcKseZTLh17sQ==
6404 -
6405 -google-closure-compiler-windows@^20200224.0.0:
6406 - version "20200224.0.0"
6407 - resolved "https://registry.yarnpkg.com/google-closure-compiler-windows/-/google-closure-compiler-windows-20200224.0.0.tgz#cae323b898625ca57b0e87aaddde021a414dda58"
6408 - integrity sha512-l6w2D8r9+GC9CQTAYEMAuNI996Zb6YV5qG7+FR0gCoL6h6S3Mc7mi87bafgwaicsVcmmHE/9kCBuW4ZyTMs5Fg==
6409 -
6410 -google-closure-compiler@^20200224.0.0:
6411 - version "20200224.0.0"
6412 - resolved "https://registry.yarnpkg.com/google-closure-compiler/-/google-closure-compiler-20200224.0.0.tgz#ec0e708d9716a48e12fff43fe37fa5cec732a283"
6413 - integrity sha512-V81dRYygdHbZtOtU16VX26xAdJBB1UZyfSg3OTzdNl3l/xEIx1D/L7TYUqjeTXsxcy+JruJ/UfUlIJAOaMRTog==
6385 +google-closure-compiler-java@^20200517.0.0:
6386 + version "20200517.0.0"
6387 + resolved "https://registry.yarnpkg.com/google-closure-compiler-java/-/google-closure-compiler-java-20200517.0.0.tgz#778370c22273c9085f4cf959ce063f8f112c02ac"
6388 + integrity sha512-JVZBiyyXwcYi6Yc3lO6dF2hMLJA4OzPm4/mgsem/tF1vk2HsWTnL3GTaBsPB2ENVZp0hoqsd4KgpPiG9ssNWxw==
6389 +
6390 +google-closure-compiler-js@^20200517.0.0:
6391 + version "20200517.0.0"
6392 + resolved "https://registry.yarnpkg.com/google-closure-compiler-js/-/google-closure-compiler-js-20200517.0.0.tgz#9cb0861f764073d1c4d3b7453b74073ccb1ecfb1"
6393 + integrity sha512-dz6dOUHx5nhdIqMRXacAYS8aJfLvw4IKxGg28Hq/zeeDPHlX3P3iBK20NgFDfT8zdushThymtMqChSy7C5eyfA==
6394 +
6395 +google-closure-compiler-linux@^20200517.0.0:
6396 + version "20200517.0.0"
6397 + resolved "https://registry.yarnpkg.com/google-closure-compiler-linux/-/google-closure-compiler-linux-20200517.0.0.tgz#2b9ecb634130060174aff5c52329a694ea4be68b"
6398 + integrity sha512-S5xPh6TtP+ESzZrmQLcDDqtZAsCVTbdI4VS98wQlN6IMZTd94nAnOCg9mrxQNAgop2t4sdsv/KuH0BGPUWEZ+w==
6399 +
6400 +google-closure-compiler-osx@^20200517.0.0:
6401 + version "20200517.0.0"
6402 + resolved "https://registry.yarnpkg.com/google-closure-compiler-osx/-/google-closure-compiler-osx-20200517.0.0.tgz#9394e9a2fd97e3729fc3bd2abcffff6aab2cfcaa"
6403 + integrity sha512-FWIcsKqLllLjdOBZd7azijVaObydgRd0obVNi63eUfC5MX6T4qxKumGCyor2UCNY6by2ESz+PlGqCFzFhZ6b2g==
6404 +
6405 +google-closure-compiler-windows@^20200517.0.0:
6406 + version "20200517.0.0"
6407 + resolved "https://registry.yarnpkg.com/google-closure-compiler-windows/-/google-closure-compiler-windows-20200517.0.0.tgz#c5cdde438c29458666a83358567b12072924ed6c"
6408 + integrity sha512-UXhjRGwS8deTkRla/riyVq3psscgMuw78lepEPtq5NgbumgJzY2+IQP9q+4MVOfJW58Rv0JUWKAFOnBBSZWcAQ==
6409 +
6410 +google-closure-compiler@^20200517.0.0:
6411 + version "20200517.0.0"
6412 + resolved "https://registry.yarnpkg.com/google-closure-compiler/-/google-closure-compiler-20200517.0.0.tgz#6c47f99fc1be59bd4f9e23c5a8f2e66d64b54143"
6413 + integrity sha512-80W9zBS9Ajk1T5InWCfsoPohDmo5T1AAyw1rHh5+dgb/jPgwC65KhY+oJozTncf+/7tyQHJXozTARwhSlBUcMg==
6414 dependencies:
6415 chalk "2.x"
6416 - google-closure-compiler-java "^20200224.0.0"
6417 - google-closure-compiler-js "^20200224.0.0"
6416 + google-closure-compiler-java "^20200517.0.0"
6417 + google-closure-compiler-js "^20200517.0.0"
6418 minimist "1.x"
6419 vinyl "2.x"
6420 vinyl-sourcemaps-apply "^0.2.0"
6421 optionalDependencies:
6422 - google-closure-compiler-linux "^20200224.0.0"
6423 - google-closure-compiler-osx "^20200224.0.0"
6424 - google-closure-compiler-windows "^20200224.0.0"
6422 + google-closure-compiler-linux "^20200517.0.0"
6423 + google-closure-compiler-osx "^20200517.0.0"
6424 + google-closure-compiler-windows "^20200517.0.0"
6425
6426 got@^6.7.1:
6427 version "6.7.1"