From b490fde223617771de91c5d97bc877b097531f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 11:52:05 +0200 Subject: [PATCH 01/21] fix: add missing ES2015 Number polyfills --- packages/next-polyfill-nomodule/src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/next-polyfill-nomodule/src/index.js b/packages/next-polyfill-nomodule/src/index.js index e5eebacfc1e2c..df37098a1fffd 100644 --- a/packages/next-polyfill-nomodule/src/index.js +++ b/packages/next-polyfill-nomodule/src/index.js @@ -20,6 +20,8 @@ import 'core-js/features/number/is-nan' import 'core-js/features/number/is-safe-integer' import 'core-js/features/number/max-safe-integer' import 'core-js/features/number/min-safe-integer' +import 'core-js/features/number/parse-float' +import 'core-js/features/number/parse-int' import 'core-js/features/object/entries' import 'core-js/features/object/get-own-property-descriptors' import 'core-js/features/object/keys' From 3d073240827b2cb44368621bf266f0c8598a73ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 11:56:12 +0200 Subject: [PATCH 02/21] fix: add missing ES2019 Object.fromEntries polyfill --- packages/next-polyfill-nomodule/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next-polyfill-nomodule/src/index.js b/packages/next-polyfill-nomodule/src/index.js index df37098a1fffd..3abc40d18b5e7 100644 --- a/packages/next-polyfill-nomodule/src/index.js +++ b/packages/next-polyfill-nomodule/src/index.js @@ -23,6 +23,7 @@ import 'core-js/features/number/min-safe-integer' import 'core-js/features/number/parse-float' import 'core-js/features/number/parse-int' import 'core-js/features/object/entries' +import 'core-js/features/object/from-entries' import 'core-js/features/object/get-own-property-descriptors' import 'core-js/features/object/keys' import 'core-js/features/object/is' From d256589856ecea88989acf8a2310cc072ecbf354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 12:11:59 +0200 Subject: [PATCH 03/21] fix: more restrictive tsc suggestions for compat --- .../next/lib/typescript/writeConfigurationDefaults.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 491200c9a6c2c..00a7e56634471 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -22,7 +22,13 @@ function getDesiredCompilerOptions( // These are suggested values and will be set when not present in the // tsconfig.json target: { suggested: 'es5' }, - lib: { suggested: ['dom', 'dom.iterable', 'esnext'] }, + lib: { + suggested: [ + 'dom', + 'dom.iterable', + 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` + ] + }, allowJs: { suggested: true }, skipLibCheck: { suggested: true }, strict: { suggested: false }, From 32420870b1495826e934f1955bf0e0d0578e1f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 13:31:46 +0200 Subject: [PATCH 04/21] fix: add missing ES2015 Math polyfills --- packages/next-polyfill-nomodule/src/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/next-polyfill-nomodule/src/index.js b/packages/next-polyfill-nomodule/src/index.js index 3abc40d18b5e7..b5b58f1245fc6 100644 --- a/packages/next-polyfill-nomodule/src/index.js +++ b/packages/next-polyfill-nomodule/src/index.js @@ -12,6 +12,23 @@ import 'core-js/features/array/of' import 'core-js/features/function/has-instance' import 'core-js/features/function/name' import 'core-js/features/map' +import 'core-js/features/math/acosh' +import 'core-js/features/math/asinh' +import 'core-js/features/math/atanh' +import 'core-js/features/math/cbrt' +import 'core-js/features/math/clz32' +import 'core-js/features/math/cosh' +import 'core-js/features/math/expm1' +import 'core-js/features/math/fround' +import 'core-js/features/math/hypot' +import 'core-js/features/math/imul' +import 'core-js/features/math/log10' +import 'core-js/features/math/log1p' +import 'core-js/features/math/log2' +import 'core-js/features/math/sign' +import 'core-js/features/math/sinh' +import 'core-js/features/math/tanh' +import 'core-js/features/math/trunc' import 'core-js/features/number/constructor' import 'core-js/features/number/epsilon' import 'core-js/features/number/is-finite' From f99747abb969afae246e0dcf68b9e568fa3cdc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:04:08 +0200 Subject: [PATCH 05/21] feat: support `export * as ns from 'module'` --- packages/next/build/babel/preset.ts | 1 + packages/next/package.json | 1 + yarn.lock | 47 +++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/packages/next/build/babel/preset.ts b/packages/next/build/babel/preset.ts index 09f0551f1b902..8296591b1ee5d 100644 --- a/packages/next/build/babel/preset.ts +++ b/packages/next/build/babel/preset.ts @@ -182,6 +182,7 @@ module.exports = ( require('@babel/plugin-proposal-nullish-coalescing-operator'), isServer && require('@babel/plugin-syntax-bigint'), [require('@babel/plugin-proposal-numeric-separator').default, false], + require('@babel/plugin-proposal-export-namespace-from'), ].filter(Boolean), overrides: [ { diff --git a/packages/next/package.json b/packages/next/package.json index c0d77ecca77b9..15f5029ad618c 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -62,6 +62,7 @@ "@babel/code-frame": "7.8.3", "@babel/core": "7.7.7", "@babel/plugin-proposal-class-properties": "7.8.3", + "@babel/plugin-proposal-export-namespace-from": "7.10.4", "@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3", "@babel/plugin-proposal-numeric-separator": "7.8.3", "@babel/plugin-proposal-object-rest-spread": "7.9.6", diff --git a/yarn.lock b/yarn.lock index 39eb5c9375cc7..9c33864bb07b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -311,6 +311,11 @@ version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" +"@babel/helper-plugin-utils@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" + integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== + "@babel/helper-regex@^7.4.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" @@ -442,6 +447,14 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-dynamic-import" "^7.8.0" +"@babel/plugin-proposal-export-namespace-from@7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz#570d883b91031637b3e2958eea3c438e62c05f54" + integrity sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-proposal-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz#da5216b238a98b58a1e05d6852104b10f9a70d6b" @@ -530,6 +543,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-flow@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.8.3.tgz#f2c883bd61a6316f2c89380ae5122f923ba4527f" @@ -4087,7 +4107,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@4.13.0, browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6, browserslist@^4.0.0, browserslist@^4.11.1, browserslist@^4.13.0, browserslist@^4.3.6, browserslist@^4.6.4, browserslist@^4.8.3, browserslist@^4.8.5: +browserslist@4.13.0, browserslist@^4.0.0, browserslist@^4.11.1, browserslist@^4.13.0, browserslist@^4.3.6, browserslist@^4.6.4, browserslist@^4.8.3, browserslist@^4.8.5: version "4.13.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.13.0.tgz#42556cba011e1b0a2775b611cba6a8eca18e940d" integrity sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ== @@ -4097,6 +4117,14 @@ browserslist@4.13.0, browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7 escalade "^3.0.1" node-releases "^1.1.58" +browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + integrity sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk= + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + browserstack-local@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/browserstack-local/-/browserstack-local-1.4.0.tgz#d979cac056f57b9af159b3bcd7fdc09b4354537c" @@ -4403,11 +4431,21 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634: version "1.0.30001023" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30001023.tgz#f856f71af16a5a44e81f1fcefc1673912a43da72" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001019, caniuse-lite@^1.0.30001020, caniuse-lite@^1.0.30001093: +caniuse-db@^1.0.30000639: + version "1.0.30001109" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30001109.tgz#756c5d689ce550c891e1456cf4c6b8f7a253ec19" + integrity sha512-B/DC85f77h55PRO9YTSyzMOA24CSAwzgBNCJtrTdEtejW/HGAn6kWgzNHLpU3fZFWWOdQ6ABo0YzvZ3BXPtqLw== + +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001019, caniuse-lite@^1.0.30001020: version "1.0.30001066" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz#0a8a58a10108f2b9bf38e7b65c237b12fd9c5f04" integrity sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw== +caniuse-lite@^1.0.30001093: + version "1.0.30001109" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001109.tgz#a9f3f26a0c3753b063d7acbb48dfb9c0e46f2b19" + integrity sha512-4JIXRodHzdS3HdK8nSgIqXYLExOvG+D2/EenSvcub2Kp3QEADjo2v2oUn5g0n0D+UNwG9BtwKOyGcSq2qvQXvQ== + capitalize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capitalize/-/capitalize-1.0.0.tgz#dc802c580aee101929020d2ca14b4ca8a0ae44be" @@ -6128,6 +6166,11 @@ ejs@^2.6.1: version "2.7.4" resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" +electron-to-chromium@^1.2.7: + version "1.3.516" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.516.tgz#03ec071b061e462b786bf7e7ce226fd7ab7cf1f6" + integrity sha512-WDM5AAQdOrvLqSX8g3Zd5AujBXfMxf96oeZkff0U2HF5op3tjShE+on2yay3r1UD4M9I3p0iHpAS4+yV8U8A9A== + electron-to-chromium@^1.3.488: version "1.3.501" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.501.tgz#faa17a2cb0105ee30d5e1ca87eae7d8e85dd3175" From 93bd1a5c281739058780062c9a149aa138996f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:07:03 +0200 Subject: [PATCH 06/21] feat: define `globalThis` as `window` for browsers --- packages/next/build/webpack-config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 2985e6ecce822..abc8106234220 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -888,7 +888,10 @@ export default async function getBaseWebpackConfig( // pre-webpack era (common in server-side code) 'global.GENTLY': JSON.stringify(false), } - : undefined), + : { + // Replace `globalThis` with `window` in browser environments + globalThis: 'window', + }), // stub process.env with proxy to warn a missing value is // being accessed in development mode ...(config.experimental.pageEnv && process.env.NODE_ENV !== 'production' From 653e58e5b62aa55ba2bc3721dc5f919be3616784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:18:58 +0200 Subject: [PATCH 07/21] revert: "feat: define `globalThis` as `window` for browsers" This reverts commit 93bd1a5c281739058780062c9a149aa138996f2f. --- packages/next/build/webpack-config.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index abc8106234220..2985e6ecce822 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -888,10 +888,7 @@ export default async function getBaseWebpackConfig( // pre-webpack era (common in server-side code) 'global.GENTLY': JSON.stringify(false), } - : { - // Replace `globalThis` with `window` in browser environments - globalThis: 'window', - }), + : undefined), // stub process.env with proxy to warn a missing value is // being accessed in development mode ...(config.experimental.pageEnv && process.env.NODE_ENV !== 'production' From ed22ed2a2dcba5196ece0c2ebec00febead8f65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:33:30 +0200 Subject: [PATCH 08/21] revert: "fix: add missing ES2019 Object.fromEntries polyfill" This reverts commit 3d073240827b2cb44368621bf266f0c8598a73ed. --- packages/next-polyfill-nomodule/src/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/next-polyfill-nomodule/src/index.js b/packages/next-polyfill-nomodule/src/index.js index b5b58f1245fc6..c39121f7c897f 100644 --- a/packages/next-polyfill-nomodule/src/index.js +++ b/packages/next-polyfill-nomodule/src/index.js @@ -40,7 +40,6 @@ import 'core-js/features/number/min-safe-integer' import 'core-js/features/number/parse-float' import 'core-js/features/number/parse-int' import 'core-js/features/object/entries' -import 'core-js/features/object/from-entries' import 'core-js/features/object/get-own-property-descriptors' import 'core-js/features/object/keys' import 'core-js/features/object/is' From 51112b1d53342f517124a91034094c22982c2170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:37:36 +0200 Subject: [PATCH 09/21] fix: more restrictive tsc suggestions for compat --- packages/next/lib/typescript/writeConfigurationDefaults.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 00a7e56634471..243875647a095 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -26,8 +26,8 @@ function getDesiredCompilerOptions( suggested: [ 'dom', 'dom.iterable', - 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` - ] + 'es2018', // Advance as browsers evolve, with `@next/polyfill-nomodule` + ], }, allowJs: { suggested: true }, skipLibCheck: { suggested: true }, From f88f19ec15aba4b5415f9a10fe9c24079a3794c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 14:39:41 +0200 Subject: [PATCH 10/21] revert: "fix: add missing ES2015 Math polyfills" This reverts commit 32420870b1495826e934f1955bf0e0d0578e1f7d. --- packages/next-polyfill-nomodule/src/index.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/next-polyfill-nomodule/src/index.js b/packages/next-polyfill-nomodule/src/index.js index c39121f7c897f..df37098a1fffd 100644 --- a/packages/next-polyfill-nomodule/src/index.js +++ b/packages/next-polyfill-nomodule/src/index.js @@ -12,23 +12,6 @@ import 'core-js/features/array/of' import 'core-js/features/function/has-instance' import 'core-js/features/function/name' import 'core-js/features/map' -import 'core-js/features/math/acosh' -import 'core-js/features/math/asinh' -import 'core-js/features/math/atanh' -import 'core-js/features/math/cbrt' -import 'core-js/features/math/clz32' -import 'core-js/features/math/cosh' -import 'core-js/features/math/expm1' -import 'core-js/features/math/fround' -import 'core-js/features/math/hypot' -import 'core-js/features/math/imul' -import 'core-js/features/math/log10' -import 'core-js/features/math/log1p' -import 'core-js/features/math/log2' -import 'core-js/features/math/sign' -import 'core-js/features/math/sinh' -import 'core-js/features/math/tanh' -import 'core-js/features/math/trunc' import 'core-js/features/number/constructor' import 'core-js/features/number/epsilon' import 'core-js/features/number/is-finite' From 7b61256bacef26e97a4a70409af670ae2f7475be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 15:11:04 +0200 Subject: [PATCH 11/21] test: fix tsconfig snapshots --- test/integration/tsconfig-verifier/test/index.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/tsconfig-verifier/test/index.test.js b/test/integration/tsconfig-verifier/test/index.test.js index 0d974ae7402f4..d0d8c273557aa 100644 --- a/test/integration/tsconfig-verifier/test/index.test.js +++ b/test/integration/tsconfig-verifier/test/index.test.js @@ -30,7 +30,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"esnext\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -74,7 +74,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"esnext\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -141,7 +141,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"esnext\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -189,7 +189,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"esnext\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -234,7 +234,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"esnext\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, From dc4a2abc2deb0397c46fce1aee1f052252d681ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 19:15:07 +0200 Subject: [PATCH 12/21] feat: polyfill Object.fromEntries for all browsers --- packages/next/client/index.js | 4 ++++ .../next/lib/typescript/writeConfigurationDefaults.ts | 2 +- packages/next/package.json | 1 + packages/next/taskfile.js | 9 +++++++++ test/integration/tsconfig-verifier/test/index.test.js | 10 +++++----- yarn.lock | 5 +++++ 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/next/client/index.js b/packages/next/client/index.js index 23fe1c7a4c0f1..0512fca3ff259 100644 --- a/packages/next/client/index.js +++ b/packages/next/client/index.js @@ -21,6 +21,10 @@ if (!('finally' in Promise.prototype)) { Promise.prototype.finally = require('next/dist/build/polyfills/finally-polyfill.min') } +if (!('fromEntries' in Object)) { + Object.fromEntries = require('next/dist/build/polyfills/object.from-entries/index') +} + const data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent) window.__NEXT_DATA__ = data diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 243875647a095..8f5c565d2ac2f 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -26,7 +26,7 @@ function getDesiredCompilerOptions( suggested: [ 'dom', 'dom.iterable', - 'es2018', // Advance as browsers evolve, with `@next/polyfill-nomodule` + 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` ], }, allowJs: { suggested: true }, diff --git a/packages/next/package.json b/packages/next/package.json index 15f5029ad618c..d0db4962a8c6b 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -79,6 +79,7 @@ "@babel/types": "7.9.6", "@next/react-dev-overlay": "9.5.2-canary.1", "@next/react-refresh-utils": "9.5.2-canary.1", + "@ungap/from-entries": "0.2.0", "ast-types": "0.13.2", "babel-plugin-syntax-jsx": "6.18.0", "babel-plugin-transform-define": "2.0.0", diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index e93d2bc661f84..b6004e78d8cc0 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -19,6 +19,14 @@ export async function finally_polyfill(task, opts) { .target('dist/build/polyfills') } +export async function fromEntries_polyfill(task, opts) { + await task + .source( + opts.src || relative(__dirname, require.resolve('@ungap/from-entries')) + ) + .target('dist/build/polyfills/object.from-entries') +} + export async function unfetch(task, opts) { await task .source(opts.src || relative(__dirname, require.resolve('unfetch'))) @@ -29,6 +37,7 @@ export async function browser_polyfills(task) { await task.parallel([ 'next__polyfill_nomodule', 'finally_polyfill', + 'fromEntries_polyfill', 'unfetch', ]) } diff --git a/test/integration/tsconfig-verifier/test/index.test.js b/test/integration/tsconfig-verifier/test/index.test.js index d0d8c273557aa..fcbe70de0954b 100644 --- a/test/integration/tsconfig-verifier/test/index.test.js +++ b/test/integration/tsconfig-verifier/test/index.test.js @@ -30,7 +30,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -74,7 +74,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -141,7 +141,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -189,7 +189,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -234,7 +234,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, diff --git a/yarn.lock b/yarn.lock index 9c33864bb07b0..1bb1673167538 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3046,6 +3046,11 @@ semver "^7.3.2" tsutils "^3.17.1" +"@ungap/from-entries@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@ungap/from-entries/-/from-entries-0.2.0.tgz#7627a6c4fcd602dac1ac2619360c3903fef3a9c5" + integrity sha512-1Uq5t17ucRke/+/6oj26+3+ORnT1WDN2USGt9P/7BPDVlmhUf7skuwR80rxER/tiMdJxcntvg+QjB5vYN5M21A== + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" From e9a3b28084c40ce3a89661b1688a51b66d42db7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 19:25:39 +0200 Subject: [PATCH 13/21] fix: remove a redundant prototype assignment --- packages/next/client/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/next/client/index.js b/packages/next/client/index.js index 0512fca3ff259..e17766bbb63c6 100644 --- a/packages/next/client/index.js +++ b/packages/next/client/index.js @@ -17,8 +17,7 @@ import measureWebVitals from './performance-relayer' /// if (!('finally' in Promise.prototype)) { - // eslint-disable-next-line no-extend-native - Promise.prototype.finally = require('next/dist/build/polyfills/finally-polyfill.min') + require('next/dist/build/polyfills/finally-polyfill.min') } if (!('fromEntries' in Object)) { From 11cda532c742a932f6444a80d8572d84014612e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 19:29:21 +0200 Subject: [PATCH 14/21] test: update bundle size limit --- test/integration/build-output/test/index.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/build-output/test/index.test.js b/test/integration/build-output/test/index.test.js index 2b4f1738042b6..01adfb3cb6703 100644 --- a/test/integration/build-output/test/index.test.js +++ b/test/integration/build-output/test/index.test.js @@ -104,7 +104,7 @@ describe('Build Output', () => { expect(parseFloat(err404FirstLoad) - 63).toBeLessThanOrEqual(0) expect(err404FirstLoad.endsWith('kB')).toBe(true) - expect(parseFloat(sharedByAll) - 59.3).toBeLessThanOrEqual(0) + expect(parseFloat(sharedByAll) - 59.4).toBeLessThanOrEqual(0) expect(sharedByAll.endsWith('kB')).toBe(true) if (_appSize.endsWith('kB')) { From 15b6c439a16044bf505655726f8c40cbba1f1d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 19:41:56 +0200 Subject: [PATCH 15/21] test: update bundle size limit again --- test/integration/build-output/test/index.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/build-output/test/index.test.js b/test/integration/build-output/test/index.test.js index 01adfb3cb6703..961fc2512d115 100644 --- a/test/integration/build-output/test/index.test.js +++ b/test/integration/build-output/test/index.test.js @@ -118,7 +118,7 @@ describe('Build Output', () => { expect(parseFloat(webpackSize) - 752).toBeLessThanOrEqual(0) expect(webpackSize.endsWith(' B')).toBe(true) - expect(parseFloat(mainSize) - 6.5).toBeLessThanOrEqual(0) + expect(parseFloat(mainSize) - 6.6).toBeLessThanOrEqual(0) expect(mainSize.endsWith('kB')).toBe(true) expect(parseFloat(frameworkSize) - 41).toBeLessThanOrEqual(0) From 10fad013f70b28da118ec425d67306ba66cff5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 20:31:54 +0200 Subject: [PATCH 16/21] revert: "feat: polyfill Object.fromEntries for all browsers" This reverts commit dc4a2abc2deb0397c46fce1aee1f052252d681ec. --- packages/next/client/index.js | 7 ++----- .../next/lib/typescript/writeConfigurationDefaults.ts | 2 +- packages/next/package.json | 1 - packages/next/taskfile.js | 9 --------- test/integration/build-output/test/index.test.js | 4 ++-- test/integration/tsconfig-verifier/test/index.test.js | 10 +++++----- yarn.lock | 5 ----- 7 files changed, 10 insertions(+), 28 deletions(-) diff --git a/packages/next/client/index.js b/packages/next/client/index.js index e17766bbb63c6..23fe1c7a4c0f1 100644 --- a/packages/next/client/index.js +++ b/packages/next/client/index.js @@ -17,11 +17,8 @@ import measureWebVitals from './performance-relayer' /// if (!('finally' in Promise.prototype)) { - require('next/dist/build/polyfills/finally-polyfill.min') -} - -if (!('fromEntries' in Object)) { - Object.fromEntries = require('next/dist/build/polyfills/object.from-entries/index') + // eslint-disable-next-line no-extend-native + Promise.prototype.finally = require('next/dist/build/polyfills/finally-polyfill.min') } const data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent) diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 8f5c565d2ac2f..243875647a095 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -26,7 +26,7 @@ function getDesiredCompilerOptions( suggested: [ 'dom', 'dom.iterable', - 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` + 'es2018', // Advance as browsers evolve, with `@next/polyfill-nomodule` ], }, allowJs: { suggested: true }, diff --git a/packages/next/package.json b/packages/next/package.json index d0db4962a8c6b..15f5029ad618c 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -79,7 +79,6 @@ "@babel/types": "7.9.6", "@next/react-dev-overlay": "9.5.2-canary.1", "@next/react-refresh-utils": "9.5.2-canary.1", - "@ungap/from-entries": "0.2.0", "ast-types": "0.13.2", "babel-plugin-syntax-jsx": "6.18.0", "babel-plugin-transform-define": "2.0.0", diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index b6004e78d8cc0..e93d2bc661f84 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -19,14 +19,6 @@ export async function finally_polyfill(task, opts) { .target('dist/build/polyfills') } -export async function fromEntries_polyfill(task, opts) { - await task - .source( - opts.src || relative(__dirname, require.resolve('@ungap/from-entries')) - ) - .target('dist/build/polyfills/object.from-entries') -} - export async function unfetch(task, opts) { await task .source(opts.src || relative(__dirname, require.resolve('unfetch'))) @@ -37,7 +29,6 @@ export async function browser_polyfills(task) { await task.parallel([ 'next__polyfill_nomodule', 'finally_polyfill', - 'fromEntries_polyfill', 'unfetch', ]) } diff --git a/test/integration/build-output/test/index.test.js b/test/integration/build-output/test/index.test.js index 961fc2512d115..2b4f1738042b6 100644 --- a/test/integration/build-output/test/index.test.js +++ b/test/integration/build-output/test/index.test.js @@ -104,7 +104,7 @@ describe('Build Output', () => { expect(parseFloat(err404FirstLoad) - 63).toBeLessThanOrEqual(0) expect(err404FirstLoad.endsWith('kB')).toBe(true) - expect(parseFloat(sharedByAll) - 59.4).toBeLessThanOrEqual(0) + expect(parseFloat(sharedByAll) - 59.3).toBeLessThanOrEqual(0) expect(sharedByAll.endsWith('kB')).toBe(true) if (_appSize.endsWith('kB')) { @@ -118,7 +118,7 @@ describe('Build Output', () => { expect(parseFloat(webpackSize) - 752).toBeLessThanOrEqual(0) expect(webpackSize.endsWith(' B')).toBe(true) - expect(parseFloat(mainSize) - 6.6).toBeLessThanOrEqual(0) + expect(parseFloat(mainSize) - 6.5).toBeLessThanOrEqual(0) expect(mainSize.endsWith('kB')).toBe(true) expect(parseFloat(frameworkSize) - 41).toBeLessThanOrEqual(0) diff --git a/test/integration/tsconfig-verifier/test/index.test.js b/test/integration/tsconfig-verifier/test/index.test.js index fcbe70de0954b..d0d8c273557aa 100644 --- a/test/integration/tsconfig-verifier/test/index.test.js +++ b/test/integration/tsconfig-verifier/test/index.test.js @@ -30,7 +30,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -74,7 +74,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -141,7 +141,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -189,7 +189,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -234,7 +234,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"es2018\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, diff --git a/yarn.lock b/yarn.lock index 1bb1673167538..9c33864bb07b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3046,11 +3046,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@ungap/from-entries@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@ungap/from-entries/-/from-entries-0.2.0.tgz#7627a6c4fcd602dac1ac2619360c3903fef3a9c5" - integrity sha512-1Uq5t17ucRke/+/6oj26+3+ORnT1WDN2USGt9P/7BPDVlmhUf7skuwR80rxER/tiMdJxcntvg+QjB5vYN5M21A== - "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" From c1b2357b93fc62cd00ecb822bcf0dfe2cb4db18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 20:33:40 +0200 Subject: [PATCH 17/21] fix: update tsconfig 'lib', ignoring fromEntries --- .../next/lib/typescript/writeConfigurationDefaults.ts | 2 +- test/integration/tsconfig-verifier/test/index.test.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 243875647a095..8f5c565d2ac2f 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -26,7 +26,7 @@ function getDesiredCompilerOptions( suggested: [ 'dom', 'dom.iterable', - 'es2018', // Advance as browsers evolve, with `@next/polyfill-nomodule` + 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` ], }, allowJs: { suggested: true }, diff --git a/test/integration/tsconfig-verifier/test/index.test.js b/test/integration/tsconfig-verifier/test/index.test.js index d0d8c273557aa..fcbe70de0954b 100644 --- a/test/integration/tsconfig-verifier/test/index.test.js +++ b/test/integration/tsconfig-verifier/test/index.test.js @@ -30,7 +30,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -74,7 +74,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -141,7 +141,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -189,7 +189,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -234,7 +234,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2018\\" + \\"es2019\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, From 76a6902e7f2b694bb2a1d304fc5bb2a01993c606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Sat, 1 Aug 2020 20:36:29 +0200 Subject: [PATCH 18/21] revert: tsconfig 'lib' version restriction --- .../next/lib/typescript/writeConfigurationDefaults.ts | 8 +------- test/integration/tsconfig-verifier/test/index.test.js | 10 +++++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/next/lib/typescript/writeConfigurationDefaults.ts b/packages/next/lib/typescript/writeConfigurationDefaults.ts index 8f5c565d2ac2f..491200c9a6c2c 100644 --- a/packages/next/lib/typescript/writeConfigurationDefaults.ts +++ b/packages/next/lib/typescript/writeConfigurationDefaults.ts @@ -22,13 +22,7 @@ function getDesiredCompilerOptions( // These are suggested values and will be set when not present in the // tsconfig.json target: { suggested: 'es5' }, - lib: { - suggested: [ - 'dom', - 'dom.iterable', - 'es2019', // Advance as browsers evolve, with `@next/polyfill-nomodule` - ], - }, + lib: { suggested: ['dom', 'dom.iterable', 'esnext'] }, allowJs: { suggested: true }, skipLibCheck: { suggested: true }, strict: { suggested: false }, diff --git a/test/integration/tsconfig-verifier/test/index.test.js b/test/integration/tsconfig-verifier/test/index.test.js index fcbe70de0954b..0d974ae7402f4 100644 --- a/test/integration/tsconfig-verifier/test/index.test.js +++ b/test/integration/tsconfig-verifier/test/index.test.js @@ -30,7 +30,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"esnext\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -74,7 +74,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"esnext\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -141,7 +141,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"esnext\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -189,7 +189,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"esnext\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, @@ -234,7 +234,7 @@ describe('tsconfig.json verifier', () => { \\"lib\\": [ \\"dom\\", \\"dom.iterable\\", - \\"es2019\\" + \\"esnext\\" ], \\"allowJs\\": true, \\"skipLibCheck\\": true, From b39ef9a5c4da89128ff1d910d5fe0284ebadf329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Mon, 3 Aug 2020 23:31:14 +0200 Subject: [PATCH 19/21] test: add integration test for namespace exports --- test/integration/babel/pages/index.js | 2 +- test/integration/babel/test/namespace-exported-react.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test/integration/babel/test/namespace-exported-react.js diff --git a/test/integration/babel/pages/index.js b/test/integration/babel/pages/index.js index 11a75d46c762b..651cc595ed6ba 100644 --- a/test/integration/babel/pages/index.js +++ b/test/integration/babel/pages/index.js @@ -1,5 +1,5 @@ // This page is written in flowtype to test Babel's functionality -import * as React from 'react' +import * as React from '../test/namespace-exported-react' type Props = {} diff --git a/test/integration/babel/test/namespace-exported-react.js b/test/integration/babel/test/namespace-exported-react.js new file mode 100644 index 0000000000000..2593247284f2d --- /dev/null +++ b/test/integration/babel/test/namespace-exported-react.js @@ -0,0 +1 @@ +export * as React from 'react' From 788c0a022d19ed32e9191e48624db94bec11378f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Mon, 3 Aug 2020 23:50:18 +0200 Subject: [PATCH 20/21] test: try fixing Babel integration test --- test/integration/babel/pages/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/babel/pages/index.js b/test/integration/babel/pages/index.js index 651cc595ed6ba..982bbf2a96c6d 100644 --- a/test/integration/babel/pages/index.js +++ b/test/integration/babel/pages/index.js @@ -1,9 +1,10 @@ // This page is written in flowtype to test Babel's functionality -import * as React from '../test/namespace-exported-react' +import * as React from 'react' +import { Component } from '../test/namespace-exported-react' type Props = {} -export default class MyComponent extends React.Component { +export default class MyComponent extends Component { render() { return
Test Babel
} From 98b4076d9e36ed8c51bfe71a8b118fd5d9c2d7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= Date: Tue, 4 Aug 2020 00:02:25 +0200 Subject: [PATCH 21/21] test: fix namespace-exported React --- test/integration/babel/pages/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/integration/babel/pages/index.js b/test/integration/babel/pages/index.js index 982bbf2a96c6d..51400c76c94b0 100644 --- a/test/integration/babel/pages/index.js +++ b/test/integration/babel/pages/index.js @@ -1,10 +1,9 @@ // This page is written in flowtype to test Babel's functionality -import * as React from 'react' -import { Component } from '../test/namespace-exported-react' +import { React } from '../test/namespace-exported-react' type Props = {} -export default class MyComponent extends Component { +export default class MyComponent extends React.Component { render() { return
Test Babel
}