-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Add locale prop for transitioning locales client side #17898
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
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
buildDuration | 11.5s | 11.3s | -238ms |
nodeModulesSize | 64.3 MB | 64.3 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.08 | 2.084 | 0 |
/ avg req/sec | 1201.94 | 1199.89 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.179 | 1.201 | |
/error-in-render avg req/sec | 2120.18 | 2081.41 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
677f882d2ed8..133b.js gzip | 11.1 kB | 11.1 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-3fae807..efe0.js gzip | 7.3 kB | 7.3 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
Overall change | 58.1 kB | 58.1 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.9 kB | 6.91 kB | |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ac5189..dule.js gzip | 6.29 kB | 6.29 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
Overall change | 52.9 kB | 52.9 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_app-9a0b9e1..b37e.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-ed1b0..8fbd.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-89731c..c609.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-409b283..e3ab.js gzip | 1.32 kB | 1.34 kB | |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
Overall change | 7.73 kB | 7.74 kB |
Client Pages Modern Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-4469a..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-92d3016..dule.js gzip | 1.28 kB | 1.29 kB | |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
Overall change | 5.37 kB | 5.39 kB |
Client Build Manifests Overall decrease ✓
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 322 B | -1 B |
_buildManife..dule.js gzip | 329 B | 329 B | ✓ |
Overall change | 652 B | 651 B | -1 B |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
index.html gzip | 1 kB | 1 kB | -2 B |
link.html gzip | 1.01 kB | 1.01 kB | -1 B |
withRouter.html gzip | 995 B | 996 B | |
Overall change | 3.01 kB | 3.01 kB | -2 B |
Diffs
Diff for _buildManifest.js
@@ -7,7 +7,7 @@ self.__BUILD_MANIFEST = {
"/hooks": [
"static\u002Fchunks\u002Fpages\u002Fhooks-8001dc76075832ee8949.js"
],
- "/link": ["static\u002Fchunks\u002Fpages\u002Flink-67e857671520c009f99f.js"],
+ "/link": ["static\u002Fchunks\u002Fpages\u002Flink-7236526bde7b14102ab7.js"],
"/routerDirect": [
"static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
],
Diff for _buildManifest.module.js
@@ -10,7 +10,7 @@ self.__BUILD_MANIFEST = {
"static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
],
"/link": [
- "static\u002Fchunks\u002Fpages\u002Flink-1de2ef9a42400a3bd1f2.module.js"
+ "static\u002Fchunks\u002Fpages\u002Flink-3a2f793c262b292c369c.module.js"
],
"/routerDirect": [
"static\u002Fchunks\u002Fpages\u002FrouterDirect-368af3dfef3c9cd99dc3.module.js"
Diff for link-1de2ef9..f2.module.js
@@ -161,7 +161,16 @@
);
}
- function linkClicked(e, router, href, as, replace, shallow, scroll) {
+ function linkClicked(
+ e,
+ router,
+ href,
+ as,
+ replace,
+ shallow,
+ scroll,
+ locale
+ ) {
var { nodeName } = e.currentTarget;
if (
@@ -179,7 +188,8 @@
} // replace state instead of push if prop is present
router[replace ? "replace" : "push"](href, as, {
- shallow
+ shallow,
+ locale
}).then(success => {
if (!success) return;
@@ -239,7 +249,7 @@
}
}, [p, childElm, href, as, router]);
- var { children, replace, shallow, scroll } = props; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
+ var { children, replace, shallow, scroll, locale } = props; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
if (typeof children === "string") {
children = /*#__PURE__*/ _react.default.createElement(
@@ -268,7 +278,16 @@
}
if (!e.defaultPrevented) {
- linkClicked(e, router, href, as, replace, shallow, scroll);
+ linkClicked(
+ e,
+ router,
+ href,
+ as,
+ replace,
+ shallow,
+ scroll,
+ locale
+ );
}
}
};
@@ -295,7 +314,7 @@
childProps.href = (0, _router.addBasePath)(
(0, _router.addLocale)(
as,
- router && router.locale,
+ locale || (router && router.locale),
router && router.defaultLocale
)
);
Diff for link-67e8576..0c009f99f.js
@@ -165,7 +165,16 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
);
}
- function linkClicked(e, router, href, as, replace, shallow, scroll) {
+ function linkClicked(
+ e,
+ router,
+ href,
+ as,
+ replace,
+ shallow,
+ scroll,
+ locale
+ ) {
var nodeName = e.currentTarget.nodeName;
if (
@@ -183,7 +192,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
} // replace state instead of push if prop is present
router[replace ? "replace" : "push"](href, as, {
- shallow: shallow
+ shallow: shallow,
+ locale: locale
}).then(function(success) {
if (!success) return;
@@ -258,7 +268,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
var children = props.children,
replace = props.replace,
shallow = props.shallow,
- scroll = props.scroll; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
+ scroll = props.scroll,
+ locale = props.locale; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
if (typeof children === "string") {
children = /*#__PURE__*/ _react["default"].createElement(
@@ -287,7 +298,16 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
}
if (!e.defaultPrevented) {
- linkClicked(e, router, href, as, replace, shallow, scroll);
+ linkClicked(
+ e,
+ router,
+ href,
+ as,
+ replace,
+ shallow,
+ scroll,
+ locale
+ );
}
}
};
@@ -314,7 +334,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
childProps.href = (0, _router.addBasePath)(
(0, _router.addLocale)(
as,
- router && router.locale,
+ locale || (router && router.locale),
router && router.defaultLocale
)
);
Diff for 677f882d2ed8..f527f314d.js
@@ -1280,6 +1280,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _context.abrupt("return", false);
case 3:
+ this.locale = options.locale || this.locale;
+
if (!options._h) {
this.isSsr = false;
} // marking route changes as a navigation start entry
@@ -1306,7 +1308,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 17;
+ _context.next = 18;
break;
}
@@ -1319,16 +1321,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit("hashChangeComplete", as);
return _context.abrupt("return", true);
- case 17:
- _context.next = 19;
+ case 18:
+ _context.next = 20;
return this.pageLoader.getPageList();
- case 19:
+ case 20:
pages = _context.sent;
- _context.next = 22;
+ _context.next = 23;
return this.pageLoader.promisedBuildManifest;
- case 22:
+ case 23:
_yield$this$pageLoade = _context.sent;
rewrites = _yield$this$pageLoade.__rewrites;
parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
@@ -1383,7 +1385,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 50;
+ _context.next = 51;
break;
}
@@ -1406,7 +1408,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 49;
+ _context.next = 50;
break;
}
@@ -1417,7 +1419,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 47;
+ _context.next = 48;
break;
}
@@ -1448,11 +1450,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 47:
- _context.next = 50;
+ case 48:
+ _context.next = 51;
break;
- case 49:
+ case 50:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, parsedAs, {
@@ -1468,10 +1470,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 50:
+ case 51:
Router.events.emit("routeChangeStart", as);
- _context.prev = 51;
- _context.next = 54;
+ _context.prev = 52;
+ _context.next = 55;
return this.getRouteInfo(
route,
pathname,
@@ -1480,7 +1482,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shallow
);
- case 54:
+ case 55:
routeInfo = _context.sent;
(error = routeInfo.error),
(props = routeInfo.props),
@@ -1495,7 +1497,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
props.pageProps.__N_REDIRECT
)
) {
- _context.next = 65;
+ _context.next = 66;
break;
}
@@ -1504,7 +1506,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 63;
+ _context.next = 64;
break;
}
@@ -1514,7 +1516,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 63;
+ _context.next = 64;
break;
}
@@ -1528,14 +1530,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 63:
+ case 64:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 65:
+ case 66:
Router.events.emit("beforeHistoryChange", as);
this.changeState(
method,
@@ -1547,7 +1549,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
- _context.next = 70;
+ _context.next = 71;
return this.set(
route,
pathname,
@@ -1559,9 +1561,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 70:
+ case 71:
if (!error) {
- _context.next = 73;
+ _context.next = 74;
break;
}
@@ -1572,28 +1574,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 73:
+ case 74:
if (false) {
}
Router.events.emit("routeChangeComplete", as);
return _context.abrupt("return", true);
- case 78:
- _context.prev = 78;
- _context.t0 = _context["catch"](51);
+ case 79:
+ _context.prev = 79;
+ _context.t0 = _context["catch"](52);
if (!_context.t0.cancelled) {
- _context.next = 82;
+ _context.next = 83;
break;
}
return _context.abrupt("return", false);
- case 82:
+ case 83:
throw _context.t0;
- case 83:
+ case 84:
case "end":
return _context.stop();
}
@@ -1601,7 +1603,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
},
_callee,
this,
- [[51, 78]]
+ [[52, 79]]
);
})
);
Diff for 677f882d2ed8..c9.module.js
@@ -1060,6 +1060,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return false;
}
+ this.locale = options.locale || this.locale;
+
if (!options._h) {
this.isSsr = false;
} // marking route changes as a navigation start entry
Diff for index.html
@@ -24,7 +24,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -121,13 +121,13 @@
type="module"
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.17d128b4c94f527f314d.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4342064e17c0fd4c221d.js"
async=""
crossorigin="anonymous"
nomodule=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
async=""
crossorigin="anonymous"
type="module"
Diff for link.html
@@ -24,7 +24,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -36,7 +36,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/pages/link-1de2ef9a42400a3bd1f2.module.js"
+ href="/_next/static/chunks/pages/link-3a2f793c262b292c369c.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -126,13 +126,13 @@
type="module"
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.17d128b4c94f527f314d.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4342064e17c0fd4c221d.js"
async=""
crossorigin="anonymous"
nomodule=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
async=""
crossorigin="anonymous"
type="module"
@@ -150,13 +150,13 @@
type="module"
></script>
<script
- src="/_next/static/chunks/pages/link-67e857671520c009f99f.js"
+ src="/_next/static/chunks/pages/link-7236526bde7b14102ab7.js"
async=""
crossorigin="anonymous"
nomodule=""
></script>
<script
- src="/_next/static/chunks/pages/link-1de2ef9a42400a3bd1f2.module.js"
+ src="/_next/static/chunks/pages/link-3a2f793c262b292c369c.module.js"
async=""
crossorigin="anonymous"
type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -121,13 +121,13 @@
type="module"
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.17d128b4c94f527f314d.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4342064e17c0fd4c221d.js"
async=""
crossorigin="anonymous"
nomodule=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e790c6fbd72bc7c72cc9.module.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.13a0948607f1cb875368.module.js"
async=""
crossorigin="anonymous"
type="module"
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
buildDuration | 13.2s | 13s | -132ms |
nodeModulesSize | 64.3 MB | 64.3 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
677f882d2ed8..133b.js gzip | 11.1 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-3fae807..efe0.js gzip | 7.3 kB | 7.3 kB | ✓ |
webpack-e067..f178.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..0989.js gzip | N/A | 11.1 kB | N/A |
Overall change | 58.1 kB | 58.1 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
677f882d2ed8..dule.js gzip | 6.9 kB | N/A | N/A |
framework.HA..dule.js gzip | 39 kB | 39 kB | ✓ |
main-8ac5189..dule.js gzip | 6.29 kB | 6.29 kB | ✓ |
webpack-07c5..dule.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..dule.js gzip | N/A | 6.91 kB | N/A |
Overall change | 52.9 kB | 52.9 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
polyfills-4b..e242.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_app-9a0b9e1..b37e.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-ed1b0..8fbd.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-89731c..c609.js gzip | 887 B | 887 B | ✓ |
index-17468f..5d83.js gzip | 227 B | 227 B | ✓ |
link-409b283..e3ab.js gzip | 1.32 kB | N/A | N/A |
routerDirect..924c.js gzip | 284 B | 284 B | ✓ |
withRouter-7..c13d.js gzip | 284 B | 284 B | ✓ |
link-89ad9e7..25bb.js gzip | N/A | 1.34 kB | N/A |
Overall change | 7.73 kB | 7.74 kB |
Client Pages Modern Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_app-75d3a82..dule.js gzip | 625 B | 625 B | ✓ |
_error-4469a..dule.js gzip | 2.29 kB | 2.29 kB | ✓ |
hooks-cbf13f..dule.js gzip | 387 B | 387 B | ✓ |
index-b9a643..dule.js gzip | 226 B | 226 B | ✓ |
link-92d3016..dule.js gzip | 1.28 kB | N/A | N/A |
routerDirect..dule.js gzip | 284 B | 284 B | ✓ |
withRouter-f..dule.js gzip | 282 B | 282 B | ✓ |
link-aeb707b..dule.js gzip | N/A | 1.29 kB | N/A |
Overall change | 5.37 kB | 5.39 kB |
Client Build Manifests Overall decrease ✓
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 322 B | -1 B |
_buildManife..dule.js gzip | 329 B | 329 B | ✓ |
Overall change | 652 B | 651 B | -1 B |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | ijjk/next.js i18n/link-locale-prop | Change | |
---|---|---|---|
_error.js | 1.06 MB | 1.06 MB | |
404.html | 4.34 kB | 4.34 kB | ✓ |
hooks.html | 3.92 kB | 3.92 kB | ✓ |
index.js | 1.06 MB | 1.06 MB | |
link.js | 1.1 MB | 1.1 MB | |
routerDirect.js | 1.1 MB | 1.1 MB | |
withRouter.js | 1.1 MB | 1.1 MB | |
Overall change | 5.41 MB | 5.41 MB |
timneutkens
approved these changes
Oct 15, 2020
kodiakhq bot
pushed a commit
that referenced
this pull request
May 5, 2021
Documentation page: https://nextjs.org/docs/api-reference/next/router#routerpush Add `locale` as supported options in `route.push()` (#17898)
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Jun 1, 2021
Documentation page: https://nextjs.org/docs/api-reference/next/router#routerpush Add `locale` as supported options in `route.push()` (vercel#17898)
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.
This adds the
locale
prop fornext/link
to allow transitioning between locales client-side and also allows passing the locale torouter.push/replace
via the transition options similar toshallow
e.g.router.push('/another', '/another, { locale: 'nl' })
x-ref: #17370