From 1a6ec281774dd8627723f85e6fb59cb0be538b5c Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 29 Apr 2021 09:54:26 +0200 Subject: [PATCH 1/7] Deserialize SuperJSON-ed pageProps before passing to dehydratedState --- packages/core/src/blitz-app-root.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/src/blitz-app-root.tsx b/packages/core/src/blitz-app-root.tsx index 9c38d00efa..0ad0b222f3 100644 --- a/packages/core/src/blitz-app-root.tsx +++ b/packages/core/src/blitz-app-root.tsx @@ -1,4 +1,5 @@ import React, {ComponentPropsWithoutRef, useEffect} from "react" +import SuperJSON from "superjson" import {useAuthorizeIf} from "./auth/auth-client" import {publicDataStore} from "./auth/public-data-store" import {BlitzProvider} from "./blitz-provider" @@ -85,8 +86,15 @@ export function withBlitzAppRoot(UserAppRoot: React.ComponentType) { document.documentElement.classList.add("blitz-first-render-complete") }, []) + let dehydratedState = props.pageProps.dehydratedState + if (dehydratedState && "_superjson" in props.pageProps) { + const {_superjson, ...json} = props.pageProps + const deserialized = SuperJSON.deserialize({json, meta: _superjson}) as any + dehydratedState = deserialized.dehydratedState + } + return ( - + {noPageFlicker && } From 260424fbb14e44096cd6fde4e2bc75e5df773b02 Mon Sep 17 00:00:00 2001 From: Jeremy Liberman Date: Sun, 2 May 2021 13:38:34 -0500 Subject: [PATCH 2/7] Add integration test for prefetching with dehydratedState --- test/integration/auth/pages/prefetching.tsx | 52 +++++++++++++++++++++ test/integration/auth/test/index.test.ts | 23 +++++++++ 2 files changed, 75 insertions(+) create mode 100644 test/integration/auth/pages/prefetching.tsx diff --git a/test/integration/auth/pages/prefetching.tsx b/test/integration/auth/pages/prefetching.tsx new file mode 100644 index 0000000000..e65b67afc0 --- /dev/null +++ b/test/integration/auth/pages/prefetching.tsx @@ -0,0 +1,52 @@ +import getAuthenticatedBasic from "app/queries/getAuthenticatedBasic" +import { + dehydrate, + getQueryKey, + GetServerSidePropsContext, + invokeWithMiddleware, + QueryClient, + useQuery, +} from "blitz" +import {Suspense, useEffect} from "react" + +function Content() { + const [result] = useQuery(getAuthenticatedBasic, null, { + staleTime: 60 * 1000, + }) + + return
{result}
+} + +function Bomb() { + useEffect(() => { + throw new Error("💣") + }) + + return <>somebody set up us the bomb +} + +export default function Page() { + return ( +
+ }> + + +
+ ) +} + +Page.authenticate = true + +export async function getServerSideProps(ctx: GetServerSidePropsContext) { + const queryClient = new QueryClient() + + await queryClient.prefetchQuery(getQueryKey(getAuthenticatedBasic, null), () => + invokeWithMiddleware(getAuthenticatedBasic, null, ctx), + ) + + return { + props: { + dehydratedState: dehydrate(queryClient), + }, + } +} diff --git a/test/integration/auth/test/index.test.ts b/test/integration/auth/test/index.test.ts index 3f9c855f50..66181cd70f 100644 --- a/test/integration/auth/test/index.test.ts +++ b/test/integration/auth/test/index.test.ts @@ -75,4 +75,27 @@ describe("Auth", () => { if (browser) await browser.close() }) }) + + describe("prefetching", () => { + it("should login successfully", async () => { + const browser = await webdriver(context.appPort, "/login") + await browser.waitForElementByCss("#content") + let text = await browser.elementByCss("#content").text() + expect(text).toMatch(/logged-out/) + await browser.elementByCss("#login").click() + await waitFor(500) + text = await browser.elementByCss("#content").text() + expect(text).toMatch(/logged-in/) + + if (browser) await browser.close() + }) + + it("should prefetch from the query cache #2281", async () => { + const browser = await webdriver(context.appPort, "/prefetching", true) + await browser.waitForElementByCss("#content") + const text = await browser.elementByCss("#content").text() + expect(text).toMatch(/authenticated-basic-result/) + if (browser) await browser.close() + }) + }) }) From de05f5323d673277e0fb534e06b4e59a11177f7b Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 4 May 2021 11:41:06 +0200 Subject: [PATCH 3/7] Revert "Deserialize SuperJSON-ed pageProps before passing to dehydratedState" This reverts commit 1a6ec281774dd8627723f85e6fb59cb0be538b5c. --- packages/core/src/blitz-app-root.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/core/src/blitz-app-root.tsx b/packages/core/src/blitz-app-root.tsx index 0ad0b222f3..9c38d00efa 100644 --- a/packages/core/src/blitz-app-root.tsx +++ b/packages/core/src/blitz-app-root.tsx @@ -1,5 +1,4 @@ import React, {ComponentPropsWithoutRef, useEffect} from "react" -import SuperJSON from "superjson" import {useAuthorizeIf} from "./auth/auth-client" import {publicDataStore} from "./auth/public-data-store" import {BlitzProvider} from "./blitz-provider" @@ -86,15 +85,8 @@ export function withBlitzAppRoot(UserAppRoot: React.ComponentType) { document.documentElement.classList.add("blitz-first-render-complete") }, []) - let dehydratedState = props.pageProps.dehydratedState - if (dehydratedState && "_superjson" in props.pageProps) { - const {_superjson, ...json} = props.pageProps - const deserialized = SuperJSON.deserialize({json, meta: _superjson}) as any - dehydratedState = deserialized.dehydratedState - } - return ( - + {noPageFlicker && } From 84e4cb09941521c188883a698bb8da6eafaa3b9a Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 4 May 2021 11:43:30 +0200 Subject: [PATCH 4/7] Update babel-plugin-superjson-next --- packages/babel-preset/package.json | 2 +- yarn.lock | 691 ++++++++++++++++++++++++++++- 2 files changed, 672 insertions(+), 21 deletions(-) diff --git a/packages/babel-preset/package.json b/packages/babel-preset/package.json index 3149a65ed9..c9104da022 100644 --- a/packages/babel-preset/package.json +++ b/packages/babel-preset/package.json @@ -32,7 +32,7 @@ ], "dependencies": { "@babel/helper-module-imports": "^7.0.0", - "babel-plugin-superjson-next": "0.2.2" + "babel-plugin-superjson-next": "0.3.0" }, "devDependencies": { "@babel/core": "7.12.10" diff --git a/yarn.lock b/yarn.lock index c4f7aae85d..8b46598ec1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -280,6 +280,13 @@ dependencies: "@babel/types" "^7.12.13" +"@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + "@babel/helper-module-transforms@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" @@ -403,6 +410,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== +"@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== + "@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz#d66cb8b7a3e7fe4c6962b32020a131ecf0847f4f" @@ -1304,6 +1316,14 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.13.12", "@babel/types@^7.13.17": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.1.tgz#095bd12f1c08ab63eff6e8f7745fa7c9cc15a9db" + integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + to-fast-properties "^2.0.0" + "@babel/types@^7.13.13": version "7.13.14" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d" @@ -1342,6 +1362,14 @@ resolved "https://registry.yarnpkg.com/@chevrotain/utils/-/utils-9.0.0.tgz#3b40e30a2007610af9b900125cb654d648f07ac7" integrity sha512-J0uI+VxqCMiTFmVD95dfZr1QxJcw1RMQc7X3umMAfEcG5f2uWrZeyX0h3hURvXgzUcK6vXH5r+SNv+4bPxWpdg== +"@cnakazawa/watch@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" + integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + "@csstools/convert-colors@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" @@ -1762,6 +1790,40 @@ jest-util "^27.0.0-next.7" slash "^3.0.0" +"@jest/core@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.6.3.tgz#7639fcb3833d748a4656ada54bde193051e45fad" + integrity sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw== + dependencies: + "@jest/console" "^26.6.2" + "@jest/reporters" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-changed-files "^26.6.2" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-resolve-dependencies "^26.6.3" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + jest-watcher "^26.6.2" + micromatch "^4.0.2" + p-each-series "^2.1.0" + rimraf "^3.0.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + "@jest/core@^27.0.0-next.5", "@jest/core@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.0-next.7.tgz#763c1ca304d7505d61308df6b9eaa621a8b4a37f" @@ -1797,6 +1859,16 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/environment@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.6.2.tgz#ba364cc72e221e79cc8f0a99555bf5d7577cf92c" + integrity sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA== + dependencies: + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + "@jest/environment@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.0-next.7.tgz#c420d12b14769929a9283fda08f33504749ff745" @@ -1807,6 +1879,18 @@ "@types/node" "*" jest-mock "^27.0.0-next.7" +"@jest/fake-timers@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.6.2.tgz#459c329bcf70cee4af4d7e3f3e67848123535aad" + integrity sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA== + dependencies: + "@jest/types" "^26.6.2" + "@sinonjs/fake-timers" "^6.0.1" + "@types/node" "*" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" + jest-util "^26.6.2" + "@jest/fake-timers@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.0-next.7.tgz#fd0b9c198343cd098fe65332c655255d3ad186c6" @@ -1819,6 +1903,15 @@ jest-mock "^27.0.0-next.7" jest-util "^27.0.0-next.7" +"@jest/globals@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.6.2.tgz#5b613b78a1aa2655ae908eba638cc96a20df720a" + integrity sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/types" "^26.6.2" + expect "^26.6.2" + "@jest/globals@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.0-next.7.tgz#9c8d426221fe93b320a221235b963df772f87794" @@ -1828,6 +1921,38 @@ "@jest/types" "^27.0.0-next.7" expect "^27.0.0-next.7" +"@jest/reporters@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.6.2.tgz#1f518b99637a5f18307bd3ecf9275f6882a667f6" + integrity sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.2.4" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^4.0.3" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + jest-haste-map "^26.6.2" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + slash "^3.0.0" + source-map "^0.6.0" + string-length "^4.0.1" + terminal-link "^2.0.0" + v8-to-istanbul "^7.0.0" + optionalDependencies: + node-notifier "^8.0.0" + "@jest/reporters@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.0-next.7.tgz#e645495a6a41722ffab6b16f4bf6901f22c812e3" @@ -1858,6 +1983,15 @@ terminal-link "^2.0.0" v8-to-istanbul "^7.0.0" +"@jest/source-map@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.6.2.tgz#29af5e1e2e324cafccc936f218309f54ab69d535" + integrity sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.2.4" + source-map "^0.6.0" + "@jest/source-map@^27.0.0-next.3": version "27.0.0-next.3" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.0.0-next.3.tgz#ef4498c1641041cfb90b28bef51a59877742818b" @@ -1887,6 +2021,17 @@ "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" +"@jest/test-sequencer@^26.6.3": + version "26.6.3" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz#98e8a45100863886d074205e8ffdc5a7eb582b17" + integrity sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw== + dependencies: + "@jest/test-result" "^26.6.2" + graceful-fs "^4.2.4" + jest-haste-map "^26.6.2" + jest-runner "^26.6.3" + jest-runtime "^26.6.3" + "@jest/test-sequencer@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.0-next.7.tgz#b413ab543e196fab0cbe046181314ed477846e26" @@ -1898,6 +2043,27 @@ jest-runner "^27.0.0-next.7" jest-runtime "^27.0.0-next.7" +"@jest/transform@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" + integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^26.6.2" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^26.6.2" + jest-regex-util "^26.0.0" + jest-util "^26.6.2" + micromatch "^4.0.2" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + "@jest/transform@^27.0.0-next.5", "@jest/transform@^27.0.0-next.7": version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.0-next.7.tgz#541f2b061c2b0b7197fbd5994dd9582ce3f2fd16" @@ -3491,6 +3657,13 @@ dependencies: type-detect "4.0.8" +"@sinonjs/fake-timers@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" + integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@sinonjs/fake-timers@^7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.0.2.tgz#a53e71d4154ee704ea9b36a6d0b0780e246fadd1" @@ -3987,6 +4160,14 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" +"@types/jest@26.x": + version "26.0.23" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7" + integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA== + dependencies: + jest-diff "^26.0.0" + pretty-format "^26.0.0" + "@types/jscodeshift@0.7.2": version "0.7.2" resolved "https://registry.yarnpkg.com/@types/jscodeshift/-/jscodeshift-0.7.2.tgz#5ce43f545fa17e07c1fe614ccfb024f78e687be5" @@ -4251,7 +4432,7 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.6.tgz#f4b1efa784e8db479cdb8b14403e2144b1e9ff03" integrity sha512-6gOkRe7OIioWAXfnO/2lFiv+SJichKVSys1mSsgyrYHSEjk8Ctv4tSR/Odvnu+HWlH2C8j53dahU03XmQdd5fA== -"@types/prettier@^2.1.5": +"@types/prettier@^2.0.0", "@types/prettier@^2.1.5": version "2.2.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0" integrity sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA== @@ -5686,6 +5867,20 @@ babel-jest@27.0.0-next.5: graceful-fs "^4.2.4" slash "^3.0.0" +babel-jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" + integrity sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA== + dependencies: + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/babel__core" "^7.1.7" + babel-plugin-istanbul "^6.0.0" + babel-preset-jest "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + slash "^3.0.0" + babel-jest@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.0-next.7.tgz#b004c37e7cf589dc32018013af37005393a98a17" @@ -5728,6 +5923,16 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" +babel-plugin-jest-hoist@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz#8185bd030348d254c6d7dd974355e6a28b21e62d" + integrity sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.0.0" + "@types/babel__traverse" "^7.0.6" + babel-plugin-jest-hoist@^27.0.0-next.3: version "27.0.0-next.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.0-next.3.tgz#5a8a32acda0946bfad7ae25a99168b42e39229f9" @@ -5757,13 +5962,13 @@ babel-plugin-macros@3.0.1: babel-plugin-syntax-jsx "^6.18.0" lodash "^4.17.11" -babel-plugin-superjson-next@0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-superjson-next/-/babel-plugin-superjson-next-0.2.2.tgz#7b2c8133c4c60260de3e83589e5d3707d8f1478a" - integrity sha512-baf+zAWlZrGfHIOsqef/HIuhBW0sN+bFaONvEfkSOZy2Ho/o3BM4lvVC53i9pqxnGUM922HFEAUpYaLop5SW4Q== +babel-plugin-superjson-next@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-superjson-next/-/babel-plugin-superjson-next-0.3.0.tgz#86620a2d134a1b0a515d903512cf7f766b394cc1" + integrity sha512-fTE8uWUy9OJG7PkRNP094XDdieoBsZR2iatxurbNqLyd4INXpwuuQ246iLu4+dAeQHtGhOJZxsPR8KdbNvdnlQ== dependencies: - "@babel/helper-module-imports" "^7.12.13" - "@babel/types" "^7.12.17" + "@babel/helper-module-imports" "^7.13.12" + "@babel/types" "^7.13.17" hoist-non-react-statics "^3.3.2" babel-plugin-syntax-jsx@6.18.0, babel-plugin-syntax-jsx@^6.18.0: @@ -5817,6 +6022,14 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" +babel-preset-jest@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz#747872b1171df032252426586881d62d31798fee" + integrity sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ== + dependencies: + babel-plugin-jest-hoist "^26.6.2" + babel-preset-current-node-syntax "^1.0.0" + babel-preset-jest@^27.0.0-next.3: version "27.0.0-next.3" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.0-next.3.tgz#2c696e2e048f7bf5597f9602790b36373beb8c28" @@ -6145,7 +6358,17 @@ browserify-zlib@0.2.0, browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@4.14.6, browserslist@4.16.1, browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.14.6, browserslist@^4.15.0, browserslist@^4.3.6, browserslist@^4.6.4: +browserslist@4.14.6: + version "4.14.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.6.tgz#97702a9c212e0c6b6afefad913d3a1538e348457" + integrity sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A== + dependencies: + caniuse-lite "^1.0.30001154" + electron-to-chromium "^1.3.585" + escalade "^3.1.1" + node-releases "^1.1.65" + +browserslist@4.16.1, browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.14.6, browserslist@^4.15.0, browserslist@^4.3.6, browserslist@^4.6.4: version "4.16.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.1.tgz#bf757a2da376b3447b800a16f0f1c96358138766" integrity sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA== @@ -6493,16 +6716,28 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@1.0.30001179, caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001156, caniuse-lite@^1.0.30001173, caniuse-lite@^1.0.30001179: +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001156, caniuse-lite@^1.0.30001173, caniuse-lite@^1.0.30001179: version "1.0.30001179" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001179.tgz#b0803883b4471a6c62066fb1752756f8afc699c8" integrity sha512-blMmO0QQujuUWZKyVrD1msR4WNDAqb/UPO1Sw2WWsQ7deoM5bJiicKnWJ1Y0NS/aGINSnKPIWBMw5luX+NDUCA== +caniuse-lite@^1.0.30001154: + version "1.0.30001221" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001221.tgz#b916721ddf59066cfbe96c5c9a77cf7ae5c52e65" + integrity sha512-b9TOZfND3uGSLjMOrLh8XxSQ41x8mX+9MLJYDM4AAHLfaZHttrLNPrScWjVnBITRZbY5sPpCt7X85n7VSLZ+/g== + capitalize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capitalize/-/capitalize-1.0.0.tgz#dc802c580aee101929020d2ca14b4ca8a0ae44be" integrity sha1-3IAsWAruEBkpAg0soUtMqKCuRL4= +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + cardinal@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.1.1.tgz#7cc1055d822d212954d07b085dea251cc7bc5505" @@ -6821,6 +7056,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +cjs-module-lexer@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" + integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== + cjs-module-lexer@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.1.1.tgz#4a62531147dd488d0369c1cf1580b621796a9b26" @@ -7008,6 +7248,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -8885,6 +9134,11 @@ ejs@^3.1.5: dependencies: jake "^10.6.1" +electron-to-chromium@^1.3.585: + version "1.3.725" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.725.tgz#04fc83f9189169aff50f0a00c6b4090b910cba85" + integrity sha512-2BbeAESz7kc6KBzs7WVrMc1BY5waUphk4D4DX5dSQXJhsc3tP5ZFaiyuL0AB7vUKzDYpIeYwTYlEfxyjsGUrhw== + electron-to-chromium@^1.3.634: version "1.3.642" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz#8b884f50296c2ae2a9997f024d0e3e57facc2b94" @@ -8908,6 +9162,11 @@ elliptic@^6.5.3: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" +emittery@^0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" + integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== + emittery@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" @@ -9612,6 +9871,11 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +exec-sh@^0.3.2: + version "0.3.6" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.6.tgz#ff264f9e325519a60cb5e273692943483cca63bc" + integrity sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w== + execa@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.3.tgz#4b84301b33042cfb622771e886ed0b10e5634642" @@ -9757,6 +10021,18 @@ expand-tilde@^1.2.2: dependencies: os-homedir "^1.0.1" +expect@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" + integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== + dependencies: + "@jest/types" "^26.6.2" + ansi-styles "^4.0.0" + jest-get-type "^26.3.0" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" + expect@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.0-next.7.tgz#e8befaeed77981b9957fcbad2cec1adcd4d498a6" @@ -10606,7 +10882,7 @@ fsevents@^1.0.0, fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.2.1: +fsevents@^2.1.2, fsevents@^2.2.1: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -12785,6 +13061,15 @@ jake@^10.6.1: filelist "^1.0.1" minimatch "^3.0.4" +jest-changed-files@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" + integrity sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ== + dependencies: + "@jest/types" "^26.6.2" + execa "^4.0.0" + throat "^5.0.0" + jest-changed-files@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.0-next.7.tgz#ee07bcb2c55581fa3cbf176e00bffe607cabe2b3" @@ -12838,6 +13123,25 @@ jest-cli@27.0.0-next.5: prompts "^2.0.1" yargs "^16.0.3" +jest-cli@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.6.3.tgz#43117cfef24bc4cd691a174a8796a532e135e92a" + integrity sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg== + dependencies: + "@jest/core" "^26.6.3" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.4" + import-local "^3.0.2" + is-ci "^2.0.0" + jest-config "^26.6.3" + jest-util "^26.6.2" + jest-validate "^26.6.2" + prompts "^2.0.1" + yargs "^15.4.1" + jest-cli@^27.0.0-next.5: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.0-next.7.tgz#eaeda2193cff305dd970c6b2346e914ea7ff4f1c" @@ -12857,6 +13161,30 @@ jest-cli@^27.0.0-next.5: prompts "^2.0.1" yargs "^16.0.3" +jest-config@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.6.3.tgz#64f41444eef9eb03dc51d5c53b75c8c71f645349" + integrity sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^26.6.3" + "@jest/types" "^26.6.2" + babel-jest "^26.6.3" + chalk "^4.0.0" + deepmerge "^4.2.2" + glob "^7.1.1" + graceful-fs "^4.2.4" + jest-environment-jsdom "^26.6.2" + jest-environment-node "^26.6.2" + jest-get-type "^26.3.0" + jest-jasmine2 "^26.6.3" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + micromatch "^4.0.2" + pretty-format "^26.6.2" + jest-config@^27.0.0-next.5, jest-config@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.0-next.7.tgz#ed11fca28e8f1b0b046c739f3825ff896ac27e80" @@ -12882,7 +13210,7 @@ jest-config@^27.0.0-next.5, jest-config@^27.0.0-next.7: micromatch "^4.0.2" pretty-format "^27.0.0-next.7" -jest-diff@^26.0.0: +jest-diff@^26.0.0, jest-diff@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== @@ -12902,6 +13230,13 @@ jest-diff@^27.0.0-next.7: jest-get-type "^27.0.0-next.0" pretty-format "^27.0.0-next.7" +jest-docblock@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" + integrity sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w== + dependencies: + detect-newline "^3.0.0" + jest-docblock@^27.0.0-next.0: version "27.0.0-next.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.0-next.0.tgz#c65a5d914d2108c70541ea195dc6fba8a32d28b4" @@ -12909,6 +13244,17 @@ jest-docblock@^27.0.0-next.0: dependencies: detect-newline "^3.0.0" +jest-each@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.6.2.tgz#02526438a77a67401c8a6382dfe5999952c167cb" + integrity sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A== + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + jest-get-type "^26.3.0" + jest-util "^26.6.2" + pretty-format "^26.6.2" + jest-each@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.0-next.7.tgz#4922fd7e12347facf70307810917dc1fd0e5faa3" @@ -12920,6 +13266,19 @@ jest-each@^27.0.0-next.7: jest-util "^27.0.0-next.7" pretty-format "^27.0.0-next.7" +jest-environment-jsdom@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz#78d09fe9cf019a357009b9b7e1f101d23bd1da3e" + integrity sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + jest-util "^26.6.2" + jsdom "^16.4.0" + jest-environment-jsdom@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.0-next.7.tgz#8d75d8b709ac7dbf1e51e8445b7a94396602d881" @@ -12933,6 +13292,18 @@ jest-environment-jsdom@^27.0.0-next.7: jest-util "^27.0.0-next.7" jsdom "^16.4.0" +jest-environment-node@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.6.2.tgz#824e4c7fb4944646356f11ac75b229b0035f2b0c" + integrity sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag== + dependencies: + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock "^26.6.2" + jest-util "^26.6.2" + jest-environment-node@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.0-next.7.tgz#73ced17c0f2388ef883408a49b50b43cf3e4f477" @@ -12955,6 +13326,27 @@ jest-get-type@^27.0.0-next.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.0-next.0.tgz#3881f161b4380ff5dc7983a8fc22f49611331799" integrity sha512-Fp0uZdy/HNhqHxhBrYvR+AjtfkQgsWTGNmJuqKfGrjn3j4ke0LTXq2ryZW+Fliix9geW8NNK3gnxQ7BfeP6sTg== +jest-haste-map@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" + integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== + dependencies: + "@jest/types" "^26.6.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^26.0.0" + jest-serializer "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.1.2" + jest-haste-map@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.0-next.7.tgz#1646f7cd5dd79972a7656bc50cc950a443f04e65" @@ -12975,6 +13367,30 @@ jest-haste-map@^27.0.0-next.7: optionalDependencies: fsevents "^2.2.1" +jest-jasmine2@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz#adc3cf915deacb5212c93b9f3547cd12958f2edd" + integrity sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + expect "^26.6.2" + is-generator-fn "^2.0.0" + jest-each "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-runtime "^26.6.3" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + pretty-format "^26.6.2" + throat "^5.0.0" + jest-jasmine2@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.0-next.7.tgz#dc97547e8ea1d3599ae444c490e293afdd01acc4" @@ -12999,6 +13415,14 @@ jest-jasmine2@^27.0.0-next.7: pretty-format "^27.0.0-next.7" throat "^6.0.1" +jest-leak-detector@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af" + integrity sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg== + dependencies: + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + jest-leak-detector@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.0-next.7.tgz#bf818b414143bef9ecb7b6a54e468afa58f1a95c" @@ -13007,6 +13431,16 @@ jest-leak-detector@^27.0.0-next.7: jest-get-type "^27.0.0-next.0" pretty-format "^27.0.0-next.7" +jest-matcher-utils@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" + integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== + dependencies: + chalk "^4.0.0" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + jest-matcher-utils@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.0-next.7.tgz#f7a94cfbf9deb7028a7caa2b1d83e525ded9b254" @@ -13047,6 +13481,14 @@ jest-message-util@^27.0.0-next.7: slash "^3.0.0" stack-utils "^2.0.3" +jest-mock@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.6.2.tgz#d6cb712b041ed47fe0d9b6fc3474bc6543feb302" + integrity sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + jest-mock@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.0-next.7.tgz#097a14cac728cd415fe924bcf6450630869f8f00" @@ -13070,6 +13512,15 @@ jest-regex-util@^27.0.0-next.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.0-next.0.tgz#559ff0c5388000d3b82dacc6adca682af9f9dabb" integrity sha512-9f6JHFuKOGaTaBWAfneX6k/20o9t2O0JTwOCn/2qlBUZRbQt1sqd2U3qme7t85n8qZVdd/LRteUyZ6lnbWDNvg== +jest-resolve-dependencies@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz#6680859ee5d22ee5dcd961fe4871f59f4c784fb6" + integrity sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg== + dependencies: + "@jest/types" "^26.6.2" + jest-regex-util "^26.0.0" + jest-snapshot "^26.6.2" + jest-resolve-dependencies@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.0-next.7.tgz#8e4644341a50da9aa585116be64676012636da1d" @@ -13079,6 +13530,20 @@ jest-resolve-dependencies@^27.0.0-next.7: jest-regex-util "^27.0.0-next.0" jest-snapshot "^27.0.0-next.7" +jest-resolve@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" + integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^26.6.2" + read-pkg-up "^7.0.1" + resolve "^1.18.1" + slash "^3.0.0" + jest-resolve@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.0-next.7.tgz#59404cd9bf969d61a6acca835ba13deaa918907c" @@ -13093,6 +13558,32 @@ jest-resolve@^27.0.0-next.7: resolve "^1.20.0" slash "^3.0.0" +jest-runner@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.6.3.tgz#2d1fed3d46e10f233fd1dbd3bfaa3fe8924be159" + integrity sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ== + dependencies: + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.7.1" + exit "^0.1.2" + graceful-fs "^4.2.4" + jest-config "^26.6.3" + jest-docblock "^26.0.0" + jest-haste-map "^26.6.2" + jest-leak-detector "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + jest-runtime "^26.6.3" + jest-util "^26.6.2" + jest-worker "^26.6.2" + source-map-support "^0.5.6" + throat "^5.0.0" + jest-runner@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.0-next.7.tgz#2f2551ec52490f45b51c1612f12521ea47b1f133" @@ -13120,6 +13611,39 @@ jest-runner@^27.0.0-next.7: source-map-support "^0.5.6" throat "^6.0.1" +jest-runtime@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.6.3.tgz#4f64efbcfac398331b74b4b3c82d27d401b8fa2b" + integrity sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw== + dependencies: + "@jest/console" "^26.6.2" + "@jest/environment" "^26.6.2" + "@jest/fake-timers" "^26.6.2" + "@jest/globals" "^26.6.2" + "@jest/source-map" "^26.6.2" + "@jest/test-result" "^26.6.2" + "@jest/transform" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + cjs-module-lexer "^0.6.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.4" + jest-config "^26.6.3" + jest-haste-map "^26.6.2" + jest-message-util "^26.6.2" + jest-mock "^26.6.2" + jest-regex-util "^26.0.0" + jest-resolve "^26.6.2" + jest-snapshot "^26.6.2" + jest-util "^26.6.2" + jest-validate "^26.6.2" + slash "^3.0.0" + strip-bom "^4.0.0" + yargs "^15.4.1" + jest-runtime@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.0-next.7.tgz#b83e448d65366988985f04cbf5e96d470bca4256" @@ -13152,6 +13676,14 @@ jest-runtime@^27.0.0-next.7: strip-bom "^4.0.0" yargs "^16.0.3" +jest-serializer@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" + integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + jest-serializer@^27.0.0-next.0: version "27.0.0-next.0" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.0.0-next.0.tgz#204b6875cd6940349aa3c88a0016a71ecf881b3e" @@ -13160,6 +13692,28 @@ jest-serializer@^27.0.0-next.0: "@types/node" "*" graceful-fs "^4.2.4" +jest-snapshot@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" + integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^26.6.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.6.2" + graceful-fs "^4.2.4" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + jest-haste-map "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + natural-compare "^1.4.0" + pretty-format "^26.6.2" + semver "^7.3.2" + jest-snapshot@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.0-next.7.tgz#8fb8ae04940c1246c90f3e5e5b57262071b903ad" @@ -13199,7 +13753,7 @@ jest-util@27.0.0-next.6: is-ci "^3.0.0" micromatch "^4.0.2" -jest-util@^26.6.2: +jest-util@^26.1.0, jest-util@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== @@ -13223,6 +13777,18 @@ jest-util@^27.0.0-next.3, jest-util@^27.0.0-next.7: is-ci "^3.0.0" micromatch "^4.0.2" +jest-validate@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.6.2.tgz#23d380971587150467342911c3d7b4ac57ab20ec" + integrity sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ== + dependencies: + "@jest/types" "^26.6.2" + camelcase "^6.0.0" + chalk "^4.0.0" + jest-get-type "^26.3.0" + leven "^3.1.0" + pretty-format "^26.6.2" + jest-validate@^27.0.0-next.5, jest-validate@^27.0.0-next.7: version "27.0.0-next.7" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.0-next.7.tgz#411c0569f848f5f79b5fab8cc6a424b2e53c7f45" @@ -13248,7 +13814,7 @@ jest-watch-typeahead@^0.6.1: string-length "^4.0.1" strip-ansi "^6.0.0" -jest-watcher@^26.3.0: +jest-watcher@^26.3.0, jest-watcher@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.6.2.tgz#a5b683b8f9d68dbcb1d7dae32172d2cca0592975" integrity sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ== @@ -13283,7 +13849,7 @@ jest-worker@27.0.0-next.5: merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^26.3.0: +jest-worker@^26.3.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -13301,7 +13867,7 @@ jest-worker@^27.0.0-next.7: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@27.0.0-next.5, jest@^26.6.3: +jest@27.0.0-next.5: version "27.0.0-next.5" resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.0-next.5.tgz#a9f75dffe545057079c8e685e736785d47240484" integrity sha512-fMHSRq7xYwZmdNr5YP2icy6Txn9wJBhGLNIeHsGxkokeuIj30tnpU2EyRb4Cq6l8+VD2c2Vt4YdhT3ephyX8Kw== @@ -13310,6 +13876,15 @@ jest@27.0.0-next.5, jest@^26.6.3: import-local "^3.0.2" jest-cli "^27.0.0-next.5" +jest@^26.6.3: + version "26.6.3" + resolved "https://registry.yarnpkg.com/jest/-/jest-26.6.3.tgz#40e8fdbe48f00dfa1f0ce8121ca74b88ac9148ef" + integrity sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q== + dependencies: + "@jest/core" "^26.6.3" + import-local "^3.0.2" + jest-cli "^26.6.3" + joi@^17.3.0: version "17.3.0" resolved "https://registry.yarnpkg.com/joi/-/joi-17.3.0.tgz#f1be4a6ce29bc1716665819ac361dfa139fff5d2" @@ -14922,7 +15497,7 @@ minimist-options@4.1.0, minimist-options@^4.0.2: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@1.2.5, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5: +minimist@1.2.5, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== @@ -15448,6 +16023,18 @@ node-notifier@5.4.0: shellwords "^0.1.1" which "^1.3.0" +node-notifier@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" + integrity sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg== + dependencies: + growly "^1.3.0" + is-wsl "^2.2.0" + semver "^7.3.2" + shellwords "^0.1.1" + uuid "^8.3.0" + which "^2.0.2" + node-pre-gyp@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz#db1f33215272f692cd38f03238e3e9b47c5dd054" @@ -15464,6 +16051,11 @@ node-pre-gyp@^0.11.0: semver "^5.3.0" tar "^4" +node-releases@^1.1.65: + version "1.1.71" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" + integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== + node-releases@^1.1.69: version "1.1.70" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.70.tgz#66e0ed0273aa65666d7fe78febe7634875426a08" @@ -19380,6 +19972,11 @@ rollup@^2.32.0: optionalDependencies: fsevents "~2.3.1" +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + run-async@^2.2.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -19457,6 +20054,21 @@ samsam@~1.1: resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621" integrity sha1-n1CHQZtNCR8jJXHn+lLpCw9VJiE= +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + sass-graph@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.5.tgz#a981c87446b8319d96dce0671e487879bd24c2e8" @@ -21079,6 +21691,11 @@ thread-loader@2.1.3: loader-utils "^1.1.0" neo-async "^2.6.0" +throat@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" + integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== + throat@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" @@ -21388,7 +22005,24 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== -ts-jest@26.5.0, ts-jest@27.0.0-next.10: +ts-jest@26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.0.tgz#3e3417d91bc40178a6716d7dacc5b0505835aa21" + integrity sha512-Ya4IQgvIFNa2Mgq52KaO8yBw2W8tWp61Ecl66VjF0f5JaV8u50nGoptHVILOPGoI7SDnShmEqnYQEmyHdQ+56g== + dependencies: + "@types/jest" "26.x" + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + jest-util "^26.1.0" + json5 "2.x" + lodash "4.x" + make-error "1.x" + mkdirp "1.x" + semver "7.x" + yargs-parser "20.x" + +ts-jest@27.0.0-next.10: version "27.0.0-next.10" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.0.0-next.10.tgz#23a848388c0c4765d8a736ff4020eb2ebec9af4c" integrity sha512-fC1NSewNCnJQM7xz4TxG9PKRSXIajkc5ZaML6I75ig3vwHxZs4UC84qLAm4IBxelWSCKYTIQobOioT3fcXj1jQ== @@ -22092,7 +22726,7 @@ utils-merge@1.0.1, utils-merge@1.x.x: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@8.3.2, uuid@^8.3.1: +uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.1: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -22295,7 +22929,7 @@ wait-port@0.2.2: commander "^2.9.0" debug "^2.6.6" -walker@^1.0.7: +walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= @@ -22831,7 +23465,7 @@ yargs-parser@^15.0.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.3: +yargs-parser@^18.1.2, yargs-parser@^18.1.3: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -22872,6 +23506,23 @@ yargs@^14.0.0: y18n "^4.0.0" yargs-parser "^15.0.1" +yargs@^15.4.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + yargs@^16.0.3, yargs@^16.1.1, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" From 48f41f7a8c45bf54b6f1796c39759b85390b86ef Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 4 May 2021 11:43:38 +0200 Subject: [PATCH 5/7] Exclude "dehydratedState" --- packages/babel-preset/src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/babel-preset/src/index.ts b/packages/babel-preset/src/index.ts index a8a89f54cf..30e575934e 100644 --- a/packages/babel-preset/src/index.ts +++ b/packages/babel-preset/src/index.ts @@ -9,7 +9,13 @@ export default function preset(_api: any, options = {}) { const config = { presets: [[require('next/babel'), options]], - plugins: [require('babel-plugin-superjson-next'), AddBlitzAppRoot], + plugins: [ + [ + require('babel-plugin-superjson-next'), + { exclude: ['dehydratedState'] }, + ], + AddBlitzAppRoot, + ], }; if (!isRunningInJest) { From e8d43a5f72802aa6cb322d25df0d55f7b16b114c Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Sat, 8 May 2021 08:53:22 +0200 Subject: [PATCH 6/7] Revert changes to nextjs --- nextjs/lerna.json | 9 +- .../babel/plugins/react-loadable-plugin.ts | 4 +- nextjs/packages/next/build/webpack-config.ts | 157 ++-- .../packages/HotModuleReplacement.runtime.js | 750 +++++++-------- .../JavascriptHotModuleReplacement.runtime.js | 865 +++++++++--------- nextjs/packages/next/client/index.tsx | 6 +- nextjs/packages/next/client/route-loader.ts | 18 +- .../packages/next/lib/regexr/profile/core.js | 2 +- .../next/next-server/lib/router/router.ts | 2 +- nextjs/packages/next/package.json | 2 +- .../integration/production/test/index.test.js | 13 +- 11 files changed, 917 insertions(+), 911 deletions(-) diff --git a/nextjs/lerna.json b/nextjs/lerna.json index b4c122fedb..7c40204371 100644 --- a/nextjs/lerna.json +++ b/nextjs/lerna.json @@ -1,14 +1,19 @@ { "npmClient": "yarn", "useWorkspaces": true, - "packages": ["packages/*"], + "packages": [ + "packages/*" + ], "command": { "version": { "exact": true }, "publish": { "npmClient": "npm", - "allowBranch": ["master", "canary"], + "allowBranch": [ + "master", + "canary" + ], "registry": "https://registry.npmjs.org/" } }, diff --git a/nextjs/packages/next/build/babel/plugins/react-loadable-plugin.ts b/nextjs/packages/next/build/babel/plugins/react-loadable-plugin.ts index 805676d20e..f020d7d030 100644 --- a/nextjs/packages/next/build/babel/plugins/react-loadable-plugin.ts +++ b/nextjs/packages/next/build/babel/plugins/react-loadable-plugin.ts @@ -76,7 +76,9 @@ export default function ({ if (!callExpression.isCallExpression()) return - const callExpression_ = callExpression as NodePath + const callExpression_ = callExpression as NodePath< + BabelTypes.CallExpression + > let args = callExpression_.get('arguments') if (args.length > 2) { diff --git a/nextjs/packages/next/build/webpack-config.ts b/nextjs/packages/next/build/webpack-config.ts index c9e37d85b1..e7bc6042d1 100644 --- a/nextjs/packages/next/build/webpack-config.ts +++ b/nextjs/packages/next/build/webpack-config.ts @@ -1511,94 +1511,93 @@ export default async function getBaseWebpackConfig( // Patch `@zeit/next-sass`, `@zeit/next-less`, `@zeit/next-stylus` for compatibility if (webpackConfig.module && Array.isArray(webpackConfig.module.rules)) { - ;[].forEach.call( - webpackConfig.module.rules, - function (rule: webpack.RuleSetRule) { - if (!(rule.test instanceof RegExp && Array.isArray(rule.use))) { - return - } + ;[].forEach.call(webpackConfig.module.rules, function ( + rule: webpack.RuleSetRule + ) { + if (!(rule.test instanceof RegExp && Array.isArray(rule.use))) { + return + } - const isSass = - rule.test.source === '\\.scss$' || rule.test.source === '\\.sass$' - const isLess = rule.test.source === '\\.less$' - const isCss = rule.test.source === '\\.css$' - const isStylus = rule.test.source === '\\.styl$' + const isSass = + rule.test.source === '\\.scss$' || rule.test.source === '\\.sass$' + const isLess = rule.test.source === '\\.less$' + const isCss = rule.test.source === '\\.css$' + const isStylus = rule.test.source === '\\.styl$' - // Check if the rule we're iterating over applies to Sass, Less, or CSS - if (!(isSass || isLess || isCss || isStylus)) { + // Check if the rule we're iterating over applies to Sass, Less, or CSS + if (!(isSass || isLess || isCss || isStylus)) { + return + } + + ;[].forEach.call(rule.use, function (use: webpack.RuleSetUseItem) { + if ( + !( + use && + typeof use === 'object' && + // Identify use statements only pertaining to `css-loader` + (use.loader === 'css-loader' || + use.loader === 'css-loader/locals') && + use.options && + typeof use.options === 'object' && + // The `minimize` property is a good heuristic that we need to + // perform this hack. The `minimize` property was only valid on + // old `css-loader` versions. Custom setups (that aren't next-sass, + // next-less or next-stylus) likely have the newer version. + // We still handle this gracefully below. + (Object.prototype.hasOwnProperty.call(use.options, 'minimize') || + Object.prototype.hasOwnProperty.call( + use.options, + 'exportOnlyLocals' + )) + ) + ) { return } - ;[].forEach.call(rule.use, function (use: webpack.RuleSetUseItem) { - if ( - !( - use && - typeof use === 'object' && - // Identify use statements only pertaining to `css-loader` - (use.loader === 'css-loader' || - use.loader === 'css-loader/locals') && - use.options && - typeof use.options === 'object' && - // The `minimize` property is a good heuristic that we need to - // perform this hack. The `minimize` property was only valid on - // old `css-loader` versions. Custom setups (that aren't next-sass, - // next-less or next-stylus) likely have the newer version. - // We still handle this gracefully below. - (Object.prototype.hasOwnProperty.call(use.options, 'minimize') || - Object.prototype.hasOwnProperty.call( - use.options, - 'exportOnlyLocals' - )) - ) - ) { - return - } + // Try to monkey patch within a try-catch. We shouldn't fail the build + // if we cannot pull this off. + // The user may not even be using the `next-sass` or `next-less` or + // `next-stylus` plugins. + // If it does work, great! + try { + // Resolve the version of `@zeit/next-css` as depended on by the Sass, + // Less or Stylus plugin. + const correctNextCss = require.resolve('@zeit/next-css', { + paths: [ + isCss + ? // Resolve `@zeit/next-css` from the base directory + dir + : // Else, resolve it from the specific plugins + require.resolve( + isSass + ? '@zeit/next-sass' + : isLess + ? '@zeit/next-less' + : isStylus + ? '@zeit/next-stylus' + : 'next' + ), + ], + }) - // Try to monkey patch within a try-catch. We shouldn't fail the build - // if we cannot pull this off. - // The user may not even be using the `next-sass` or `next-less` or - // `next-stylus` plugins. - // If it does work, great! - try { - // Resolve the version of `@zeit/next-css` as depended on by the Sass, - // Less or Stylus plugin. - const correctNextCss = require.resolve('@zeit/next-css', { - paths: [ - isCss - ? // Resolve `@zeit/next-css` from the base directory - dir - : // Else, resolve it from the specific plugins - require.resolve( - isSass - ? '@zeit/next-sass' - : isLess - ? '@zeit/next-less' - : isStylus - ? '@zeit/next-stylus' - : 'next' - ), - ], + // If we found `@zeit/next-css` ... + if (correctNextCss) { + // ... resolve the version of `css-loader` shipped with that + // package instead of whichever was hoisted highest in your + // `node_modules` tree. + const correctCssLoader = require.resolve(use.loader, { + paths: [correctNextCss], }) - - // If we found `@zeit/next-css` ... - if (correctNextCss) { - // ... resolve the version of `css-loader` shipped with that - // package instead of whichever was hoisted highest in your - // `node_modules` tree. - const correctCssLoader = require.resolve(use.loader, { - paths: [correctNextCss], - }) - if (correctCssLoader) { - // We saved the user from a failed build! - use.loader = correctCssLoader - } + if (correctCssLoader) { + // We saved the user from a failed build! + use.loader = correctCssLoader } - } catch (_) { - // The error is not required to be handled. } - }) - } - ) + } catch (_) { + // The error is not required to be handled. + } + }) + }) } // Backwards compat for `main.js` entry key diff --git a/nextjs/packages/next/bundles/webpack/packages/HotModuleReplacement.runtime.js b/nextjs/packages/next/bundles/webpack/packages/HotModuleReplacement.runtime.js index 9e169d26b9..d3e8a0a612 100644 --- a/nextjs/packages/next/bundles/webpack/packages/HotModuleReplacement.runtime.js +++ b/nextjs/packages/next/bundles/webpack/packages/HotModuleReplacement.runtime.js @@ -3,382 +3,382 @@ Author Tobias Koppers @sokra */ -'use strict' +"use strict"; -var $interceptModuleExecution$ = undefined -var $moduleCache$ = undefined +var $interceptModuleExecution$ = undefined; +var $moduleCache$ = undefined; // eslint-disable-next-line no-unused-vars -var $hmrModuleData$ = undefined -var $hmrDownloadManifest$ = undefined -var $hmrDownloadUpdateHandlers$ = undefined -var $hmrInvalidateModuleHandlers$ = undefined -var __webpack_require__ = undefined +var $hmrModuleData$ = undefined; +var $hmrDownloadManifest$ = undefined; +var $hmrDownloadUpdateHandlers$ = undefined; +var $hmrInvalidateModuleHandlers$ = undefined; +var __webpack_require__ = undefined; module.exports = function () { - var currentModuleData = {} - var installedModules = $moduleCache$ - - // module and require creation - var currentChildModule - var currentParents = [] - - // status - var registeredStatusHandlers = [] - var currentStatus = 'idle' - - // while downloading - var blockingPromises - - // The update info - var currentUpdateApplyHandlers - var queuedInvalidatedModules - - // eslint-disable-next-line no-unused-vars - $hmrModuleData$ = currentModuleData - - $interceptModuleExecution$.push(function (options) { - var module = options.module - var require = createRequire(options.require, options.id) - module.hot = createModuleHotObject(options.id, module) - module.parents = currentParents - module.children = [] - currentParents = [] - options.require = require - }) - - $hmrDownloadUpdateHandlers$ = {} - $hmrInvalidateModuleHandlers$ = {} - - function createRequire(require, moduleId) { - var me = installedModules[moduleId] - if (!me) return require - var fn = function (request) { - if (me.hot.active) { - if (installedModules[request]) { - var parents = installedModules[request].parents - if (parents.indexOf(moduleId) === -1) { - parents.push(moduleId) - } - } else { - currentParents = [moduleId] - currentChildModule = request - } - if (me.children.indexOf(request) === -1) { - me.children.push(request) - } - } else { - console.warn( - '[HMR] unexpected require(' + - request + - ') from disposed module ' + - moduleId - ) - currentParents = [] - } - return require(request) - } - var createPropertyDescriptor = function (name) { - return { - configurable: true, - enumerable: true, - get: function () { - return require[name] - }, - set: function (value) { - require[name] = value - }, - } - } - for (var name in require) { - if (Object.prototype.hasOwnProperty.call(require, name) && name !== 'e') { - Object.defineProperty(fn, name, createPropertyDescriptor(name)) - } - } - fn.e = function (chunkId) { - return trackBlockingPromise(require.e(chunkId)) - } - return fn - } - - function createModuleHotObject(moduleId, me) { - var _main = currentChildModule !== moduleId - var hot = { - // private stuff - _acceptedDependencies: {}, - _acceptedErrorHandlers: {}, - _declinedDependencies: {}, - _selfAccepted: false, - _selfDeclined: false, - _selfInvalidated: false, - _disposeHandlers: [], - _main: _main, - _requireSelf: function () { - currentParents = me.parents.slice() - currentChildModule = _main ? undefined : moduleId - __webpack_require__(moduleId) - }, - - // Module API - active: true, - accept: function (dep, callback, errorHandler) { - if (dep === undefined) hot._selfAccepted = true - else if (typeof dep === 'function') hot._selfAccepted = dep - else if (typeof dep === 'object' && dep !== null) { - for (var i = 0; i < dep.length; i++) { - hot._acceptedDependencies[dep[i]] = callback || function () {} - hot._acceptedErrorHandlers[dep[i]] = errorHandler - } - } else { - hot._acceptedDependencies[dep] = callback || function () {} - hot._acceptedErrorHandlers[dep] = errorHandler - } - }, - decline: function (dep) { - if (dep === undefined) hot._selfDeclined = true - else if (typeof dep === 'object' && dep !== null) - for (var i = 0; i < dep.length; i++) - hot._declinedDependencies[dep[i]] = true - else hot._declinedDependencies[dep] = true - }, - dispose: function (callback) { - hot._disposeHandlers.push(callback) - }, - addDisposeHandler: function (callback) { - hot._disposeHandlers.push(callback) - }, - removeDisposeHandler: function (callback) { - var idx = hot._disposeHandlers.indexOf(callback) - if (idx >= 0) hot._disposeHandlers.splice(idx, 1) - }, - invalidate: function () { - this._selfInvalidated = true - switch (currentStatus) { - case 'idle': - currentUpdateApplyHandlers = [] - Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { - $hmrInvalidateModuleHandlers$[key]( - moduleId, - currentUpdateApplyHandlers - ) - }) - setStatus('ready') - break - case 'ready': - Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { - $hmrInvalidateModuleHandlers$[key]( - moduleId, - currentUpdateApplyHandlers - ) - }) - break - case 'prepare': - case 'check': - case 'dispose': - case 'apply': - ;(queuedInvalidatedModules = queuedInvalidatedModules || []).push( - moduleId - ) - break - default: - // ignore requests in error states - break - } - }, - - // Management API - check: hotCheck, - apply: hotApply, - status: function (l) { - if (!l) return currentStatus - registeredStatusHandlers.push(l) - }, - addStatusHandler: function (l) { - registeredStatusHandlers.push(l) - }, - removeStatusHandler: function (l) { - var idx = registeredStatusHandlers.indexOf(l) - if (idx >= 0) registeredStatusHandlers.splice(idx, 1) - }, - - //inherit from previous dispose call - data: currentModuleData[moduleId], - } - currentChildModule = undefined - return hot - } - - function setStatus(newStatus) { - currentStatus = newStatus - for (var i = 0; i < registeredStatusHandlers.length; i++) - registeredStatusHandlers[i].call(null, newStatus) - } - - function trackBlockingPromise(promise) { - switch (currentStatus) { - case 'ready': - setStatus('prepare') - blockingPromises.push(promise) - waitForBlockingPromises(function () { - setStatus('ready') - }) - return promise - case 'prepare': - blockingPromises.push(promise) - return promise - default: - return promise - } - } - - function waitForBlockingPromises(fn) { - if (blockingPromises.length === 0) return fn() - var blocker = blockingPromises - blockingPromises = [] - return Promise.all(blocker).then(function () { - return waitForBlockingPromises(fn) - }) - } - - function hotCheck(applyOnUpdate) { - if (currentStatus !== 'idle') { - throw new Error('check() is only allowed in idle status') - } - setStatus('check') - return $hmrDownloadManifest$().then(function (update) { - if (!update) { - setStatus(applyInvalidatedModules() ? 'ready' : 'idle') - return null - } - - setStatus('prepare') - - var updatedModules = [] - blockingPromises = [] - currentUpdateApplyHandlers = [] - - return Promise.all( - Object.keys($hmrDownloadUpdateHandlers$).reduce(function ( - promises, - key - ) { - $hmrDownloadUpdateHandlers$[key]( - update.c, - update.r, - update.m, - promises, - currentUpdateApplyHandlers, - updatedModules - ) - return promises - }, - []) - ).then(function () { - return waitForBlockingPromises(function () { - if (applyOnUpdate) { - return internalApply(applyOnUpdate) - } else { - setStatus('ready') - - return updatedModules - } - }) - }) - }) - } - - function hotApply(options) { - if (currentStatus !== 'ready') { - return Promise.resolve().then(function () { - throw new Error('apply() is only allowed in ready status') - }) - } - return internalApply(options) - } - - function internalApply(options) { - options = options || {} - - applyInvalidatedModules() - - var results = currentUpdateApplyHandlers.map(function (handler) { - return handler(options) - }) - currentUpdateApplyHandlers = undefined - - var errors = results - .map(function (r) { - return r.error - }) - .filter(Boolean) - - if (errors.length > 0) { - setStatus('abort') - return Promise.resolve().then(function () { - throw errors[0] - }) - } - - // Now in "dispose" phase - setStatus('dispose') - - results.forEach(function (result) { - if (result.dispose) result.dispose() - }) - - // Now in "apply" phase - setStatus('apply') - - var error - var reportError = function (err) { - if (!error) error = err - } - - var outdatedModules = [] - results.forEach(function (result) { - if (result.apply) { - var modules = result.apply(reportError) - if (modules) { - for (var i = 0; i < modules.length; i++) { - outdatedModules.push(modules[i]) - } - } - } - }) - - // handle errors in accept handlers and self accepted module load - if (error) { - setStatus('fail') - return Promise.resolve().then(function () { - throw error - }) - } - - if (queuedInvalidatedModules) { - return internalApply(options).then(function (list) { - outdatedModules.forEach(function (moduleId) { - if (list.indexOf(moduleId) < 0) list.push(moduleId) - }) - return list - }) - } - - setStatus('idle') - return Promise.resolve(outdatedModules) - } - - function applyInvalidatedModules() { - if (queuedInvalidatedModules) { - if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = [] - Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { - queuedInvalidatedModules.forEach(function (moduleId) { - $hmrInvalidateModuleHandlers$[key]( - moduleId, - currentUpdateApplyHandlers - ) - }) - }) - queuedInvalidatedModules = undefined - return true - } - } -} + var currentModuleData = {}; + var installedModules = $moduleCache$; + + // module and require creation + var currentChildModule; + var currentParents = []; + + // status + var registeredStatusHandlers = []; + var currentStatus = "idle"; + + // while downloading + var blockingPromises; + + // The update info + var currentUpdateApplyHandlers; + var queuedInvalidatedModules; + + // eslint-disable-next-line no-unused-vars + $hmrModuleData$ = currentModuleData; + + $interceptModuleExecution$.push(function (options) { + var module = options.module; + var require = createRequire(options.require, options.id); + module.hot = createModuleHotObject(options.id, module); + module.parents = currentParents; + module.children = []; + currentParents = []; + options.require = require; + }); + + $hmrDownloadUpdateHandlers$ = {}; + $hmrInvalidateModuleHandlers$ = {}; + + function createRequire(require, moduleId) { + var me = installedModules[moduleId]; + if (!me) return require; + var fn = function (request) { + if (me.hot.active) { + if (installedModules[request]) { + var parents = installedModules[request].parents; + if (parents.indexOf(moduleId) === -1) { + parents.push(moduleId); + } + } else { + currentParents = [moduleId]; + currentChildModule = request; + } + if (me.children.indexOf(request) === -1) { + me.children.push(request); + } + } else { + console.warn( + "[HMR] unexpected require(" + + request + + ") from disposed module " + + moduleId + ); + currentParents = []; + } + return require(request); + }; + var createPropertyDescriptor = function (name) { + return { + configurable: true, + enumerable: true, + get: function () { + return require[name]; + }, + set: function (value) { + require[name] = value; + } + }; + }; + for (var name in require) { + if (Object.prototype.hasOwnProperty.call(require, name) && name !== "e") { + Object.defineProperty(fn, name, createPropertyDescriptor(name)); + } + } + fn.e = function (chunkId) { + return trackBlockingPromise(require.e(chunkId)); + }; + return fn; + } + + function createModuleHotObject(moduleId, me) { + var _main = currentChildModule !== moduleId; + var hot = { + // private stuff + _acceptedDependencies: {}, + _acceptedErrorHandlers: {}, + _declinedDependencies: {}, + _selfAccepted: false, + _selfDeclined: false, + _selfInvalidated: false, + _disposeHandlers: [], + _main: _main, + _requireSelf: function () { + currentParents = me.parents.slice(); + currentChildModule = _main ? undefined : moduleId; + __webpack_require__(moduleId); + }, + + // Module API + active: true, + accept: function (dep, callback, errorHandler) { + if (dep === undefined) hot._selfAccepted = true; + else if (typeof dep === "function") hot._selfAccepted = dep; + else if (typeof dep === "object" && dep !== null) { + for (var i = 0; i < dep.length; i++) { + hot._acceptedDependencies[dep[i]] = callback || function () {}; + hot._acceptedErrorHandlers[dep[i]] = errorHandler; + } + } else { + hot._acceptedDependencies[dep] = callback || function () {}; + hot._acceptedErrorHandlers[dep] = errorHandler; + } + }, + decline: function (dep) { + if (dep === undefined) hot._selfDeclined = true; + else if (typeof dep === "object" && dep !== null) + for (var i = 0; i < dep.length; i++) + hot._declinedDependencies[dep[i]] = true; + else hot._declinedDependencies[dep] = true; + }, + dispose: function (callback) { + hot._disposeHandlers.push(callback); + }, + addDisposeHandler: function (callback) { + hot._disposeHandlers.push(callback); + }, + removeDisposeHandler: function (callback) { + var idx = hot._disposeHandlers.indexOf(callback); + if (idx >= 0) hot._disposeHandlers.splice(idx, 1); + }, + invalidate: function () { + this._selfInvalidated = true; + switch (currentStatus) { + case "idle": + currentUpdateApplyHandlers = []; + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + setStatus("ready"); + break; + case "ready": + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + break; + case "prepare": + case "check": + case "dispose": + case "apply": + (queuedInvalidatedModules = queuedInvalidatedModules || []).push( + moduleId + ); + break; + default: + // ignore requests in error states + break; + } + }, + + // Management API + check: hotCheck, + apply: hotApply, + status: function (l) { + if (!l) return currentStatus; + registeredStatusHandlers.push(l); + }, + addStatusHandler: function (l) { + registeredStatusHandlers.push(l); + }, + removeStatusHandler: function (l) { + var idx = registeredStatusHandlers.indexOf(l); + if (idx >= 0) registeredStatusHandlers.splice(idx, 1); + }, + + //inherit from previous dispose call + data: currentModuleData[moduleId] + }; + currentChildModule = undefined; + return hot; + } + + function setStatus(newStatus) { + currentStatus = newStatus; + for (var i = 0; i < registeredStatusHandlers.length; i++) + registeredStatusHandlers[i].call(null, newStatus); + } + + function trackBlockingPromise(promise) { + switch (currentStatus) { + case "ready": + setStatus("prepare"); + blockingPromises.push(promise); + waitForBlockingPromises(function () { + setStatus("ready"); + }); + return promise; + case "prepare": + blockingPromises.push(promise); + return promise; + default: + return promise; + } + } + + function waitForBlockingPromises(fn) { + if (blockingPromises.length === 0) return fn(); + var blocker = blockingPromises; + blockingPromises = []; + return Promise.all(blocker).then(function () { + return waitForBlockingPromises(fn); + }); + } + + function hotCheck(applyOnUpdate) { + if (currentStatus !== "idle") { + throw new Error("check() is only allowed in idle status"); + } + setStatus("check"); + return $hmrDownloadManifest$().then(function (update) { + if (!update) { + setStatus(applyInvalidatedModules() ? "ready" : "idle"); + return null; + } + + setStatus("prepare"); + + var updatedModules = []; + blockingPromises = []; + currentUpdateApplyHandlers = []; + + return Promise.all( + Object.keys($hmrDownloadUpdateHandlers$).reduce(function ( + promises, + key + ) { + $hmrDownloadUpdateHandlers$[key]( + update.c, + update.r, + update.m, + promises, + currentUpdateApplyHandlers, + updatedModules + ); + return promises; + }, + []) + ).then(function () { + return waitForBlockingPromises(function () { + if (applyOnUpdate) { + return internalApply(applyOnUpdate); + } else { + setStatus("ready"); + + return updatedModules; + } + }); + }); + }); + } + + function hotApply(options) { + if (currentStatus !== "ready") { + return Promise.resolve().then(function () { + throw new Error("apply() is only allowed in ready status"); + }); + } + return internalApply(options); + } + + function internalApply(options) { + options = options || {}; + + applyInvalidatedModules(); + + var results = currentUpdateApplyHandlers.map(function (handler) { + return handler(options); + }); + currentUpdateApplyHandlers = undefined; + + var errors = results + .map(function (r) { + return r.error; + }) + .filter(Boolean); + + if (errors.length > 0) { + setStatus("abort"); + return Promise.resolve().then(function () { + throw errors[0]; + }); + } + + // Now in "dispose" phase + setStatus("dispose"); + + results.forEach(function (result) { + if (result.dispose) result.dispose(); + }); + + // Now in "apply" phase + setStatus("apply"); + + var error; + var reportError = function (err) { + if (!error) error = err; + }; + + var outdatedModules = []; + results.forEach(function (result) { + if (result.apply) { + var modules = result.apply(reportError); + if (modules) { + for (var i = 0; i < modules.length; i++) { + outdatedModules.push(modules[i]); + } + } + } + }); + + // handle errors in accept handlers and self accepted module load + if (error) { + setStatus("fail"); + return Promise.resolve().then(function () { + throw error; + }); + } + + if (queuedInvalidatedModules) { + return internalApply(options).then(function (list) { + outdatedModules.forEach(function (moduleId) { + if (list.indexOf(moduleId) < 0) list.push(moduleId); + }); + return list; + }); + } + + setStatus("idle"); + return Promise.resolve(outdatedModules); + } + + function applyInvalidatedModules() { + if (queuedInvalidatedModules) { + if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = []; + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + queuedInvalidatedModules.forEach(function (moduleId) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + }); + queuedInvalidatedModules = undefined; + return true; + } + } +}; diff --git a/nextjs/packages/next/bundles/webpack/packages/JavascriptHotModuleReplacement.runtime.js b/nextjs/packages/next/bundles/webpack/packages/JavascriptHotModuleReplacement.runtime.js index b18352b69e..d03e939487 100644 --- a/nextjs/packages/next/bundles/webpack/packages/JavascriptHotModuleReplacement.runtime.js +++ b/nextjs/packages/next/bundles/webpack/packages/JavascriptHotModuleReplacement.runtime.js @@ -3,459 +3,460 @@ Author Tobias Koppers @sokra */ -'use strict' +"use strict"; -var $installedChunks$ = undefined -var $loadUpdateChunk$ = undefined -var $moduleCache$ = undefined -var $moduleFactories$ = undefined -var $ensureChunkHandlers$ = undefined -var $hasOwnProperty$ = undefined -var $hmrModuleData$ = undefined -var $hmrDownloadUpdateHandlers$ = undefined -var $hmrInvalidateModuleHandlers$ = undefined -var __webpack_require__ = undefined +var $installedChunks$ = undefined; +var $loadUpdateChunk$ = undefined; +var $moduleCache$ = undefined; +var $moduleFactories$ = undefined; +var $ensureChunkHandlers$ = undefined; +var $hasOwnProperty$ = undefined; +var $hmrModuleData$ = undefined; +var $hmrDownloadUpdateHandlers$ = undefined; +var $hmrInvalidateModuleHandlers$ = undefined; +var __webpack_require__ = undefined; module.exports = function () { - var currentUpdateChunks - var currentUpdate - var currentUpdateRemovedChunks - var currentUpdateRuntime - function applyHandler(options) { - if ($ensureChunkHandlers$) delete $ensureChunkHandlers$.$key$Hmr - currentUpdateChunks = undefined - function getAffectedModuleEffects(updateModuleId) { - var outdatedModules = [updateModuleId] - var outdatedDependencies = {} + var currentUpdateChunks; + var currentUpdate; + var currentUpdateRemovedChunks; + var currentUpdateRuntime; + function applyHandler(options) { + if ($ensureChunkHandlers$) delete $ensureChunkHandlers$.$key$Hmr; + currentUpdateChunks = undefined; + function getAffectedModuleEffects(updateModuleId) { + var outdatedModules = [updateModuleId]; + var outdatedDependencies = {}; - var queue = outdatedModules.map(function (id) { - return { - chain: [id], - id: id, - } - }) - while (queue.length > 0) { - var queueItem = queue.pop() - var moduleId = queueItem.id - var chain = queueItem.chain - var module = $moduleCache$[moduleId] - if ( - !module || - (module.hot._selfAccepted && !module.hot._selfInvalidated) - ) - continue - if (module.hot._selfDeclined) { - return { - type: 'self-declined', - chain: chain, - moduleId: moduleId, - } - } - if (module.hot._main) { - return { - type: 'unaccepted', - chain: chain, - moduleId: moduleId, - } - } - for (var i = 0; i < module.parents.length; i++) { - var parentId = module.parents[i] - var parent = $moduleCache$[parentId] - if (!parent) continue - if (parent.hot._declinedDependencies[moduleId]) { - return { - type: 'declined', - chain: chain.concat([parentId]), - moduleId: moduleId, - parentId: parentId, - } - } - if (outdatedModules.indexOf(parentId) !== -1) continue - if (parent.hot._acceptedDependencies[moduleId]) { - if (!outdatedDependencies[parentId]) - outdatedDependencies[parentId] = [] - addAllToSet(outdatedDependencies[parentId], [moduleId]) - continue - } - delete outdatedDependencies[parentId] - outdatedModules.push(parentId) - queue.push({ - chain: chain.concat([parentId]), - id: parentId, - }) - } - } + var queue = outdatedModules.map(function (id) { + return { + chain: [id], + id: id + }; + }); + while (queue.length > 0) { + var queueItem = queue.pop(); + var moduleId = queueItem.id; + var chain = queueItem.chain; + var module = $moduleCache$[moduleId]; + if ( + !module || + (module.hot._selfAccepted && !module.hot._selfInvalidated) + ) + continue; + if (module.hot._selfDeclined) { + return { + type: "self-declined", + chain: chain, + moduleId: moduleId + }; + } + if (module.hot._main) { + return { + type: "unaccepted", + chain: chain, + moduleId: moduleId + }; + } + for (var i = 0; i < module.parents.length; i++) { + var parentId = module.parents[i]; + var parent = $moduleCache$[parentId]; + if (!parent) continue; + if (parent.hot._declinedDependencies[moduleId]) { + return { + type: "declined", + chain: chain.concat([parentId]), + moduleId: moduleId, + parentId: parentId + }; + } + if (outdatedModules.indexOf(parentId) !== -1) continue; + if (parent.hot._acceptedDependencies[moduleId]) { + if (!outdatedDependencies[parentId]) + outdatedDependencies[parentId] = []; + addAllToSet(outdatedDependencies[parentId], [moduleId]); + continue; + } + delete outdatedDependencies[parentId]; + outdatedModules.push(parentId); + queue.push({ + chain: chain.concat([parentId]), + id: parentId + }); + } + } - return { - type: 'accepted', - moduleId: updateModuleId, - outdatedModules: outdatedModules, - outdatedDependencies: outdatedDependencies, - } - } + return { + type: "accepted", + moduleId: updateModuleId, + outdatedModules: outdatedModules, + outdatedDependencies: outdatedDependencies + }; + } - function addAllToSet(a, b) { - for (var i = 0; i < b.length; i++) { - var item = b[i] - if (a.indexOf(item) === -1) a.push(item) - } - } + function addAllToSet(a, b) { + for (var i = 0; i < b.length; i++) { + var item = b[i]; + if (a.indexOf(item) === -1) a.push(item); + } + } - // at begin all updates modules are outdated - // the "outdated" status can propagate to parents if they don't accept the children - var outdatedDependencies = {} - var outdatedModules = [] - var appliedUpdate = {} + // at begin all updates modules are outdated + // the "outdated" status can propagate to parents if they don't accept the children + var outdatedDependencies = {}; + var outdatedModules = []; + var appliedUpdate = {}; - var warnUnexpectedRequire = function warnUnexpectedRequire(module) { - console.warn( - '[HMR] unexpected require(' + module.id + ') to disposed module' - ) - } + var warnUnexpectedRequire = function warnUnexpectedRequire(module) { + console.warn( + "[HMR] unexpected require(" + module.id + ") to disposed module" + ); + }; - for (var moduleId in currentUpdate) { - if ($hasOwnProperty$(currentUpdate, moduleId)) { - var newModuleFactory = currentUpdate[moduleId] - /** @type {TODO} */ - var result - if (newModuleFactory) { - result = getAffectedModuleEffects(moduleId) - } else { - result = { - type: 'disposed', - moduleId: moduleId, - } - } - /** @type {Error|false} */ - var abortError = false - var doApply = false - var doDispose = false - var chainInfo = '' - if (result.chain) { - chainInfo = '\nUpdate propagation: ' + result.chain.join(' -> ') - } - switch (result.type) { - case 'self-declined': - if (options.onDeclined) options.onDeclined(result) - if (!options.ignoreDeclined) - abortError = new Error( - 'Aborted because of self decline: ' + - result.moduleId + - chainInfo - ) - break - case 'declined': - if (options.onDeclined) options.onDeclined(result) - if (!options.ignoreDeclined) - abortError = new Error( - 'Aborted because of declined dependency: ' + - result.moduleId + - ' in ' + - result.parentId + - chainInfo - ) - break - case 'unaccepted': - if (options.onUnaccepted) options.onUnaccepted(result) - if (!options.ignoreUnaccepted) - abortError = new Error( - 'Aborted because ' + moduleId + ' is not accepted' + chainInfo - ) - break - case 'accepted': - if (options.onAccepted) options.onAccepted(result) - doApply = true - break - case 'disposed': - if (options.onDisposed) options.onDisposed(result) - doDispose = true - break - default: - throw new Error('Unexception type ' + result.type) - } - if (abortError) { - return { - error: abortError, - } - } - if (doApply) { - appliedUpdate[moduleId] = newModuleFactory - addAllToSet(outdatedModules, result.outdatedModules) - for (moduleId in result.outdatedDependencies) { - if ($hasOwnProperty$(result.outdatedDependencies, moduleId)) { - if (!outdatedDependencies[moduleId]) - outdatedDependencies[moduleId] = [] - addAllToSet( - outdatedDependencies[moduleId], - result.outdatedDependencies[moduleId] - ) - } - } - } - if (doDispose) { - addAllToSet(outdatedModules, [result.moduleId]) - appliedUpdate[moduleId] = warnUnexpectedRequire - } - } - } - currentUpdate = undefined + for (var moduleId in currentUpdate) { + if ($hasOwnProperty$(currentUpdate, moduleId)) { + var newModuleFactory = currentUpdate[moduleId]; + /** @type {TODO} */ + var result; + if (newModuleFactory) { + result = getAffectedModuleEffects(moduleId); + } else { + result = { + type: "disposed", + moduleId: moduleId + }; + } + /** @type {Error|false} */ + var abortError = false; + var doApply = false; + var doDispose = false; + var chainInfo = ""; + if (result.chain) { + chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); + } + switch (result.type) { + case "self-declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of self decline: " + + result.moduleId + + chainInfo + ); + break; + case "declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of declined dependency: " + + result.moduleId + + " in " + + result.parentId + + chainInfo + ); + break; + case "unaccepted": + if (options.onUnaccepted) options.onUnaccepted(result); + if (!options.ignoreUnaccepted) + abortError = new Error( + "Aborted because " + moduleId + " is not accepted" + chainInfo + ); + break; + case "accepted": + if (options.onAccepted) options.onAccepted(result); + doApply = true; + break; + case "disposed": + if (options.onDisposed) options.onDisposed(result); + doDispose = true; + break; + default: + throw new Error("Unexception type " + result.type); + } + if (abortError) { + return { + error: abortError + }; + } + if (doApply) { + appliedUpdate[moduleId] = newModuleFactory; + addAllToSet(outdatedModules, result.outdatedModules); + for (moduleId in result.outdatedDependencies) { + if ($hasOwnProperty$(result.outdatedDependencies, moduleId)) { + if (!outdatedDependencies[moduleId]) + outdatedDependencies[moduleId] = []; + addAllToSet( + outdatedDependencies[moduleId], + result.outdatedDependencies[moduleId] + ); + } + } + } + if (doDispose) { + addAllToSet(outdatedModules, [result.moduleId]); + appliedUpdate[moduleId] = warnUnexpectedRequire; + } + } + } + currentUpdate = undefined; - // Store self accepted outdated modules to require them later by the module system - var outdatedSelfAcceptedModules = [] - for (var j = 0; j < outdatedModules.length; j++) { - var outdatedModuleId = outdatedModules[j] - var module = $moduleCache$[outdatedModuleId] - if ( - module && - (module.hot._selfAccepted || module.hot._main) && - // removed self-accepted modules should not be required - appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire && - // when called invalidate self-accepting is not possible - !module.hot._selfInvalidated - ) { - outdatedSelfAcceptedModules.push({ - module: outdatedModuleId, - require: module.hot._requireSelf, - errorHandler: module.hot._selfAccepted, - }) - } - } + // Store self accepted outdated modules to require them later by the module system + var outdatedSelfAcceptedModules = []; + for (var j = 0; j < outdatedModules.length; j++) { + var outdatedModuleId = outdatedModules[j]; + var module = $moduleCache$[outdatedModuleId]; + if ( + module && + (module.hot._selfAccepted || module.hot._main) && + // removed self-accepted modules should not be required + appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire && + // when called invalidate self-accepting is not possible + !module.hot._selfInvalidated + ) { + outdatedSelfAcceptedModules.push({ + module: outdatedModuleId, + require: module.hot._requireSelf, + errorHandler: module.hot._selfAccepted + }); + } + } - var moduleOutdatedDependencies + var moduleOutdatedDependencies; - return { - dispose: function () { - currentUpdateRemovedChunks.forEach(function (chunkId) { - delete $installedChunks$[chunkId] - }) - currentUpdateRemovedChunks = undefined + return { + dispose: function () { + currentUpdateRemovedChunks.forEach(function (chunkId) { + delete $installedChunks$[chunkId]; + }); + currentUpdateRemovedChunks = undefined; - var idx - var queue = outdatedModules.slice() - while (queue.length > 0) { - var moduleId = queue.pop() - var module = $moduleCache$[moduleId] - if (!module) continue + var idx; + var queue = outdatedModules.slice(); + while (queue.length > 0) { + var moduleId = queue.pop(); + var module = $moduleCache$[moduleId]; + if (!module) continue; - var data = {} + var data = {}; - // Call dispose handlers - var disposeHandlers = module.hot._disposeHandlers - for (j = 0; j < disposeHandlers.length; j++) { - disposeHandlers[j].call(null, data) - } - $hmrModuleData$[moduleId] = data + // Call dispose handlers + var disposeHandlers = module.hot._disposeHandlers; + for (j = 0; j < disposeHandlers.length; j++) { + disposeHandlers[j].call(null, data); + } + $hmrModuleData$[moduleId] = data; - // disable module (this disables requires from this module) - module.hot.active = false + // disable module (this disables requires from this module) + module.hot.active = false; - // remove module from cache - delete $moduleCache$[moduleId] + // remove module from cache + delete $moduleCache$[moduleId]; - // when disposing there is no need to call dispose handler - delete outdatedDependencies[moduleId] + // when disposing there is no need to call dispose handler + delete outdatedDependencies[moduleId]; - // remove "parents" references from all children - for (j = 0; j < module.children.length; j++) { - var child = $moduleCache$[module.children[j]] - if (!child) continue - idx = child.parents.indexOf(moduleId) - if (idx >= 0) { - child.parents.splice(idx, 1) - } - } - } + // remove "parents" references from all children + for (j = 0; j < module.children.length; j++) { + var child = $moduleCache$[module.children[j]]; + if (!child) continue; + idx = child.parents.indexOf(moduleId); + if (idx >= 0) { + child.parents.splice(idx, 1); + } + } + } - // remove outdated dependency from module children - var dependency - for (var outdatedModuleId in outdatedDependencies) { - if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { - module = $moduleCache$[outdatedModuleId] - if (module) { - moduleOutdatedDependencies = - outdatedDependencies[outdatedModuleId] - for (j = 0; j < moduleOutdatedDependencies.length; j++) { - dependency = moduleOutdatedDependencies[j] - idx = module.children.indexOf(dependency) - if (idx >= 0) module.children.splice(idx, 1) - } - } - } - } - }, - apply: function (reportError) { - // insert new code - for (var updateModuleId in appliedUpdate) { - if ($hasOwnProperty$(appliedUpdate, updateModuleId)) { - $moduleFactories$[updateModuleId] = appliedUpdate[updateModuleId] - } - } + // remove outdated dependency from module children + var dependency; + for (var outdatedModuleId in outdatedDependencies) { + if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { + module = $moduleCache$[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = + outdatedDependencies[outdatedModuleId]; + for (j = 0; j < moduleOutdatedDependencies.length; j++) { + dependency = moduleOutdatedDependencies[j]; + idx = module.children.indexOf(dependency); + if (idx >= 0) module.children.splice(idx, 1); + } + } + } + } + }, + apply: function (reportError) { + // insert new code + for (var updateModuleId in appliedUpdate) { + if ($hasOwnProperty$(appliedUpdate, updateModuleId)) { + $moduleFactories$[updateModuleId] = appliedUpdate[updateModuleId]; + } + } - // run new runtime modules - for (var i = 0; i < currentUpdateRuntime.length; i++) { - currentUpdateRuntime[i](__webpack_require__) - } + // run new runtime modules + for (var i = 0; i < currentUpdateRuntime.length; i++) { + currentUpdateRuntime[i](__webpack_require__); + } - // call accept handlers - for (var outdatedModuleId in outdatedDependencies) { - if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { - var module = $moduleCache$[outdatedModuleId] - if (module) { - moduleOutdatedDependencies = - outdatedDependencies[outdatedModuleId] - var callbacks = [] - var errorHandlers = [] - var dependenciesForCallbacks = [] - for (var j = 0; j < moduleOutdatedDependencies.length; j++) { - var dependency = moduleOutdatedDependencies[j] - var acceptCallback = - module.hot._acceptedDependencies[dependency] - var errorHandler = module.hot._acceptedErrorHandlers[dependency] - if (acceptCallback) { - if (callbacks.indexOf(acceptCallback) !== -1) continue - callbacks.push(acceptCallback) - errorHandlers.push(errorHandler) - dependenciesForCallbacks.push(dependency) - } - } - for (var k = 0; k < callbacks.length; k++) { - try { - callbacks[k].call(null, moduleOutdatedDependencies) - } catch (err) { - if (typeof errorHandlers[k] === 'function') { - try { - errorHandlers[k](err, { - moduleId: outdatedModuleId, - dependencyId: dependenciesForCallbacks[k], - }) - } catch (err2) { - if (options.onErrored) { - options.onErrored({ - type: 'accept-error-handler-errored', - moduleId: outdatedModuleId, - dependencyId: dependenciesForCallbacks[k], - error: err2, - originalError: err, - }) - } - if (!options.ignoreErrored) { - reportError(err2) - reportError(err) - } - } - } else { - if (options.onErrored) { - options.onErrored({ - type: 'accept-errored', - moduleId: outdatedModuleId, - dependencyId: dependenciesForCallbacks[k], - error: err, - }) - } - if (!options.ignoreErrored) { - reportError(err) - } - } - } - } - } - } - } + // call accept handlers + for (var outdatedModuleId in outdatedDependencies) { + if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { + var module = $moduleCache$[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = + outdatedDependencies[outdatedModuleId]; + var callbacks = []; + var errorHandlers = []; + var dependenciesForCallbacks = []; + for (var j = 0; j < moduleOutdatedDependencies.length; j++) { + var dependency = moduleOutdatedDependencies[j]; + var acceptCallback = + module.hot._acceptedDependencies[dependency]; + var errorHandler = + module.hot._acceptedErrorHandlers[dependency]; + if (acceptCallback) { + if (callbacks.indexOf(acceptCallback) !== -1) continue; + callbacks.push(acceptCallback); + errorHandlers.push(errorHandler); + dependenciesForCallbacks.push(dependency); + } + } + for (var k = 0; k < callbacks.length; k++) { + try { + callbacks[k].call(null, moduleOutdatedDependencies); + } catch (err) { + if (typeof errorHandlers[k] === "function") { + try { + errorHandlers[k](err, { + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k] + }); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "accept-error-handler-errored", + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k], + error: err2, + originalError: err + }); + } + if (!options.ignoreErrored) { + reportError(err2); + reportError(err); + } + } + } else { + if (options.onErrored) { + options.onErrored({ + type: "accept-errored", + moduleId: outdatedModuleId, + dependencyId: dependenciesForCallbacks[k], + error: err + }); + } + if (!options.ignoreErrored) { + reportError(err); + } + } + } + } + } + } + } - // Load self accepted modules - for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { - var item = outdatedSelfAcceptedModules[o] - var moduleId = item.module - try { - item.require(moduleId) - } catch (err) { - if (typeof item.errorHandler === 'function') { - try { - item.errorHandler(err, { - moduleId: moduleId, - module: $moduleCache$[moduleId], - }) - } catch (err2) { - if (options.onErrored) { - options.onErrored({ - type: 'self-accept-error-handler-errored', - moduleId: moduleId, - error: err2, - originalError: err, - }) - } - if (!options.ignoreErrored) { - reportError(err2) - reportError(err) - } - } - } else { - if (options.onErrored) { - options.onErrored({ - type: 'self-accept-errored', - moduleId: moduleId, - error: err, - }) - } - if (!options.ignoreErrored) { - reportError(err) - } - } - } - } + // Load self accepted modules + for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { + var item = outdatedSelfAcceptedModules[o]; + var moduleId = item.module; + try { + item.require(moduleId); + } catch (err) { + if (typeof item.errorHandler === "function") { + try { + item.errorHandler(err, { + moduleId: moduleId, + module: $moduleCache$[moduleId] + }); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-error-handler-errored", + moduleId: moduleId, + error: err2, + originalError: err + }); + } + if (!options.ignoreErrored) { + reportError(err2); + reportError(err); + } + } + } else { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-errored", + moduleId: moduleId, + error: err + }); + } + if (!options.ignoreErrored) { + reportError(err); + } + } + } + } - return outdatedModules - }, - } - } - $hmrInvalidateModuleHandlers$.$key$ = function (moduleId, applyHandlers) { - if (!currentUpdate) { - currentUpdate = {} - currentUpdateRuntime = [] - currentUpdateRemovedChunks = [] - applyHandlers.push(applyHandler) - } - if (!$hasOwnProperty$(currentUpdate, moduleId)) { - currentUpdate[moduleId] = $moduleFactories$[moduleId] - } - } - $hmrDownloadUpdateHandlers$.$key$ = function ( - chunkIds, - removedChunks, - removedModules, - promises, - applyHandlers, - updatedModulesList - ) { - applyHandlers.push(applyHandler) - currentUpdateChunks = {} - currentUpdateRemovedChunks = removedChunks - currentUpdate = removedModules.reduce(function (obj, key) { - obj[key] = false - return obj - }, {}) - currentUpdateRuntime = [] - chunkIds.forEach(function (chunkId) { - if ( - $hasOwnProperty$($installedChunks$, chunkId) && - $installedChunks$[chunkId] !== undefined - ) { - promises.push($loadUpdateChunk$(chunkId, updatedModulesList)) - currentUpdateChunks[chunkId] = true - } - }) - if ($ensureChunkHandlers$) { - $ensureChunkHandlers$.$key$Hmr = function (chunkId, promises) { - if ( - currentUpdateChunks && - !$hasOwnProperty$(currentUpdateChunks, chunkId) && - $hasOwnProperty$($installedChunks$, chunkId) && - $installedChunks$[chunkId] !== undefined - ) { - promises.push($loadUpdateChunk$(chunkId)) - currentUpdateChunks[chunkId] = true - } - } - } - } -} + return outdatedModules; + } + }; + } + $hmrInvalidateModuleHandlers$.$key$ = function (moduleId, applyHandlers) { + if (!currentUpdate) { + currentUpdate = {}; + currentUpdateRuntime = []; + currentUpdateRemovedChunks = []; + applyHandlers.push(applyHandler); + } + if (!$hasOwnProperty$(currentUpdate, moduleId)) { + currentUpdate[moduleId] = $moduleFactories$[moduleId]; + } + }; + $hmrDownloadUpdateHandlers$.$key$ = function ( + chunkIds, + removedChunks, + removedModules, + promises, + applyHandlers, + updatedModulesList + ) { + applyHandlers.push(applyHandler); + currentUpdateChunks = {}; + currentUpdateRemovedChunks = removedChunks; + currentUpdate = removedModules.reduce(function (obj, key) { + obj[key] = false; + return obj; + }, {}); + currentUpdateRuntime = []; + chunkIds.forEach(function (chunkId) { + if ( + $hasOwnProperty$($installedChunks$, chunkId) && + $installedChunks$[chunkId] !== undefined + ) { + promises.push($loadUpdateChunk$(chunkId, updatedModulesList)); + currentUpdateChunks[chunkId] = true; + } + }); + if ($ensureChunkHandlers$) { + $ensureChunkHandlers$.$key$Hmr = function (chunkId, promises) { + if ( + currentUpdateChunks && + !$hasOwnProperty$(currentUpdateChunks, chunkId) && + $hasOwnProperty$($installedChunks$, chunkId) && + $installedChunks$[chunkId] !== undefined + ) { + promises.push($loadUpdateChunk$(chunkId)); + currentUpdateChunks[chunkId] = true; + } + }; + } + }; +}; diff --git a/nextjs/packages/next/client/index.tsx b/nextjs/packages/next/client/index.tsx index 10a59c46c6..5abce5188d 100644 --- a/nextjs/packages/next/client/index.tsx +++ b/nextjs/packages/next/client/index.tsx @@ -713,9 +713,9 @@ function doRender(input: RenderRouteInfo): Promise { !canceled ) { const desiredHrefs: Set = new Set(styleSheets.map((s) => s.href)) - const currentStyleTags: HTMLStyleElement[] = looseToArray( - document.querySelectorAll('style[data-n-href]') - ) + const currentStyleTags: HTMLStyleElement[] = looseToArray< + HTMLStyleElement + >(document.querySelectorAll('style[data-n-href]')) const currentHrefs: string[] = currentStyleTags.map( (tag) => tag.getAttribute('data-n-href')! ) diff --git a/nextjs/packages/next/client/route-loader.ts b/nextjs/packages/next/client/route-loader.ts index b10b659414..c1be94cc76 100644 --- a/nextjs/packages/next/client/route-loader.ts +++ b/nextjs/packages/next/client/route-loader.ts @@ -185,16 +185,16 @@ export function getClientBuildManifest(): Promise { return Promise.resolve(self.__BUILD_MANIFEST) } - const onBuildManifest: Promise = new Promise( - (resolve) => { - // Mandatory because this is not concurrent safe: - const cb = self.__BUILD_MANIFEST_CB - self.__BUILD_MANIFEST_CB = () => { - resolve(self.__BUILD_MANIFEST!) - cb && cb() - } + const onBuildManifest: Promise = new Promise< + ClientBuildManifest + >((resolve) => { + // Mandatory because this is not concurrent safe: + const cb = self.__BUILD_MANIFEST_CB + self.__BUILD_MANIFEST_CB = () => { + resolve(self.__BUILD_MANIFEST!) + cb && cb() } - ) + }) return resolvePromiseWithTimeout( onBuildManifest, diff --git a/nextjs/packages/next/lib/regexr/profile/core.js b/nextjs/packages/next/lib/regexr/profile/core.js index 59811d7015..cd2ada92ad 100644 --- a/nextjs/packages/next/lib/regexr/profile/core.js +++ b/nextjs/packages/next/lib/regexr/profile/core.js @@ -48,7 +48,7 @@ let core = { badEscChars: n, escCharCodes: { - 0: 0, // null + '0': 0, // null a: 7, // bell t: 9, // tab n: 10, // lf diff --git a/nextjs/packages/next/next-server/lib/router/router.ts b/nextjs/packages/next/next-server/lib/router/router.ts index 42134157de..101b4bb6c2 100644 --- a/nextjs/packages/next/next-server/lib/router/router.ts +++ b/nextjs/packages/next/next-server/lib/router/router.ts @@ -1220,7 +1220,7 @@ export default class Router implements BaseRouter { as, options, __N: true, - idx: (this._idx = method !== 'pushState' ? this._idx : this._idx + 1), + idx: this._idx = method !== 'pushState' ? this._idx : this._idx + 1, } as HistoryState, // Most browsers currently ignores this parameter, although they may use it in the future. // Passing the empty string here should be safe against future changes to the method. diff --git a/nextjs/packages/next/package.json b/nextjs/packages/next/package.json index e246b80886..1559df9ed3 100644 --- a/nextjs/packages/next/package.json +++ b/nextjs/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "0.35.0-canary.3", + "version": "0.35.0-canary.5", "nextjsVersion": "10.1.3", "description": "The React Framework", "main": "./dist/server/next.js", diff --git a/nextjs/test/integration/production/test/index.test.js b/nextjs/test/integration/production/test/index.test.js index 65ec45ce0b..b2ac40341a 100644 --- a/nextjs/test/integration/production/test/index.test.js +++ b/nextjs/test/integration/production/test/index.test.js @@ -380,13 +380,12 @@ describe('Production Usage', () => { it('should set title by routeChangeComplete event', async () => { const browser = await webdriver(appPort, '/') await browser.eval(function setup() { - window.next.router.events.on( - 'routeChangeComplete', - function handler(url) { - window.routeChangeTitle = document.title - window.routeChangeUrl = url - } - ) + window.next.router.events.on('routeChangeComplete', function handler( + url + ) { + window.routeChangeTitle = document.title + window.routeChangeUrl = url + }) window.next.router.push('/with-title') }) await browser.waitForElementByCss('#with-title') From 278fe4451c583286a416f9e28f10cd74acfa9f64 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Sat, 8 May 2021 08:57:02 +0200 Subject: [PATCH 7/7] Fix type issue --- packages/babel-preset/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset/src/index.ts b/packages/babel-preset/src/index.ts index 30e575934e..65fdc382f2 100644 --- a/packages/babel-preset/src/index.ts +++ b/packages/babel-preset/src/index.ts @@ -1,3 +1,4 @@ +import type { TransformOptions } from '@babel/core'; import AddBlitzAppRoot from './add-blitz-app-root'; import RewriteImports from './rewrite-imports'; @@ -7,7 +8,7 @@ export default function preset(_api: any, options = {}) { const isRunningInJest = process.env.JEST_WORKER_ID && !process.env.__NEXT_TEST_MODE; - const config = { + const config: TransformOptions = { presets: [[require('next/babel'), options]], plugins: [ [ @@ -19,7 +20,7 @@ export default function preset(_api: any, options = {}) { }; if (!isRunningInJest) { - config.plugins.push(RewriteImports); + config.plugins!.push(RewriteImports); } return config;