-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hash change events not firing with i18n #26994
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
destruc7i0n
requested review from
huozhi,
ijjk,
padmaia,
shuding,
styfle and
timneutkens
as code owners
July 7, 2021 17:30
This comment has been minimized.
This comment has been minimized.
ijjk
reviewed
Jul 7, 2021
ijjk
reviewed
Jul 7, 2021
This comment has been minimized.
This comment has been minimized.
ijjk
approved these changes
Jul 7, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Added test and changes look good 👍
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
buildDuration | 11.8s | 11.7s | -71ms |
buildDurationCached | 2.8s | 2.7s | -59ms |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.897 | 1.921 | |
/ avg req/sec | 1317.63 | 1301.47 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.07 | 1.084 | |
/error-in-render avg req/sec | 2335.67 | 2307 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
359.HASH.js gzip | 3.09 kB | 3.09 kB | ✓ |
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.6 kB | 20.6 kB | |
webpack-HASH.js gzip | 1.49 kB | 1.49 kB | ✓ |
Overall change | 67.2 kB | 67.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
_app-HASH.js gzip | 803 B | 803 B | ✓ |
_error-HASH.js gzip | 3.18 kB | 3.18 kB | ✓ |
amp-HASH.js gzip | 526 B | 526 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
image-HASH.js gzip | 5.62 kB | 5.62 kB | ✓ |
index-HASH.js gzip | 261 B | 261 B | ✓ |
link-HASH.js gzip | 1.66 kB | 1.66 kB | ✓ |
routerDirect..HASH.js gzip | 319 B | 319 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 14 kB | 14 kB | ✓ |
Client Build Manifests
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 419 B | 419 B | ✓ |
Overall change | 419 B | 419 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
index.html gzip | 531 B | 530 B | -1 B |
link.html gzip | 544 B | 545 B | |
withRouter.html gzip | 524 B | 524 B | ✓ |
Overall change | 1.6 kB | 1.6 kB | ✓ |
Diffs
Diff for main-HASH.js
@@ -4078,7 +4078,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
forcedScroll
) {
var shouldResolveHref,
- localeChange,
+ prevLocale,
parsedAs,
localePathResult,
didNavigate,
@@ -4089,6 +4089,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shallow,
routeProps,
cleanedAs,
+ localeChange,
parsed,
pathname,
query,
@@ -4149,7 +4150,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isReady = true;
}
- localeChange = options.locale !== this.locale;
+ prevLocale = this.locale;
if (true) {
_context.next = 18;
@@ -4250,7 +4251,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ localeChange = prevLocale !== this.locale; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -4263,7 +4265,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
!localeChange
)
) {
- _context.next = 34;
+ _context.next = 35;
break;
}
@@ -4284,7 +4286,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 34:
+ case 35:
parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
url
);
@@ -4293,30 +4295,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// get their query parameters to allow ensuring they can be parsed properly
// when rewritten to
- _context.prev = 36;
- _context.next = 39;
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
// If asked to change the current URL we should reload the current page
// (not location.reload() but reload getInitialProps and other Next.js stuffs)
// We also need to set the method = replaceState always
@@ -4364,12 +4366,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
if (isLocalURL(as)) {
- _context.next = 60;
+ _context.next = 61;
break;
}
if (true) {
- _context.next = 58;
+ _context.next = 59;
break;
}
@@ -4383,18 +4385,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as"
);
- case 58:
+ case 59:
window.location.href = as;
return _context.abrupt("return", false);
- case 60:
+ case 61:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 76;
+ _context.next = 77;
break;
}
@@ -4417,7 +4419,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 75;
+ _context.next = 76;
break;
}
@@ -4428,7 +4430,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 73;
+ _context.next = 74;
break;
}
@@ -4459,11 +4461,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 73:
- _context.next = 76;
+ case 74:
+ _context.next = 77;
break;
- case 75:
+ case 76:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -4479,14 +4481,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 76:
+ case 77:
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 77;
- _context.next = 80;
+ _context.prev = 78;
+ _context.next = 81;
return this.getRouteInfo(
route,
pathname,
@@ -4496,7 +4498,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 80:
+ case 81:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -4505,14 +4507,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 106;
+ _context.next = 107;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 92;
+ _context.next = 93;
break;
}
@@ -4521,7 +4523,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 90;
+ _context.next = 91;
break;
}
@@ -4543,37 +4545,37 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 90:
+ case 91:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 92:
+ case 93:
this.isPreview = !!props.__N_PREVIEW; // handle SSG data 404
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 106;
+ _context.next = 107;
break;
}
- _context.prev = 94;
- _context.next = 97;
+ _context.prev = 95;
+ _context.next = 98;
return this.fetchComponent("/404");
- case 97:
+ case 98:
notFoundRoute = "/404";
- _context.next = 103;
+ _context.next = 104;
break;
- case 100:
- _context.prev = 100;
- _context.t1 = _context["catch"](94);
+ case 101:
+ _context.prev = 101;
+ _context.t1 = _context["catch"](95);
notFoundRoute = "/_error";
- case 103:
- _context.next = 105;
+ case 104:
+ _context.next = 106;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -4585,10 +4587,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
);
- case 105:
+ case 106:
routeInfo = _context.sent;
- case 106:
+ case 107:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -4629,7 +4631,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
y: 0
}
: null;
- _context.next = 115;
+ _context.next = 116;
return this.set(
route,
pathname,
@@ -4642,9 +4644,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 115:
+ case 116:
if (!error) {
- _context.next = 118;
+ _context.next = 119;
break;
}
@@ -4656,7 +4658,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 118:
+ case 119:
if (false) {
}
@@ -4667,21 +4669,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 123:
- _context.prev = 123;
- _context.t2 = _context["catch"](77);
+ case 124:
+ _context.prev = 124;
+ _context.t2 = _context["catch"](78);
if (!_context.t2.cancelled) {
- _context.next = 127;
+ _context.next = 128;
break;
}
return _context.abrupt("return", false);
- case 127:
+ case 128:
throw _context.t2;
- case 128:
+ case 129:
case "end":
return _context.stop();
}
@@ -4690,9 +4692,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [77, 123],
- [94, 100]
+ [37, 47],
+ [78, 124],
+ [95, 101]
]
);
})
Diff for index.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-fe07bb49b17c0e304399.js"
+ src="/_next/static/chunks/main-892ee2944821256aa3b7.js"
defer=""
></script>
<script
Diff for link.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-fe07bb49b17c0e304399.js"
+ src="/_next/static/chunks/main-892ee2944821256aa3b7.js"
defer=""
></script>
<script
Diff for withRouter.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-fe07bb49b17c0e304399.js"
+ src="/_next/static/chunks/main-892ee2944821256aa3b7.js"
defer=""
></script>
<script
Webpack 4 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
buildDuration | 9.2s | 9.6s | |
buildDurationCached | 3.7s | 3.9s | |
nodeModulesSize | 49.3 MB | 49.3 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.894 | 1.933 | |
/ avg req/sec | 1319.88 | 1293 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.073 | 1.095 | |
/error-in-render avg req/sec | 2329.74 | 2282.26 |
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
14.HASH.js gzip | 3.11 kB | 3.11 kB | ✓ |
677f882d2ed8..HASH.js gzip | 13.9 kB | 13.9 kB | -3 B |
framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
main-HASH.js gzip | 7.81 kB | 7.81 kB | ✓ |
webpack-HASH.js gzip | 1.19 kB | 1.19 kB | ✓ |
Overall change | 67.8 kB | 67.8 kB | -3 B |
Legacy Client Bundles (polyfills)
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
_app-HASH.js gzip | 791 B | 791 B | ✓ |
_error-HASH.js gzip | 3.83 kB | 3.83 kB | ✓ |
amp-HASH.js gzip | 531 B | 531 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
hooks-HASH.js gzip | 910 B | 910 B | ✓ |
index-HASH.js gzip | 230 B | 230 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 297 B | 297 B | ✓ |
withRouter-HASH.js gzip | 293 B | 293 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.98 kB | 8.98 kB | ✓ |
Client Build Manifests
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
_buildManifest.js gzip | 418 B | 418 B | ✓ |
Overall change | 418 B | 418 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | destruc7i0n/next.js canary | Change | |
---|---|---|---|
index.html gzip | 575 B | 577 B | |
link.html gzip | 586 B | 588 B | |
withRouter.html gzip | 568 B | 569 B | |
Overall change | 1.73 kB | 1.73 kB |
Diffs
Diff for 677f882d2ed8..c4df.HASH.js
@@ -1962,7 +1962,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
forcedScroll
) {
var shouldResolveHref,
- localeChange,
+ prevLocale,
parsedAs,
localePathResult,
didNavigate,
@@ -1973,6 +1973,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shallow,
routeProps,
cleanedAs,
+ localeChange,
parsed,
pathname,
query,
@@ -2033,7 +2034,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.isReady = true;
}
- localeChange = options.locale !== this.locale;
+ prevLocale = this.locale;
if (true) {
_context.next = 18;
@@ -2134,7 +2135,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
hasBasePath(as) ? delBasePath(as) : as,
this.locale
);
- this._inFlightRoute = as; // If the url change is only related to a hash change
+ this._inFlightRoute = as;
+ localeChange = prevLocale !== this.locale; // If the url change is only related to a hash change
// We should not proceed. We should only change the state.
// WARNING: `_h` is an internal option for handing Next.js client-side
// hydration. Your app should _never_ use this property. It may change at
@@ -2147,7 +2149,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
!localeChange
)
) {
- _context.next = 34;
+ _context.next = 35;
break;
}
@@ -2168,7 +2170,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 34:
+ case 35:
parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
url
);
@@ -2177,30 +2179,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// get their query parameters to allow ensuring they can be parsed properly
// when rewritten to
- _context.prev = 36;
- _context.next = 39;
+ _context.prev = 37;
+ _context.next = 40;
return this.pageLoader.getPageList();
- case 39:
+ case 40:
pages = _context.sent;
- _context.next = 42;
+ _context.next = 43;
return (0, _routeLoader.getClientBuildManifest)();
- case 42:
+ case 43:
_yield = _context.sent;
rewrites = _yield.__rewrites;
- _context.next = 50;
+ _context.next = 51;
break;
- case 46:
- _context.prev = 46;
- _context.t0 = _context["catch"](36);
+ case 47:
+ _context.prev = 47;
+ _context.t0 = _context["catch"](37);
// If we fail to resolve the page list or client-build manifest, we must
// do a server-side transition:
window.location.href = as;
return _context.abrupt("return", false);
- case 50:
+ case 51:
// If asked to change the current URL we should reload the current page
// (not location.reload() but reload getInitialProps and other Next.js stuffs)
// We also need to set the method = replaceState always
@@ -2248,12 +2250,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
if (isLocalURL(as)) {
- _context.next = 60;
+ _context.next = 61;
break;
}
if (true) {
- _context.next = 58;
+ _context.next = 59;
break;
}
@@ -2267,18 +2269,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
"\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as"
);
- case 58:
+ case 59:
window.location.href = as;
return _context.abrupt("return", false);
- case 60:
+ case 61:
resolvedAs = delLocale(
delBasePath(resolvedAs),
this.locale
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 76;
+ _context.next = 77;
break;
}
@@ -2301,7 +2303,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 75;
+ _context.next = 76;
break;
}
@@ -2312,7 +2314,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 73;
+ _context.next = 74;
break;
}
@@ -2343,11 +2345,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 73:
- _context.next = 76;
+ case 74:
+ _context.next = 77;
break;
- case 75:
+ case 76:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, _parsedAs, {
@@ -2363,14 +2365,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 76:
+ case 77:
Router.events.emit(
"routeChangeStart",
as,
routeProps
);
- _context.prev = 77;
- _context.next = 80;
+ _context.prev = 78;
+ _context.next = 81;
return this.getRouteInfo(
route,
pathname,
@@ -2380,7 +2382,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
routeProps
);
- case 80:
+ case 81:
routeInfo = _context.sent;
(_routeInfo = routeInfo),
(error = _routeInfo.error),
@@ -2389,14 +2391,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(__N_SSP = _routeInfo.__N_SSP); // handle redirect on client-transition
if (!((__N_SSG || __N_SSP) && props)) {
- _context.next = 106;
+ _context.next = 107;
break;
}
if (
!(props.pageProps && props.pageProps.__N_REDIRECT)
) {
- _context.next = 92;
+ _context.next = 93;
break;
}
@@ -2405,7 +2407,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 90;
+ _context.next = 91;
break;
}
@@ -2427,37 +2429,37 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.change(method, newUrl, newAs, options)
);
- case 90:
+ case 91:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 92:
+ case 93:
this.isPreview = !!props.__N_PREVIEW; // handle SSG data 404
if (!(props.notFound === SSG_DATA_NOT_FOUND)) {
- _context.next = 106;
+ _context.next = 107;
break;
}
- _context.prev = 94;
- _context.next = 97;
+ _context.prev = 95;
+ _context.next = 98;
return this.fetchComponent("/404");
- case 97:
+ case 98:
notFoundRoute = "/404";
- _context.next = 103;
+ _context.next = 104;
break;
- case 100:
- _context.prev = 100;
- _context.t1 = _context["catch"](94);
+ case 101:
+ _context.prev = 101;
+ _context.t1 = _context["catch"](95);
notFoundRoute = "/_error";
- case 103:
- _context.next = 105;
+ case 104:
+ _context.next = 106;
return this.getRouteInfo(
notFoundRoute,
notFoundRoute,
@@ -2469,10 +2471,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
);
- case 105:
+ case 106:
routeInfo = _context.sent;
- case 106:
+ case 107:
Router.events.emit(
"beforeHistoryChange",
as,
@@ -2513,7 +2515,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
y: 0
}
: null;
- _context.next = 115;
+ _context.next = 116;
return this.set(
route,
pathname,
@@ -2526,9 +2528,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 115:
+ case 116:
if (!error) {
- _context.next = 118;
+ _context.next = 119;
break;
}
@@ -2540,7 +2542,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 118:
+ case 119:
if (false) {
}
@@ -2551,21 +2553,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
return _context.abrupt("return", true);
- case 123:
- _context.prev = 123;
- _context.t2 = _context["catch"](77);
+ case 124:
+ _context.prev = 124;
+ _context.t2 = _context["catch"](78);
if (!_context.t2.cancelled) {
- _context.next = 127;
+ _context.next = 128;
break;
}
return _context.abrupt("return", false);
- case 127:
+ case 128:
throw _context.t2;
- case 128:
+ case 129:
case "end":
return _context.stop();
}
@@ -2574,9 +2576,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee,
this,
[
- [36, 46],
- [77, 123],
- [94, 100]
+ [37, 47],
+ [78, 124],
+ [95, 101]
]
);
})
Diff for index.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.525df861d4d829a48355.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.743faf44f9b7c645e1e6.js"
defer=""
></script>
<script
Diff for link.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.525df861d4d829a48355.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.743faf44f9b7c645e1e6.js"
defer=""
></script>
<script
Diff for withRouter.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.525df861d4d829a48355.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.743faf44f9b7c645e1e6.js"
defer=""
></script>
<script
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Aug 19, 2021
My last PR (vercel#26205) made the hash change events not fire when in i18n was enabled, as seen in vercel#26853. This PR fixes that and adds a test for this case. fixes vercel#26853 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My last PR (#26205) made the hash change events not fire when in i18n was enabled, as seen in #26853. This PR fixes that and adds a test for this case.
fixes #26853
Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples