-
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
Dedupe in-flight server data requests #22781
Dedupe in-flight server data requests #22781
Conversation
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 7.8s | 7.9s | |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.31 | 1.325 | |
/ avg req/sec | 1908.32 | 1887.23 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 0.883 | 0.908 | |
/error-in-render avg req/sec | 2830.36 | 2753.11 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 613 B | 615 B | |
link.html gzip | 620 B | 621 B | |
withRouter.html gzip | 609 B | 609 B | ✓ |
Overall change | 1.84 kB | 1.84 kB |
Diffs
Diff for 677f882d2ed8..5ec6837e3.js
@@ -1589,6 +1589,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
* Map of all components loaded in `Router`
*/
// Static Data Cache
+ // In-flight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) {
var _this = this;
@@ -1615,6 +1616,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.basePath = void 0;
this.components = void 0;
this.sdc = {};
+ this.sdr = {};
this.sub = void 0;
this.clc = void 0;
this.pageLoader = void 0;
@@ -3205,7 +3207,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
{
key: "_getServerData",
value: function _getServerData(dataHref) {
- return fetchNextData(dataHref, this.isSsr);
+ var _this6 = this;
+
+ var _URL2 = new URL(dataHref, window.location.href),
+ resourceKey = _URL2.href;
+
+ if (this.sdr[resourceKey]) {
+ return this.sdr[resourceKey];
+ }
+
+ return (this.sdr[resourceKey] = fetchNextData(
+ dataHref,
+ this.isSsr
+ )
+ .then(function(data) {
+ delete _this6.sdr[resourceKey];
+ return data;
+ })
+ ["catch"](function(err) {
+ delete _this6.sdr[resourceKey];
+ throw err;
+ }));
}
},
{
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 9.3s | 9.2s | -110ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..df71.js gzip | N/A | 13.4 kB | N/A |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_error.js | 1.02 MB | 1.02 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.5 kB | 10.5 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.02 MB | 1.02 MB | ✓ |
link.js | 1.08 MB | 1.08 MB | |
routerDirect.js | 1.07 MB | 1.07 MB | |
withRouter.js | 1.07 MB | 1.07 MB | |
Overall change | 5.27 MB | 5.27 MB |
Webpack 5 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 9.7s | 9.6s | -45ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.31 | 1.332 | |
/ avg req/sec | 1908.31 | 1876.44 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 0.893 | 0.893 | ✓ |
/error-in-render avg req/sec | 2799.69 | 2800.35 | +0.66 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
597-74632e79..1d47.js gzip | 13.3 kB | 13.3 kB | |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.6 kB | 6.6 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 586 B | 585 B | -1 B |
link.html gzip | 593 B | 592 B | -1 B |
withRouter.html gzip | 582 B | 581 B | -1 B |
Overall change | 1.76 kB | 1.76 kB | -3 B |
Diffs
Diff for 677f882d2ed8..eaa79e7a0.js
@@ -75,9 +75,9 @@
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in t)
if (Object.prototype.hasOwnProperty.call(t, i)) {
- var u = a ? Object.getOwnPropertyDescriptor(t, i) : null;
- u && (u.get || u.set)
- ? Object.defineProperty(r, i, u)
+ var s = a ? Object.getOwnPropertyDescriptor(t, i) : null;
+ s && (s.get || s.set)
+ ? Object.defineProperty(r, i, s)
: (r[i] = t[i]);
}
return (r.default = t), e && e.set(t, r), r;
@@ -168,8 +168,8 @@
r = t.hostname,
o = t.protocol || "",
i = t.pathname || "",
- u = t.hash || "",
- s = t.query || "",
+ s = t.hash || "",
+ u = t.query || "",
c = !1;
(e = e ? encodeURIComponent(e).replace(/%3A/i, ":") + "@" : ""),
t.host
@@ -177,15 +177,15 @@
: r &&
((c = e + (~r.indexOf(":") ? "[".concat(r, "]") : r)),
t.port && (c += ":" + t.port));
- s &&
- "object" === typeof s &&
- (s = String(n.urlQueryToSearchParams(s)));
- var l = t.search || (s && "?".concat(s)) || "";
+ u &&
+ "object" === typeof u &&
+ (u = String(n.urlQueryToSearchParams(u)));
+ var l = t.search || (u && "?".concat(u)) || "";
o && ":" !== o.substr(-1) && (o += ":");
t.slashes || ((!o || a.test(o)) && !1 !== c)
? ((c = "//" + (c || "")), i && "/" !== i[0] && (i = "/" + i))
: c || (c = "");
- u && "#" !== u[0] && (u = "#" + u);
+ s && "#" !== s[0] && (s = "#" + s);
l && "?" !== l[0] && (l = "?" + l);
return (
(i = i.replace(/[?#]/g, encodeURIComponent)),
@@ -195,7 +195,7 @@
.concat(c)
.concat(i)
.concat(l)
- .concat(u)
+ .concat(s)
);
});
var n = (function(t) {
@@ -272,8 +272,8 @@
(e.getClientBuildManifest = p),
(e.default = void 0);
i(r("Lab5"));
- var u = r("0G5g");
- function s(t, e, r) {
+ var s = r("0G5g");
+ function u(t, e, r) {
var n,
o = e.get(t);
if (o) return "future" in o ? o.future : Promise.resolve(o);
@@ -306,7 +306,7 @@
}
function h(t, e) {
return new Promise(function(r, n) {
- return (0, u.requestIdleCallback)(function() {
+ return (0, s.requestIdleCallback)(function() {
return setTimeout(function() {
return n(e);
}, t);
@@ -397,7 +397,7 @@
}
return {
whenEntrypoint: function(t) {
- return s(t, e);
+ return u(t, e);
},
onEntrypoint: function(t, r) {
Promise.resolve(r)
@@ -419,12 +419,12 @@
},
loadRoute: function(r) {
var i = this;
- return s(
+ return u(
r,
l,
a(
n.mark(function a() {
- var u, s, c, l, y, m, g, w;
+ var s, u, c, l, y, m, g, w;
return n.wrap(
function(n) {
for (;;)
@@ -433,12 +433,12 @@
return (n.prev = 0), (n.next = 3), d(t, r);
case 3:
return (
- (u = n.sent),
- (s = u.scripts),
- (c = u.css),
+ (s = n.sent),
+ (u = s.scripts),
+ (c = s.css),
(n.next = 8),
Promise.all([
- e.has(r) ? [] : Promise.all(s.map(p)),
+ e.has(r) ? [] : Promise.all(u.map(p)),
Promise.all(c.map(v))
])
);
@@ -527,7 +527,7 @@
);
})
.then(function() {
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return n.loadRoute(e);
});
})
@@ -713,7 +713,7 @@
o = r("yXPU"),
a = r("lwsE"),
i = r("W8MJ"),
- u = r("J4zp");
+ s = r("J4zp");
(e.__esModule = !0),
(e.getDomainLocale = function(t, e, r, n) {
0;
@@ -728,7 +728,7 @@
(e.interpolateAs = L),
(e.resolveHref = O),
(e.default = void 0);
- var s = r("X24+"),
+ var u = r("X24+"),
c = r("Nh2W"),
l = r("wkBG"),
f = (r("3wub"), w(r("dZ6Y"))),
@@ -763,7 +763,7 @@
return (function(t, e) {
return e && t.startsWith("/")
? "/" === t
- ? (0, s.normalizePathTrailingSlash)(e)
+ ? (0, u.normalizePathTrailingSlash)(e)
: "".concat(e).concat("/" === P(t) ? t.substring(1) : t)
: t;
})(t, "");
@@ -789,21 +789,21 @@
a = o.groups,
i = (e !== t ? (0, m.getRouteMatcher)(o)(e) : "") || r;
n = t;
- var u = Object.keys(a);
+ var s = Object.keys(a);
return (
- u.every(function(t) {
+ s.every(function(t) {
var e = i[t] || "",
r = a[t],
o = r.repeat,
- u = r.optional,
- s = "[".concat(o ? "..." : "").concat(t, "]");
+ s = r.optional,
+ u = "[".concat(o ? "..." : "").concat(t, "]");
return (
- u && (s = "".concat(e ? "" : "/", "[").concat(s, "]")),
+ s && (u = "".concat(e ? "" : "/", "[").concat(u, "]")),
o && !Array.isArray(e) && (e = [e]),
- (u || t in i) &&
+ (s || t in i) &&
(n =
n.replace(
- s,
+ u,
o
? e
.map(function(t) {
@@ -814,7 +814,7 @@
) || "/")
);
}) || (n = ""),
- { params: u, result: n }
+ { params: s, result: n }
);
}
function C(t, e) {
@@ -832,18 +832,18 @@
if (!R(o)) return r ? [o] : o;
try {
var a = new URL(o, n);
- a.pathname = (0, s.normalizePathTrailingSlash)(a.pathname);
+ a.pathname = (0, u.normalizePathTrailingSlash)(a.pathname);
var i = "";
if ((0, p.isDynamicRoute)(a.pathname) && a.searchParams && r) {
- var u = (0, v.searchParamsToUrlQuery)(a.searchParams),
- c = L(a.pathname, a.pathname, u),
+ var s = (0, v.searchParamsToUrlQuery)(a.searchParams),
+ c = L(a.pathname, a.pathname, s),
l = c.result,
f = c.params;
l &&
(i = (0, h.formatWithValidation)({
pathname: l,
hash: a.hash,
- query: C(u, f)
+ query: C(s, f)
}));
}
var d =
@@ -859,12 +859,12 @@
}
function T(t, e, r) {
var n = O(t.pathname, e, !0),
- o = u(n, 2),
+ o = s(n, 2),
a = o[0],
i = o[1],
- s = (0, h.getLocationOrigin)(),
- c = a.startsWith(s),
- l = i && i.startsWith(s);
+ u = (0, h.getLocationOrigin)(),
+ c = a.startsWith(u),
+ l = i && i.startsWith(u);
(a = I(a)), (i = i ? I(i) : i);
var f = c ? a : S(a),
p = r ? I(O(t.pathname, r)) : i || a;
@@ -874,7 +874,7 @@
var r =
!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
n = t.pathname,
- o = (0, s.removePathTrailingSlash)(
+ o = (0, u.removePathTrailingSlash)(
(0, l.denormalizePagePath)(r ? E(n) : n)
);
return (
@@ -888,7 +888,7 @@
)
return (t.pathname = r ? S(e) : e), !0;
}),
- (t.pathname = (0, s.removePathTrailingSlash)(t.pathname))),
+ (t.pathname = (0, u.removePathTrailingSlash)(t.pathname))),
t
);
}
@@ -915,7 +915,7 @@
var N = (function() {
function t(e, r, n, o) {
var i = this,
- u = o.initialProps,
+ s = o.initialProps,
c = o.pageLoader,
l = o.App,
f = o.wrapApp,
@@ -933,6 +933,7 @@
(this.basePath = void 0),
(this.components = void 0),
(this.sdc = {}),
+ (this.sdr = {}),
(this.sub = void 0),
(this.clc = void 0),
(this.pageLoader = void 0),
@@ -960,8 +961,8 @@
o = e.options,
a = e.idx;
i._idx = a;
- var u = (0, d.parseRelativeUrl)(r).pathname;
- (i.isSsr && n === i.asPath && u === i.pathname) ||
+ var s = (0, d.parseRelativeUrl)(r).pathname;
+ (i.isSsr && n === i.asPath && s === i.pathname) ||
(i._bps && !i._bps(e)) ||
i.change(
"replaceState",
@@ -975,25 +976,25 @@
);
}
} else {
- var s = i.pathname,
+ var u = i.pathname,
c = i.query;
i.changeState(
"replaceState",
- (0, h.formatWithValidation)({ pathname: S(s), query: c }),
+ (0, h.formatWithValidation)({ pathname: S(u), query: c }),
(0, h.getURL)()
);
}
}),
- (this.route = (0, s.removePathTrailingSlash)(e)),
+ (this.route = (0, u.removePathTrailingSlash)(e)),
(this.components = {}),
"/_error" !== e &&
(this.components[this.route] = {
Component: v,
initial: !0,
- props: u,
+ props: s,
err: y,
- __N_SSG: u && u.__N_SSG,
- __N_SSP: u && u.__N_SSP
+ __N_SSG: s && s.__N_SSG,
+ __N_SSP: s && s.__N_SSP
}),
(this.components["/_app"] = { Component: l, styleSheets: [] }),
(this.events = t.events),
@@ -1068,7 +1069,7 @@
key: "change",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u) {
+ n.mark(function e(r, o, a, i, s) {
var l,
f,
v,
@@ -1188,10 +1189,10 @@
((O = b.pathname),
(o = (0, h.formatWithValidation)(b))),
(O = O
- ? (0, s.removePathTrailingSlash)(E(O))
+ ? (0, u.removePathTrailingSlash)(E(O))
: O),
this.urlIsNew(w) || f || (r = "replaceState"),
- (N = (0, s.removePathTrailingSlash)(O)),
+ (N = (0, u.removePathTrailingSlash)(O)),
(U = a),
R(a))
) {
@@ -1369,7 +1370,7 @@
I,
w,
J,
- u || (it || !i.scroll ? null : { x: 0, y: 0 })
+ s || (it || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
Y = Y || t;
@@ -1446,7 +1447,7 @@
key: "handleRouteInfoError",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u, s) {
+ n.mark(function e(r, o, a, i, s, u) {
var l, f, h, p;
return n.wrap(
function(e) {
@@ -1459,11 +1460,11 @@
}
throw r;
case 2:
- if (!(0, c.isAssetError)(r) && !s) {
+ if (!(0, c.isAssetError)(r) && !u) {
e.next = 6;
break;
}
- throw (t.events.emit("routeChangeError", r, i, u),
+ throw (t.events.emit("routeChangeError", r, i, s),
(window.location.href = i),
b());
case 6:
@@ -1526,7 +1527,7 @@
o,
a,
i,
- u,
+ s,
!0
)
)
@@ -1554,8 +1555,8 @@
key: "getRouteInfo",
value: (function() {
var t = o(
- n.mark(function t(e, r, o, a, i, u) {
- var s,
+ n.mark(function t(e, r, o, a, i, s) {
+ var u,
c,
l,
f,
@@ -1571,15 +1572,15 @@
case 0:
if (
((t.prev = 0),
- (s = this.components[e]),
- !u.shallow || !s || this.route !== e)
+ (u = this.components[e]),
+ !s.shallow || !u || this.route !== e)
) {
t.next = 4;
break;
}
- return t.abrupt("return", s);
+ return t.abrupt("return", u);
case 4:
- if (!(c = s && "initial" in s ? void 0 : s)) {
+ if (!(c = u && "initial" in u ? void 0 : u)) {
t.next = 9;
break;
}
@@ -1644,7 +1645,7 @@
(t.t1 = t.catch(0)),
t.abrupt(
"return",
- this.handleRouteInfoError(t.t1, r, o, a, u)
+ this.handleRouteInfoError(t.t1, r, o, a, s)
)
);
case 30:
@@ -1687,21 +1688,21 @@
value: function(t) {
if (!this.asPath) return !1;
var e = this.asPath.split("#"),
- r = u(e, 2),
+ r = s(e, 2),
n = r[0],
o = r[1],
a = t.split("#"),
- i = u(a, 2),
- s = i[0],
+ i = s(a, 2),
+ u = i[0],
c = i[1];
- return !(!c || n !== s || o !== c) || (n === s && o !== c);
+ return !(!c || n !== u || o !== c) || (n === u && o !== c);
}
},
{
key: "scrollToHash",
value: function(t) {
var e = t.split("#"),
- r = u(e, 2)[1];
+ r = s(e, 2)[1];
if ("" !== r && "top" !== r) {
var n = document.getElementById(r);
if (n) n.scrollIntoView();
@@ -1727,7 +1728,7 @@
o,
a,
i,
- u,
+ s,
c,
l,
f,
@@ -1751,11 +1752,11 @@
this.pageLoader.getPageList()
);
case 7:
- (u = t.sent),
- (a = j(a, u, !1)).pathname !== i &&
+ (s = t.sent),
+ (a = j(a, s, !1)).pathname !== i &&
((i = a.pathname),
(e = (0, h.formatWithValidation)(a))),
- (c = (0, s.removePathTrailingSlash)(i)),
+ (c = (0, u.removePathTrailingSlash)(i)),
(l = r),
(t.next = 19);
break;
@@ -1764,11 +1765,11 @@
(f = p.__rewrites),
(v = (0, y.default)(
S(_(E(r), this.locale)),
- u,
+ s,
f,
a.query,
function(t) {
- return j({ pathname: t }, u).pathname;
+ return j({ pathname: t }, s).pathname;
},
this.locales
)).matchedPage &&
@@ -1906,7 +1907,17 @@
{
key: "_getServerData",
value: function(t) {
- return M(t, this.isSsr);
+ var e = this,
+ r = new URL(t, window.location.href).href;
+ return this.sdr[r]
+ ? this.sdr[r]
+ : (this.sdr[r] = M(t, this.isSsr)
+ .then(function(t) {
+ return delete e.sdr[r], t;
+ })
+ .catch(function(t) {
+ throw (delete e.sdr[r], t);
+ }));
}
},
{
@@ -1964,8 +1975,8 @@
e = i();
return t.substring(e.length);
}),
- (e.getDisplayName = u),
- (e.isResSent = s),
+ (e.getDisplayName = s),
+ (e.isResSent = u),
(e.loadGetInitialProps = c),
(e.formatWithValidation = function(t) {
0;
@@ -1983,10 +1994,10 @@
.concat(r)
.concat(n ? ":" + n : "");
}
- function u(t) {
+ function s(t) {
return "string" === typeof t ? t : t.displayName || t.name || "Unknown";
}
- function s(t) {
+ function u(t) {
return t.finished || t.headersSent;
}
function c(t, e) {
@@ -2023,7 +2034,7 @@
case 12:
return (t.next = 14), e.getInitialProps(r);
case 14:
- if (((a = t.sent), !o || !s(o))) {
+ if (((a = t.sent), !o || !u(o))) {
t.next = 17;
break;
}
@@ -2035,7 +2046,7 @@
}
throw ((i = '"'
.concat(
- u(e),
+ s(e),
'.getInitialProps()" should resolve to an object. But found "'
)
.concat(a, '" instead.')),
@@ -2115,8 +2126,8 @@
var r = new URL((0, n.getLocationOrigin)()),
a = e ? new URL(e, r) : r,
i = new URL(t, a),
- u = i.pathname,
- s = i.searchParams,
+ s = i.pathname,
+ u = i.searchParams,
c = i.search,
l = i.hash,
f = i.href;
@@ -2125,8 +2136,8 @@
"invariant: invalid relative URL, router received ".concat(t)
);
return {
- pathname: u,
- query: (0, o.searchParamsToUrlQuery)(s),
+ pathname: s,
+ query: (0, o.searchParamsToUrlQuery)(u),
search: c,
hash: l,
href: f.slice(r.origin.length)
@@ -2144,8 +2155,8 @@
o = "function" === typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
i = o.asyncIterator || "@@asyncIterator",
- u = o.toStringTag || "@@toStringTag";
- function s(t, e, r) {
+ s = o.toStringTag || "@@toStringTag";
+ function u(t, e, r) {
return (
Object.defineProperty(t, e, {
value: r,
@@ -2157,9 +2168,9 @@
);
}
try {
- s({}, "");
+ u({}, "");
} catch (I) {
- s = function(t, e, r) {
+ u = function(t, e, r) {
return (t[e] = r);
};
}
@@ -2179,10 +2190,10 @@
for (r.method = o, r.arg = a; ; ) {
var i = r.delegate;
if (i) {
- var u = S(i, r);
- if (u) {
- if (u === v) continue;
- return u;
+ var s = S(i, r);
+ if (s) {
+ if (s === v) continue;
+ return s;
}
}
if ("next" === r.method) r.sent = r._sent = r.arg;
@@ -2191,13 +2202,13 @@
r.dispatchException(r.arg);
} else "return" === r.method && r.abrupt("return", r.arg);
n = p;
- var s = l(t, e, r);
- if ("normal" === s.type) {
- if (((n = r.done ? d : h), s.arg === v)) continue;
- return { value: s.arg, done: r.done };
+ var u = l(t, e, r);
+ if ("normal" === u.type) {
+ if (((n = r.done ? d : h), u.arg === v)) continue;
+ return { value: u.arg, done: r.done };
}
- "throw" === s.type &&
- ((n = d), (r.method = "throw"), (r.arg = s.arg));
+ "throw" === u.type &&
+ ((n = d), (r.method = "throw"), (r.arg = u.arg));
}
};
})(t, r, i)),
@@ -2230,24 +2241,24 @@
var x = (g.prototype = y.prototype = Object.create(w));
function P(t) {
["next", "throw", "return"].forEach(function(e) {
- s(t, e, function(t) {
+ u(t, e, function(t) {
return this._invoke(e, t);
});
});
}
function k(t, e) {
- function r(o, a, i, u) {
- var s = l(t[o], t, a);
- if ("throw" !== s.type) {
- var c = s.arg,
+ function r(o, a, i, s) {
+ var u = l(t[o], t, a);
+ if ("throw" !== u.type) {
+ var c = u.arg,
f = c.value;
return f && "object" === typeof f && n.call(f, "__await")
? e.resolve(f.__await).then(
function(t) {
- r("next", t, i, u);
+ r("next", t, i, s);
},
function(t) {
- r("throw", t, i, u);
+ r("throw", t, i, s);
}
)
: e.resolve(f).then(
@@ -2255,11 +2266,11 @@
(c.value = t), i(c);
},
function(t) {
- return r("throw", t, i, u);
+ return r("throw", t, i, s);
}
);
}
- u(s.arg);
+ s(u.arg);
}
var o;
this._invoke = function(t, n) {
@@ -2347,7 +2358,7 @@
return (
(m.prototype = x.constructor = g),
(g.constructor = m),
- (m.displayName = s(g, u, "GeneratorFunction")),
+ (m.displayName = u(g, s, "GeneratorFunction")),
(t.isGeneratorFunction = function(t) {
var e = "function" === typeof t && t.constructor;
return (
@@ -2359,7 +2370,7 @@
return (
Object.setPrototypeOf
? Object.setPrototypeOf(t, g)
- : ((t.__proto__ = g), s(t, u, "GeneratorFunction")),
+ : ((t.__proto__ = g), u(t, s, "GeneratorFunction")),
(t.prototype = Object.create(x)),
t
);
@@ -2382,7 +2393,7 @@
});
}),
P(x),
- s(x, u, "Generator"),
+ u(x, s, "Generator"),
(x[a] = function() {
return this;
}),
@@ -2435,8 +2446,8 @@
var r = this;
function o(n, o) {
return (
- (u.type = "throw"),
- (u.arg = t),
+ (s.type = "throw"),
+ (s.arg = t),
(r.next = n),
o && ((r.method = "next"), (r.arg = e)),
!!o
@@ -2444,15 +2455,15 @@
}
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
var i = this.tryEntries[a],
- u = i.completion;
+ s = i.completion;
if ("root" === i.tryLoc) return o("end");
if (i.tryLoc <= this.prev) {
- var s = n.call(i, "catchLoc"),
+ var u = n.call(i, "catchLoc"),
c = n.call(i, "finallyLoc");
- if (s && c) {
+ if (u && c) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return o(i.finallyLoc);
- } else if (s) {
+ } else if (u) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
} else {
if (!c)
@@ -2554,16 +2565,16 @@
a = void 0;
try {
for (
- var i, u = t[Symbol.iterator]();
- !(n = (i = u.next()).done) &&
+ var i, s = t[Symbol.iterator]();
+ !(n = (i = s.next()).done) &&
(r.push(i.value), !e || r.length !== e);
n = !0
);
- } catch (s) {
- (o = !0), (a = s);
+ } catch (u) {
+ (o = !0), (a = u);
} finally {
try {
- n || null == u.return || u.return();
+ n || null == s.return || s.return();
} finally {
if (o) throw a;
}
@@ -2615,24 +2626,24 @@
);
}
var i,
- u = !0,
- s = !1;
+ s = !0,
+ u = !1;
return {
s: function() {
r = t[Symbol.iterator]();
},
n: function() {
var t = r.next();
- return (u = t.done), t;
+ return (s = t.done), t;
},
e: function(t) {
- (s = !0), (i = t);
+ (u = !0), (i = t);
},
f: function() {
try {
- u || null == r.return || r.return();
+ s || null == r.return || r.return();
} finally {
- if (s) throw i;
+ if (u) throw i;
}
}
};
@@ -2643,10 +2654,10 @@
return n;
}
var i = r("284h"),
- u = r("TqRt");
+ s = r("TqRt");
(e.__esModule = !0),
(e.useRouter = function() {
- return s.default.useContext(l.RouterContext);
+ return u.default.useContext(l.RouterContext);
}),
(e.makePublicRouterInstance = function(t) {
var e,
@@ -2660,8 +2671,8 @@
? (n[i] = r[i])
: (n[i] = Object.assign(Array.isArray(r[i]) ? [] : {}, r[i]));
}
- } catch (u) {
- a.e(u);
+ } catch (s) {
+ a.e(s);
} finally {
a.f();
}
@@ -2676,11 +2687,11 @@
);
}),
(e.createRouter = e.withRouter = e.default = void 0);
- var s = u(r("q1tI")),
+ var u = s(r("q1tI")),
c = i(r("elyg"));
(e.Router = c.default), (e.NextRouter = c.NextRouter);
var l = r("qOIg"),
- f = u(r("0Bsm"));
+ f = s(r("0Bsm"));
e.withRouter = f.default;
var h = {
router: null,
@@ -2833,12 +2844,12 @@
yXPU: function(t, e) {
function r(t, e, r, n, o, a, i) {
try {
- var u = t[a](i),
- s = u.value;
+ var s = t[a](i),
+ u = s.value;
} catch (c) {
return void r(c);
}
- u.done ? e(s) : Promise.resolve(s).then(n, o);
+ s.done ? e(u) : Promise.resolve(u).then(n, o);
}
t.exports = function(t) {
return function() {
@@ -2846,13 +2857,13 @@
n = arguments;
return new Promise(function(o, a) {
var i = t.apply(e, n);
- function u(t) {
- r(i, o, a, u, s, "next", t);
- }
function s(t) {
- r(i, o, a, u, s, "throw", t);
+ r(i, o, a, s, u, "next", t);
+ }
+ function u(t) {
+ r(i, o, a, s, u, "throw", t);
}
- u(void 0);
+ s(void 0);
});
};
};
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "SPMn71-IucioT3Mk7qk1h",
+ "buildId": "HGhxHxGx7xXzK9pXxBDFb",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_buildManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_ssgManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "SPMn71-IucioT3Mk7qk1h",
+ "buildId": "HGhxHxGx7xXzK9pXxBDFb",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_buildManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_ssgManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "SPMn71-IucioT3Mk7qk1h",
+ "buildId": "HGhxHxGx7xXzK9pXxBDFb",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_buildManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/SPMn71-IucioT3Mk7qk1h/_ssgManifest.js"
+ src="/_next/static/HGhxHxGx7xXzK9pXxBDFb/_ssgManifest.js"
async=""
></script>
</body>
Failing test suitesCommit: 00ab1bf test/integration/getserversideprops/test/index.test.js
Expand output● getServerSideProps › serverless mode › should output routes-manifest correctly
● getServerSideProps › production mode › should output routes-manifest correctly
|
Failing test suitesCommit: 1b46664 test/integration/build-output/test/index.test.js
Expand output● Build Output › Basic Application Output › should not deviate from snapshot
|
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 12.6s | 12s | -580ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.154 | 2.091 | -0.06 |
/ avg req/sec | 1160.88 | 1195.42 | +34.54 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.402 | 1.328 | -0.07 |
/error-in-render avg req/sec | 1783.47 | 1882.82 | +99.35 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 614 B | 616 B | |
link.html gzip | 620 B | 621 B | |
withRouter.html gzip | 609 B | 609 B | ✓ |
Overall change | 1.84 kB | 1.85 kB |
Diffs
Diff for 677f882d2ed8..5ec6837e3.js
@@ -1589,6 +1589,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
* Map of all components loaded in `Router`
*/
// Static Data Cache
+ // In-flight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) {
var _this = this;
@@ -1615,6 +1616,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.basePath = void 0;
this.components = void 0;
this.sdc = {};
+ this.sdr = {};
this.sub = void 0;
this.clc = void 0;
this.pageLoader = void 0;
@@ -3205,7 +3207,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
{
key: "_getServerData",
value: function _getServerData(dataHref) {
- return fetchNextData(dataHref, this.isSsr);
+ var _this6 = this;
+
+ var _URL2 = new URL(dataHref, window.location.href),
+ resourceKey = _URL2.href;
+
+ if (this.sdr[resourceKey]) {
+ return this.sdr[resourceKey];
+ }
+
+ return (this.sdr[resourceKey] = fetchNextData(
+ dataHref,
+ this.isSsr
+ )
+ .then(function(data) {
+ delete _this6.sdr[resourceKey];
+ return data;
+ })
+ ["catch"](function(err) {
+ delete _this6.sdr[resourceKey];
+ throw err;
+ }));
}
},
{
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 14.5s | 14s | -469ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..df71.js gzip | N/A | 13.4 kB | N/A |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_error.js | 1.02 MB | 1.02 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.5 kB | 10.5 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.02 MB | 1.02 MB | ✓ |
link.js | 1.08 MB | 1.08 MB | |
routerDirect.js | 1.07 MB | 1.07 MB | |
withRouter.js | 1.07 MB | 1.07 MB | |
Overall change | 5.27 MB | 5.27 MB |
Webpack 5 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 14s | 13.9s | -127ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.051 | 2.047 | 0 |
/ avg req/sec | 1219.05 | 1221.29 | +2.24 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.288 | 1.343 | |
/error-in-render avg req/sec | 1940.91 | 1861.57 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
597-74632e79..1d47.js gzip | 13.3 kB | 13.3 kB | |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.6 kB | 6.6 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 586 B | 585 B | -1 B |
link.html gzip | 592 B | 592 B | ✓ |
withRouter.html gzip | 581 B | 581 B | ✓ |
Overall change | 1.76 kB | 1.76 kB | -1 B |
Diffs
Diff for 677f882d2ed8..eaa79e7a0.js
@@ -75,9 +75,9 @@
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in t)
if (Object.prototype.hasOwnProperty.call(t, i)) {
- var u = a ? Object.getOwnPropertyDescriptor(t, i) : null;
- u && (u.get || u.set)
- ? Object.defineProperty(r, i, u)
+ var s = a ? Object.getOwnPropertyDescriptor(t, i) : null;
+ s && (s.get || s.set)
+ ? Object.defineProperty(r, i, s)
: (r[i] = t[i]);
}
return (r.default = t), e && e.set(t, r), r;
@@ -168,8 +168,8 @@
r = t.hostname,
o = t.protocol || "",
i = t.pathname || "",
- u = t.hash || "",
- s = t.query || "",
+ s = t.hash || "",
+ u = t.query || "",
c = !1;
(e = e ? encodeURIComponent(e).replace(/%3A/i, ":") + "@" : ""),
t.host
@@ -177,15 +177,15 @@
: r &&
((c = e + (~r.indexOf(":") ? "[".concat(r, "]") : r)),
t.port && (c += ":" + t.port));
- s &&
- "object" === typeof s &&
- (s = String(n.urlQueryToSearchParams(s)));
- var l = t.search || (s && "?".concat(s)) || "";
+ u &&
+ "object" === typeof u &&
+ (u = String(n.urlQueryToSearchParams(u)));
+ var l = t.search || (u && "?".concat(u)) || "";
o && ":" !== o.substr(-1) && (o += ":");
t.slashes || ((!o || a.test(o)) && !1 !== c)
? ((c = "//" + (c || "")), i && "/" !== i[0] && (i = "/" + i))
: c || (c = "");
- u && "#" !== u[0] && (u = "#" + u);
+ s && "#" !== s[0] && (s = "#" + s);
l && "?" !== l[0] && (l = "?" + l);
return (
(i = i.replace(/[?#]/g, encodeURIComponent)),
@@ -195,7 +195,7 @@
.concat(c)
.concat(i)
.concat(l)
- .concat(u)
+ .concat(s)
);
});
var n = (function(t) {
@@ -272,8 +272,8 @@
(e.getClientBuildManifest = p),
(e.default = void 0);
i(r("Lab5"));
- var u = r("0G5g");
- function s(t, e, r) {
+ var s = r("0G5g");
+ function u(t, e, r) {
var n,
o = e.get(t);
if (o) return "future" in o ? o.future : Promise.resolve(o);
@@ -306,7 +306,7 @@
}
function h(t, e) {
return new Promise(function(r, n) {
- return (0, u.requestIdleCallback)(function() {
+ return (0, s.requestIdleCallback)(function() {
return setTimeout(function() {
return n(e);
}, t);
@@ -397,7 +397,7 @@
}
return {
whenEntrypoint: function(t) {
- return s(t, e);
+ return u(t, e);
},
onEntrypoint: function(t, r) {
Promise.resolve(r)
@@ -419,12 +419,12 @@
},
loadRoute: function(r) {
var i = this;
- return s(
+ return u(
r,
l,
a(
n.mark(function a() {
- var u, s, c, l, y, m, g, w;
+ var s, u, c, l, y, m, g, w;
return n.wrap(
function(n) {
for (;;)
@@ -433,12 +433,12 @@
return (n.prev = 0), (n.next = 3), d(t, r);
case 3:
return (
- (u = n.sent),
- (s = u.scripts),
- (c = u.css),
+ (s = n.sent),
+ (u = s.scripts),
+ (c = s.css),
(n.next = 8),
Promise.all([
- e.has(r) ? [] : Promise.all(s.map(p)),
+ e.has(r) ? [] : Promise.all(u.map(p)),
Promise.all(c.map(v))
])
);
@@ -527,7 +527,7 @@
);
})
.then(function() {
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return n.loadRoute(e);
});
})
@@ -713,7 +713,7 @@
o = r("yXPU"),
a = r("lwsE"),
i = r("W8MJ"),
- u = r("J4zp");
+ s = r("J4zp");
(e.__esModule = !0),
(e.getDomainLocale = function(t, e, r, n) {
0;
@@ -728,7 +728,7 @@
(e.interpolateAs = L),
(e.resolveHref = O),
(e.default = void 0);
- var s = r("X24+"),
+ var u = r("X24+"),
c = r("Nh2W"),
l = r("wkBG"),
f = (r("3wub"), w(r("dZ6Y"))),
@@ -763,7 +763,7 @@
return (function(t, e) {
return e && t.startsWith("/")
? "/" === t
- ? (0, s.normalizePathTrailingSlash)(e)
+ ? (0, u.normalizePathTrailingSlash)(e)
: "".concat(e).concat("/" === P(t) ? t.substring(1) : t)
: t;
})(t, "");
@@ -789,21 +789,21 @@
a = o.groups,
i = (e !== t ? (0, m.getRouteMatcher)(o)(e) : "") || r;
n = t;
- var u = Object.keys(a);
+ var s = Object.keys(a);
return (
- u.every(function(t) {
+ s.every(function(t) {
var e = i[t] || "",
r = a[t],
o = r.repeat,
- u = r.optional,
- s = "[".concat(o ? "..." : "").concat(t, "]");
+ s = r.optional,
+ u = "[".concat(o ? "..." : "").concat(t, "]");
return (
- u && (s = "".concat(e ? "" : "/", "[").concat(s, "]")),
+ s && (u = "".concat(e ? "" : "/", "[").concat(u, "]")),
o && !Array.isArray(e) && (e = [e]),
- (u || t in i) &&
+ (s || t in i) &&
(n =
n.replace(
- s,
+ u,
o
? e
.map(function(t) {
@@ -814,7 +814,7 @@
) || "/")
);
}) || (n = ""),
- { params: u, result: n }
+ { params: s, result: n }
);
}
function C(t, e) {
@@ -832,18 +832,18 @@
if (!R(o)) return r ? [o] : o;
try {
var a = new URL(o, n);
- a.pathname = (0, s.normalizePathTrailingSlash)(a.pathname);
+ a.pathname = (0, u.normalizePathTrailingSlash)(a.pathname);
var i = "";
if ((0, p.isDynamicRoute)(a.pathname) && a.searchParams && r) {
- var u = (0, v.searchParamsToUrlQuery)(a.searchParams),
- c = L(a.pathname, a.pathname, u),
+ var s = (0, v.searchParamsToUrlQuery)(a.searchParams),
+ c = L(a.pathname, a.pathname, s),
l = c.result,
f = c.params;
l &&
(i = (0, h.formatWithValidation)({
pathname: l,
hash: a.hash,
- query: C(u, f)
+ query: C(s, f)
}));
}
var d =
@@ -859,12 +859,12 @@
}
function T(t, e, r) {
var n = O(t.pathname, e, !0),
- o = u(n, 2),
+ o = s(n, 2),
a = o[0],
i = o[1],
- s = (0, h.getLocationOrigin)(),
- c = a.startsWith(s),
- l = i && i.startsWith(s);
+ u = (0, h.getLocationOrigin)(),
+ c = a.startsWith(u),
+ l = i && i.startsWith(u);
(a = I(a)), (i = i ? I(i) : i);
var f = c ? a : S(a),
p = r ? I(O(t.pathname, r)) : i || a;
@@ -874,7 +874,7 @@
var r =
!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
n = t.pathname,
- o = (0, s.removePathTrailingSlash)(
+ o = (0, u.removePathTrailingSlash)(
(0, l.denormalizePagePath)(r ? E(n) : n)
);
return (
@@ -888,7 +888,7 @@
)
return (t.pathname = r ? S(e) : e), !0;
}),
- (t.pathname = (0, s.removePathTrailingSlash)(t.pathname))),
+ (t.pathname = (0, u.removePathTrailingSlash)(t.pathname))),
t
);
}
@@ -915,7 +915,7 @@
var N = (function() {
function t(e, r, n, o) {
var i = this,
- u = o.initialProps,
+ s = o.initialProps,
c = o.pageLoader,
l = o.App,
f = o.wrapApp,
@@ -933,6 +933,7 @@
(this.basePath = void 0),
(this.components = void 0),
(this.sdc = {}),
+ (this.sdr = {}),
(this.sub = void 0),
(this.clc = void 0),
(this.pageLoader = void 0),
@@ -960,8 +961,8 @@
o = e.options,
a = e.idx;
i._idx = a;
- var u = (0, d.parseRelativeUrl)(r).pathname;
- (i.isSsr && n === i.asPath && u === i.pathname) ||
+ var s = (0, d.parseRelativeUrl)(r).pathname;
+ (i.isSsr && n === i.asPath && s === i.pathname) ||
(i._bps && !i._bps(e)) ||
i.change(
"replaceState",
@@ -975,25 +976,25 @@
);
}
} else {
- var s = i.pathname,
+ var u = i.pathname,
c = i.query;
i.changeState(
"replaceState",
- (0, h.formatWithValidation)({ pathname: S(s), query: c }),
+ (0, h.formatWithValidation)({ pathname: S(u), query: c }),
(0, h.getURL)()
);
}
}),
- (this.route = (0, s.removePathTrailingSlash)(e)),
+ (this.route = (0, u.removePathTrailingSlash)(e)),
(this.components = {}),
"/_error" !== e &&
(this.components[this.route] = {
Component: v,
initial: !0,
- props: u,
+ props: s,
err: y,
- __N_SSG: u && u.__N_SSG,
- __N_SSP: u && u.__N_SSP
+ __N_SSG: s && s.__N_SSG,
+ __N_SSP: s && s.__N_SSP
}),
(this.components["/_app"] = { Component: l, styleSheets: [] }),
(this.events = t.events),
@@ -1068,7 +1069,7 @@
key: "change",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u) {
+ n.mark(function e(r, o, a, i, s) {
var l,
f,
v,
@@ -1188,10 +1189,10 @@
((O = b.pathname),
(o = (0, h.formatWithValidation)(b))),
(O = O
- ? (0, s.removePathTrailingSlash)(E(O))
+ ? (0, u.removePathTrailingSlash)(E(O))
: O),
this.urlIsNew(w) || f || (r = "replaceState"),
- (N = (0, s.removePathTrailingSlash)(O)),
+ (N = (0, u.removePathTrailingSlash)(O)),
(U = a),
R(a))
) {
@@ -1369,7 +1370,7 @@
I,
w,
J,
- u || (it || !i.scroll ? null : { x: 0, y: 0 })
+ s || (it || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
Y = Y || t;
@@ -1446,7 +1447,7 @@
key: "handleRouteInfoError",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u, s) {
+ n.mark(function e(r, o, a, i, s, u) {
var l, f, h, p;
return n.wrap(
function(e) {
@@ -1459,11 +1460,11 @@
}
throw r;
case 2:
- if (!(0, c.isAssetError)(r) && !s) {
+ if (!(0, c.isAssetError)(r) && !u) {
e.next = 6;
break;
}
- throw (t.events.emit("routeChangeError", r, i, u),
+ throw (t.events.emit("routeChangeError", r, i, s),
(window.location.href = i),
b());
case 6:
@@ -1526,7 +1527,7 @@
o,
a,
i,
- u,
+ s,
!0
)
)
@@ -1554,8 +1555,8 @@
key: "getRouteInfo",
value: (function() {
var t = o(
- n.mark(function t(e, r, o, a, i, u) {
- var s,
+ n.mark(function t(e, r, o, a, i, s) {
+ var u,
c,
l,
f,
@@ -1571,15 +1572,15 @@
case 0:
if (
((t.prev = 0),
- (s = this.components[e]),
- !u.shallow || !s || this.route !== e)
+ (u = this.components[e]),
+ !s.shallow || !u || this.route !== e)
) {
t.next = 4;
break;
}
- return t.abrupt("return", s);
+ return t.abrupt("return", u);
case 4:
- if (!(c = s && "initial" in s ? void 0 : s)) {
+ if (!(c = u && "initial" in u ? void 0 : u)) {
t.next = 9;
break;
}
@@ -1644,7 +1645,7 @@
(t.t1 = t.catch(0)),
t.abrupt(
"return",
- this.handleRouteInfoError(t.t1, r, o, a, u)
+ this.handleRouteInfoError(t.t1, r, o, a, s)
)
);
case 30:
@@ -1687,21 +1688,21 @@
value: function(t) {
if (!this.asPath) return !1;
var e = this.asPath.split("#"),
- r = u(e, 2),
+ r = s(e, 2),
n = r[0],
o = r[1],
a = t.split("#"),
- i = u(a, 2),
- s = i[0],
+ i = s(a, 2),
+ u = i[0],
c = i[1];
- return !(!c || n !== s || o !== c) || (n === s && o !== c);
+ return !(!c || n !== u || o !== c) || (n === u && o !== c);
}
},
{
key: "scrollToHash",
value: function(t) {
var e = t.split("#"),
- r = u(e, 2)[1];
+ r = s(e, 2)[1];
if ("" !== r && "top" !== r) {
var n = document.getElementById(r);
if (n) n.scrollIntoView();
@@ -1727,7 +1728,7 @@
o,
a,
i,
- u,
+ s,
c,
l,
f,
@@ -1751,11 +1752,11 @@
this.pageLoader.getPageList()
);
case 7:
- (u = t.sent),
- (a = j(a, u, !1)).pathname !== i &&
+ (s = t.sent),
+ (a = j(a, s, !1)).pathname !== i &&
((i = a.pathname),
(e = (0, h.formatWithValidation)(a))),
- (c = (0, s.removePathTrailingSlash)(i)),
+ (c = (0, u.removePathTrailingSlash)(i)),
(l = r),
(t.next = 19);
break;
@@ -1764,11 +1765,11 @@
(f = p.__rewrites),
(v = (0, y.default)(
S(_(E(r), this.locale)),
- u,
+ s,
f,
a.query,
function(t) {
- return j({ pathname: t }, u).pathname;
+ return j({ pathname: t }, s).pathname;
},
this.locales
)).matchedPage &&
@@ -1906,7 +1907,17 @@
{
key: "_getServerData",
value: function(t) {
- return M(t, this.isSsr);
+ var e = this,
+ r = new URL(t, window.location.href).href;
+ return this.sdr[r]
+ ? this.sdr[r]
+ : (this.sdr[r] = M(t, this.isSsr)
+ .then(function(t) {
+ return delete e.sdr[r], t;
+ })
+ .catch(function(t) {
+ throw (delete e.sdr[r], t);
+ }));
}
},
{
@@ -1964,8 +1975,8 @@
e = i();
return t.substring(e.length);
}),
- (e.getDisplayName = u),
- (e.isResSent = s),
+ (e.getDisplayName = s),
+ (e.isResSent = u),
(e.loadGetInitialProps = c),
(e.formatWithValidation = function(t) {
0;
@@ -1983,10 +1994,10 @@
.concat(r)
.concat(n ? ":" + n : "");
}
- function u(t) {
+ function s(t) {
return "string" === typeof t ? t : t.displayName || t.name || "Unknown";
}
- function s(t) {
+ function u(t) {
return t.finished || t.headersSent;
}
function c(t, e) {
@@ -2023,7 +2034,7 @@
case 12:
return (t.next = 14), e.getInitialProps(r);
case 14:
- if (((a = t.sent), !o || !s(o))) {
+ if (((a = t.sent), !o || !u(o))) {
t.next = 17;
break;
}
@@ -2035,7 +2046,7 @@
}
throw ((i = '"'
.concat(
- u(e),
+ s(e),
'.getInitialProps()" should resolve to an object. But found "'
)
.concat(a, '" instead.')),
@@ -2115,8 +2126,8 @@
var r = new URL((0, n.getLocationOrigin)()),
a = e ? new URL(e, r) : r,
i = new URL(t, a),
- u = i.pathname,
- s = i.searchParams,
+ s = i.pathname,
+ u = i.searchParams,
c = i.search,
l = i.hash,
f = i.href;
@@ -2125,8 +2136,8 @@
"invariant: invalid relative URL, router received ".concat(t)
);
return {
- pathname: u,
- query: (0, o.searchParamsToUrlQuery)(s),
+ pathname: s,
+ query: (0, o.searchParamsToUrlQuery)(u),
search: c,
hash: l,
href: f.slice(r.origin.length)
@@ -2144,8 +2155,8 @@
o = "function" === typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
i = o.asyncIterator || "@@asyncIterator",
- u = o.toStringTag || "@@toStringTag";
- function s(t, e, r) {
+ s = o.toStringTag || "@@toStringTag";
+ function u(t, e, r) {
return (
Object.defineProperty(t, e, {
value: r,
@@ -2157,9 +2168,9 @@
);
}
try {
- s({}, "");
+ u({}, "");
} catch (I) {
- s = function(t, e, r) {
+ u = function(t, e, r) {
return (t[e] = r);
};
}
@@ -2179,10 +2190,10 @@
for (r.method = o, r.arg = a; ; ) {
var i = r.delegate;
if (i) {
- var u = S(i, r);
- if (u) {
- if (u === v) continue;
- return u;
+ var s = S(i, r);
+ if (s) {
+ if (s === v) continue;
+ return s;
}
}
if ("next" === r.method) r.sent = r._sent = r.arg;
@@ -2191,13 +2202,13 @@
r.dispatchException(r.arg);
} else "return" === r.method && r.abrupt("return", r.arg);
n = p;
- var s = l(t, e, r);
- if ("normal" === s.type) {
- if (((n = r.done ? d : h), s.arg === v)) continue;
- return { value: s.arg, done: r.done };
+ var u = l(t, e, r);
+ if ("normal" === u.type) {
+ if (((n = r.done ? d : h), u.arg === v)) continue;
+ return { value: u.arg, done: r.done };
}
- "throw" === s.type &&
- ((n = d), (r.method = "throw"), (r.arg = s.arg));
+ "throw" === u.type &&
+ ((n = d), (r.method = "throw"), (r.arg = u.arg));
}
};
})(t, r, i)),
@@ -2230,24 +2241,24 @@
var x = (g.prototype = y.prototype = Object.create(w));
function P(t) {
["next", "throw", "return"].forEach(function(e) {
- s(t, e, function(t) {
+ u(t, e, function(t) {
return this._invoke(e, t);
});
});
}
function k(t, e) {
- function r(o, a, i, u) {
- var s = l(t[o], t, a);
- if ("throw" !== s.type) {
- var c = s.arg,
+ function r(o, a, i, s) {
+ var u = l(t[o], t, a);
+ if ("throw" !== u.type) {
+ var c = u.arg,
f = c.value;
return f && "object" === typeof f && n.call(f, "__await")
? e.resolve(f.__await).then(
function(t) {
- r("next", t, i, u);
+ r("next", t, i, s);
},
function(t) {
- r("throw", t, i, u);
+ r("throw", t, i, s);
}
)
: e.resolve(f).then(
@@ -2255,11 +2266,11 @@
(c.value = t), i(c);
},
function(t) {
- return r("throw", t, i, u);
+ return r("throw", t, i, s);
}
);
}
- u(s.arg);
+ s(u.arg);
}
var o;
this._invoke = function(t, n) {
@@ -2347,7 +2358,7 @@
return (
(m.prototype = x.constructor = g),
(g.constructor = m),
- (m.displayName = s(g, u, "GeneratorFunction")),
+ (m.displayName = u(g, s, "GeneratorFunction")),
(t.isGeneratorFunction = function(t) {
var e = "function" === typeof t && t.constructor;
return (
@@ -2359,7 +2370,7 @@
return (
Object.setPrototypeOf
? Object.setPrototypeOf(t, g)
- : ((t.__proto__ = g), s(t, u, "GeneratorFunction")),
+ : ((t.__proto__ = g), u(t, s, "GeneratorFunction")),
(t.prototype = Object.create(x)),
t
);
@@ -2382,7 +2393,7 @@
});
}),
P(x),
- s(x, u, "Generator"),
+ u(x, s, "Generator"),
(x[a] = function() {
return this;
}),
@@ -2435,8 +2446,8 @@
var r = this;
function o(n, o) {
return (
- (u.type = "throw"),
- (u.arg = t),
+ (s.type = "throw"),
+ (s.arg = t),
(r.next = n),
o && ((r.method = "next"), (r.arg = e)),
!!o
@@ -2444,15 +2455,15 @@
}
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
var i = this.tryEntries[a],
- u = i.completion;
+ s = i.completion;
if ("root" === i.tryLoc) return o("end");
if (i.tryLoc <= this.prev) {
- var s = n.call(i, "catchLoc"),
+ var u = n.call(i, "catchLoc"),
c = n.call(i, "finallyLoc");
- if (s && c) {
+ if (u && c) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return o(i.finallyLoc);
- } else if (s) {
+ } else if (u) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
} else {
if (!c)
@@ -2554,16 +2565,16 @@
a = void 0;
try {
for (
- var i, u = t[Symbol.iterator]();
- !(n = (i = u.next()).done) &&
+ var i, s = t[Symbol.iterator]();
+ !(n = (i = s.next()).done) &&
(r.push(i.value), !e || r.length !== e);
n = !0
);
- } catch (s) {
- (o = !0), (a = s);
+ } catch (u) {
+ (o = !0), (a = u);
} finally {
try {
- n || null == u.return || u.return();
+ n || null == s.return || s.return();
} finally {
if (o) throw a;
}
@@ -2615,24 +2626,24 @@
);
}
var i,
- u = !0,
- s = !1;
+ s = !0,
+ u = !1;
return {
s: function() {
r = t[Symbol.iterator]();
},
n: function() {
var t = r.next();
- return (u = t.done), t;
+ return (s = t.done), t;
},
e: function(t) {
- (s = !0), (i = t);
+ (u = !0), (i = t);
},
f: function() {
try {
- u || null == r.return || r.return();
+ s || null == r.return || r.return();
} finally {
- if (s) throw i;
+ if (u) throw i;
}
}
};
@@ -2643,10 +2654,10 @@
return n;
}
var i = r("284h"),
- u = r("TqRt");
+ s = r("TqRt");
(e.__esModule = !0),
(e.useRouter = function() {
- return s.default.useContext(l.RouterContext);
+ return u.default.useContext(l.RouterContext);
}),
(e.makePublicRouterInstance = function(t) {
var e,
@@ -2660,8 +2671,8 @@
? (n[i] = r[i])
: (n[i] = Object.assign(Array.isArray(r[i]) ? [] : {}, r[i]));
}
- } catch (u) {
- a.e(u);
+ } catch (s) {
+ a.e(s);
} finally {
a.f();
}
@@ -2676,11 +2687,11 @@
);
}),
(e.createRouter = e.withRouter = e.default = void 0);
- var s = u(r("q1tI")),
+ var u = s(r("q1tI")),
c = i(r("elyg"));
(e.Router = c.default), (e.NextRouter = c.NextRouter);
var l = r("qOIg"),
- f = u(r("0Bsm"));
+ f = s(r("0Bsm"));
e.withRouter = f.default;
var h = {
router: null,
@@ -2833,12 +2844,12 @@
yXPU: function(t, e) {
function r(t, e, r, n, o, a, i) {
try {
- var u = t[a](i),
- s = u.value;
+ var s = t[a](i),
+ u = s.value;
} catch (c) {
return void r(c);
}
- u.done ? e(s) : Promise.resolve(s).then(n, o);
+ s.done ? e(u) : Promise.resolve(u).then(n, o);
}
t.exports = function(t) {
return function() {
@@ -2846,13 +2857,13 @@
n = arguments;
return new Promise(function(o, a) {
var i = t.apply(e, n);
- function u(t) {
- r(i, o, a, u, s, "next", t);
- }
function s(t) {
- r(i, o, a, u, s, "throw", t);
+ r(i, o, a, s, u, "next", t);
+ }
+ function u(t) {
+ r(i, o, a, s, u, "throw", t);
}
- u(void 0);
+ s(void 0);
});
};
};
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "ckZec2DWmnlK8WPac5fd6",
+ "buildId": "qhAFcLnrvXUAG7lLP8DmK",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_buildManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_ssgManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "ckZec2DWmnlK8WPac5fd6",
+ "buildId": "qhAFcLnrvXUAG7lLP8DmK",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_buildManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_ssgManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "ckZec2DWmnlK8WPac5fd6",
+ "buildId": "qhAFcLnrvXUAG7lLP8DmK",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_buildManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/ckZec2DWmnlK8WPac5fd6/_ssgManifest.js"
+ src="/_next/static/qhAFcLnrvXUAG7lLP8DmK/_ssgManifest.js"
async=""
></script>
</body>
Failing test suitesCommit: cbf02ef test/integration/build-output/test/index.test.js
Expand output● Build Output › Basic Application Output › should not deviate from snapshot
|
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 11.7s | 11.5s | -267ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.982 | 1.993 | |
/ avg req/sec | 1261.2 | 1254.38 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.24 | 1.221 | -0.02 |
/error-in-render avg req/sec | 2016.82 | 2046.94 | +30.12 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 614 B | 616 B | |
link.html gzip | 620 B | 621 B | |
withRouter.html gzip | 609 B | 609 B | ✓ |
Overall change | 1.84 kB | 1.85 kB |
Diffs
Diff for 677f882d2ed8..5ec6837e3.js
@@ -1589,6 +1589,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
* Map of all components loaded in `Router`
*/
// Static Data Cache
+ // In-flight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) {
var _this = this;
@@ -1615,6 +1616,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.basePath = void 0;
this.components = void 0;
this.sdc = {};
+ this.sdr = {};
this.sub = void 0;
this.clc = void 0;
this.pageLoader = void 0;
@@ -3205,7 +3207,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
{
key: "_getServerData",
value: function _getServerData(dataHref) {
- return fetchNextData(dataHref, this.isSsr);
+ var _this6 = this;
+
+ var _URL2 = new URL(dataHref, window.location.href),
+ resourceKey = _URL2.href;
+
+ if (this.sdr[resourceKey]) {
+ return this.sdr[resourceKey];
+ }
+
+ return (this.sdr[resourceKey] = fetchNextData(
+ dataHref,
+ this.isSsr
+ )
+ .then(function(data) {
+ delete _this6.sdr[resourceKey];
+ return data;
+ })
+ ["catch"](function(err) {
+ delete _this6.sdr[resourceKey];
+ throw err;
+ }));
}
},
{
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 13.7s | 13.7s | |
nodeModulesSize | 42.8 MB | 42.8 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..df71.js gzip | N/A | 13.4 kB | N/A |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_error.js | 1.02 MB | 1.02 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.5 kB | 10.5 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.02 MB | 1.02 MB | ✓ |
link.js | 1.08 MB | 1.08 MB | |
routerDirect.js | 1.07 MB | 1.07 MB | |
withRouter.js | 1.07 MB | 1.07 MB | |
Overall change | 5.27 MB | 5.27 MB |
Webpack 5 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 13.4s | 13.4s | -1ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.933 | 1.952 | |
/ avg req/sec | 1293.6 | 1280.72 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.222 | 1.229 | |
/error-in-render avg req/sec | 2046.32 | 2034.43 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
597-74632e79..1d47.js gzip | 13.3 kB | 13.3 kB | |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.6 kB | 6.6 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 586 B | 585 B | -1 B |
link.html gzip | 592 B | 592 B | ✓ |
withRouter.html gzip | 581 B | 581 B | ✓ |
Overall change | 1.76 kB | 1.76 kB | -1 B |
Diffs
Diff for 677f882d2ed8..eaa79e7a0.js
@@ -75,9 +75,9 @@
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in t)
if (Object.prototype.hasOwnProperty.call(t, i)) {
- var u = a ? Object.getOwnPropertyDescriptor(t, i) : null;
- u && (u.get || u.set)
- ? Object.defineProperty(r, i, u)
+ var s = a ? Object.getOwnPropertyDescriptor(t, i) : null;
+ s && (s.get || s.set)
+ ? Object.defineProperty(r, i, s)
: (r[i] = t[i]);
}
return (r.default = t), e && e.set(t, r), r;
@@ -168,8 +168,8 @@
r = t.hostname,
o = t.protocol || "",
i = t.pathname || "",
- u = t.hash || "",
- s = t.query || "",
+ s = t.hash || "",
+ u = t.query || "",
c = !1;
(e = e ? encodeURIComponent(e).replace(/%3A/i, ":") + "@" : ""),
t.host
@@ -177,15 +177,15 @@
: r &&
((c = e + (~r.indexOf(":") ? "[".concat(r, "]") : r)),
t.port && (c += ":" + t.port));
- s &&
- "object" === typeof s &&
- (s = String(n.urlQueryToSearchParams(s)));
- var l = t.search || (s && "?".concat(s)) || "";
+ u &&
+ "object" === typeof u &&
+ (u = String(n.urlQueryToSearchParams(u)));
+ var l = t.search || (u && "?".concat(u)) || "";
o && ":" !== o.substr(-1) && (o += ":");
t.slashes || ((!o || a.test(o)) && !1 !== c)
? ((c = "//" + (c || "")), i && "/" !== i[0] && (i = "/" + i))
: c || (c = "");
- u && "#" !== u[0] && (u = "#" + u);
+ s && "#" !== s[0] && (s = "#" + s);
l && "?" !== l[0] && (l = "?" + l);
return (
(i = i.replace(/[?#]/g, encodeURIComponent)),
@@ -195,7 +195,7 @@
.concat(c)
.concat(i)
.concat(l)
- .concat(u)
+ .concat(s)
);
});
var n = (function(t) {
@@ -272,8 +272,8 @@
(e.getClientBuildManifest = p),
(e.default = void 0);
i(r("Lab5"));
- var u = r("0G5g");
- function s(t, e, r) {
+ var s = r("0G5g");
+ function u(t, e, r) {
var n,
o = e.get(t);
if (o) return "future" in o ? o.future : Promise.resolve(o);
@@ -306,7 +306,7 @@
}
function h(t, e) {
return new Promise(function(r, n) {
- return (0, u.requestIdleCallback)(function() {
+ return (0, s.requestIdleCallback)(function() {
return setTimeout(function() {
return n(e);
}, t);
@@ -397,7 +397,7 @@
}
return {
whenEntrypoint: function(t) {
- return s(t, e);
+ return u(t, e);
},
onEntrypoint: function(t, r) {
Promise.resolve(r)
@@ -419,12 +419,12 @@
},
loadRoute: function(r) {
var i = this;
- return s(
+ return u(
r,
l,
a(
n.mark(function a() {
- var u, s, c, l, y, m, g, w;
+ var s, u, c, l, y, m, g, w;
return n.wrap(
function(n) {
for (;;)
@@ -433,12 +433,12 @@
return (n.prev = 0), (n.next = 3), d(t, r);
case 3:
return (
- (u = n.sent),
- (s = u.scripts),
- (c = u.css),
+ (s = n.sent),
+ (u = s.scripts),
+ (c = s.css),
(n.next = 8),
Promise.all([
- e.has(r) ? [] : Promise.all(s.map(p)),
+ e.has(r) ? [] : Promise.all(u.map(p)),
Promise.all(c.map(v))
])
);
@@ -527,7 +527,7 @@
);
})
.then(function() {
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return n.loadRoute(e);
});
})
@@ -713,7 +713,7 @@
o = r("yXPU"),
a = r("lwsE"),
i = r("W8MJ"),
- u = r("J4zp");
+ s = r("J4zp");
(e.__esModule = !0),
(e.getDomainLocale = function(t, e, r, n) {
0;
@@ -728,7 +728,7 @@
(e.interpolateAs = L),
(e.resolveHref = O),
(e.default = void 0);
- var s = r("X24+"),
+ var u = r("X24+"),
c = r("Nh2W"),
l = r("wkBG"),
f = (r("3wub"), w(r("dZ6Y"))),
@@ -763,7 +763,7 @@
return (function(t, e) {
return e && t.startsWith("/")
? "/" === t
- ? (0, s.normalizePathTrailingSlash)(e)
+ ? (0, u.normalizePathTrailingSlash)(e)
: "".concat(e).concat("/" === P(t) ? t.substring(1) : t)
: t;
})(t, "");
@@ -789,21 +789,21 @@
a = o.groups,
i = (e !== t ? (0, m.getRouteMatcher)(o)(e) : "") || r;
n = t;
- var u = Object.keys(a);
+ var s = Object.keys(a);
return (
- u.every(function(t) {
+ s.every(function(t) {
var e = i[t] || "",
r = a[t],
o = r.repeat,
- u = r.optional,
- s = "[".concat(o ? "..." : "").concat(t, "]");
+ s = r.optional,
+ u = "[".concat(o ? "..." : "").concat(t, "]");
return (
- u && (s = "".concat(e ? "" : "/", "[").concat(s, "]")),
+ s && (u = "".concat(e ? "" : "/", "[").concat(u, "]")),
o && !Array.isArray(e) && (e = [e]),
- (u || t in i) &&
+ (s || t in i) &&
(n =
n.replace(
- s,
+ u,
o
? e
.map(function(t) {
@@ -814,7 +814,7 @@
) || "/")
);
}) || (n = ""),
- { params: u, result: n }
+ { params: s, result: n }
);
}
function C(t, e) {
@@ -832,18 +832,18 @@
if (!R(o)) return r ? [o] : o;
try {
var a = new URL(o, n);
- a.pathname = (0, s.normalizePathTrailingSlash)(a.pathname);
+ a.pathname = (0, u.normalizePathTrailingSlash)(a.pathname);
var i = "";
if ((0, p.isDynamicRoute)(a.pathname) && a.searchParams && r) {
- var u = (0, v.searchParamsToUrlQuery)(a.searchParams),
- c = L(a.pathname, a.pathname, u),
+ var s = (0, v.searchParamsToUrlQuery)(a.searchParams),
+ c = L(a.pathname, a.pathname, s),
l = c.result,
f = c.params;
l &&
(i = (0, h.formatWithValidation)({
pathname: l,
hash: a.hash,
- query: C(u, f)
+ query: C(s, f)
}));
}
var d =
@@ -859,12 +859,12 @@
}
function T(t, e, r) {
var n = O(t.pathname, e, !0),
- o = u(n, 2),
+ o = s(n, 2),
a = o[0],
i = o[1],
- s = (0, h.getLocationOrigin)(),
- c = a.startsWith(s),
- l = i && i.startsWith(s);
+ u = (0, h.getLocationOrigin)(),
+ c = a.startsWith(u),
+ l = i && i.startsWith(u);
(a = I(a)), (i = i ? I(i) : i);
var f = c ? a : S(a),
p = r ? I(O(t.pathname, r)) : i || a;
@@ -874,7 +874,7 @@
var r =
!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
n = t.pathname,
- o = (0, s.removePathTrailingSlash)(
+ o = (0, u.removePathTrailingSlash)(
(0, l.denormalizePagePath)(r ? E(n) : n)
);
return (
@@ -888,7 +888,7 @@
)
return (t.pathname = r ? S(e) : e), !0;
}),
- (t.pathname = (0, s.removePathTrailingSlash)(t.pathname))),
+ (t.pathname = (0, u.removePathTrailingSlash)(t.pathname))),
t
);
}
@@ -915,7 +915,7 @@
var N = (function() {
function t(e, r, n, o) {
var i = this,
- u = o.initialProps,
+ s = o.initialProps,
c = o.pageLoader,
l = o.App,
f = o.wrapApp,
@@ -933,6 +933,7 @@
(this.basePath = void 0),
(this.components = void 0),
(this.sdc = {}),
+ (this.sdr = {}),
(this.sub = void 0),
(this.clc = void 0),
(this.pageLoader = void 0),
@@ -960,8 +961,8 @@
o = e.options,
a = e.idx;
i._idx = a;
- var u = (0, d.parseRelativeUrl)(r).pathname;
- (i.isSsr && n === i.asPath && u === i.pathname) ||
+ var s = (0, d.parseRelativeUrl)(r).pathname;
+ (i.isSsr && n === i.asPath && s === i.pathname) ||
(i._bps && !i._bps(e)) ||
i.change(
"replaceState",
@@ -975,25 +976,25 @@
);
}
} else {
- var s = i.pathname,
+ var u = i.pathname,
c = i.query;
i.changeState(
"replaceState",
- (0, h.formatWithValidation)({ pathname: S(s), query: c }),
+ (0, h.formatWithValidation)({ pathname: S(u), query: c }),
(0, h.getURL)()
);
}
}),
- (this.route = (0, s.removePathTrailingSlash)(e)),
+ (this.route = (0, u.removePathTrailingSlash)(e)),
(this.components = {}),
"/_error" !== e &&
(this.components[this.route] = {
Component: v,
initial: !0,
- props: u,
+ props: s,
err: y,
- __N_SSG: u && u.__N_SSG,
- __N_SSP: u && u.__N_SSP
+ __N_SSG: s && s.__N_SSG,
+ __N_SSP: s && s.__N_SSP
}),
(this.components["/_app"] = { Component: l, styleSheets: [] }),
(this.events = t.events),
@@ -1068,7 +1069,7 @@
key: "change",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u) {
+ n.mark(function e(r, o, a, i, s) {
var l,
f,
v,
@@ -1188,10 +1189,10 @@
((O = b.pathname),
(o = (0, h.formatWithValidation)(b))),
(O = O
- ? (0, s.removePathTrailingSlash)(E(O))
+ ? (0, u.removePathTrailingSlash)(E(O))
: O),
this.urlIsNew(w) || f || (r = "replaceState"),
- (N = (0, s.removePathTrailingSlash)(O)),
+ (N = (0, u.removePathTrailingSlash)(O)),
(U = a),
R(a))
) {
@@ -1369,7 +1370,7 @@
I,
w,
J,
- u || (it || !i.scroll ? null : { x: 0, y: 0 })
+ s || (it || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
Y = Y || t;
@@ -1446,7 +1447,7 @@
key: "handleRouteInfoError",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u, s) {
+ n.mark(function e(r, o, a, i, s, u) {
var l, f, h, p;
return n.wrap(
function(e) {
@@ -1459,11 +1460,11 @@
}
throw r;
case 2:
- if (!(0, c.isAssetError)(r) && !s) {
+ if (!(0, c.isAssetError)(r) && !u) {
e.next = 6;
break;
}
- throw (t.events.emit("routeChangeError", r, i, u),
+ throw (t.events.emit("routeChangeError", r, i, s),
(window.location.href = i),
b());
case 6:
@@ -1526,7 +1527,7 @@
o,
a,
i,
- u,
+ s,
!0
)
)
@@ -1554,8 +1555,8 @@
key: "getRouteInfo",
value: (function() {
var t = o(
- n.mark(function t(e, r, o, a, i, u) {
- var s,
+ n.mark(function t(e, r, o, a, i, s) {
+ var u,
c,
l,
f,
@@ -1571,15 +1572,15 @@
case 0:
if (
((t.prev = 0),
- (s = this.components[e]),
- !u.shallow || !s || this.route !== e)
+ (u = this.components[e]),
+ !s.shallow || !u || this.route !== e)
) {
t.next = 4;
break;
}
- return t.abrupt("return", s);
+ return t.abrupt("return", u);
case 4:
- if (!(c = s && "initial" in s ? void 0 : s)) {
+ if (!(c = u && "initial" in u ? void 0 : u)) {
t.next = 9;
break;
}
@@ -1644,7 +1645,7 @@
(t.t1 = t.catch(0)),
t.abrupt(
"return",
- this.handleRouteInfoError(t.t1, r, o, a, u)
+ this.handleRouteInfoError(t.t1, r, o, a, s)
)
);
case 30:
@@ -1687,21 +1688,21 @@
value: function(t) {
if (!this.asPath) return !1;
var e = this.asPath.split("#"),
- r = u(e, 2),
+ r = s(e, 2),
n = r[0],
o = r[1],
a = t.split("#"),
- i = u(a, 2),
- s = i[0],
+ i = s(a, 2),
+ u = i[0],
c = i[1];
- return !(!c || n !== s || o !== c) || (n === s && o !== c);
+ return !(!c || n !== u || o !== c) || (n === u && o !== c);
}
},
{
key: "scrollToHash",
value: function(t) {
var e = t.split("#"),
- r = u(e, 2)[1];
+ r = s(e, 2)[1];
if ("" !== r && "top" !== r) {
var n = document.getElementById(r);
if (n) n.scrollIntoView();
@@ -1727,7 +1728,7 @@
o,
a,
i,
- u,
+ s,
c,
l,
f,
@@ -1751,11 +1752,11 @@
this.pageLoader.getPageList()
);
case 7:
- (u = t.sent),
- (a = j(a, u, !1)).pathname !== i &&
+ (s = t.sent),
+ (a = j(a, s, !1)).pathname !== i &&
((i = a.pathname),
(e = (0, h.formatWithValidation)(a))),
- (c = (0, s.removePathTrailingSlash)(i)),
+ (c = (0, u.removePathTrailingSlash)(i)),
(l = r),
(t.next = 19);
break;
@@ -1764,11 +1765,11 @@
(f = p.__rewrites),
(v = (0, y.default)(
S(_(E(r), this.locale)),
- u,
+ s,
f,
a.query,
function(t) {
- return j({ pathname: t }, u).pathname;
+ return j({ pathname: t }, s).pathname;
},
this.locales
)).matchedPage &&
@@ -1906,7 +1907,17 @@
{
key: "_getServerData",
value: function(t) {
- return M(t, this.isSsr);
+ var e = this,
+ r = new URL(t, window.location.href).href;
+ return this.sdr[r]
+ ? this.sdr[r]
+ : (this.sdr[r] = M(t, this.isSsr)
+ .then(function(t) {
+ return delete e.sdr[r], t;
+ })
+ .catch(function(t) {
+ throw (delete e.sdr[r], t);
+ }));
}
},
{
@@ -1964,8 +1975,8 @@
e = i();
return t.substring(e.length);
}),
- (e.getDisplayName = u),
- (e.isResSent = s),
+ (e.getDisplayName = s),
+ (e.isResSent = u),
(e.loadGetInitialProps = c),
(e.formatWithValidation = function(t) {
0;
@@ -1983,10 +1994,10 @@
.concat(r)
.concat(n ? ":" + n : "");
}
- function u(t) {
+ function s(t) {
return "string" === typeof t ? t : t.displayName || t.name || "Unknown";
}
- function s(t) {
+ function u(t) {
return t.finished || t.headersSent;
}
function c(t, e) {
@@ -2023,7 +2034,7 @@
case 12:
return (t.next = 14), e.getInitialProps(r);
case 14:
- if (((a = t.sent), !o || !s(o))) {
+ if (((a = t.sent), !o || !u(o))) {
t.next = 17;
break;
}
@@ -2035,7 +2046,7 @@
}
throw ((i = '"'
.concat(
- u(e),
+ s(e),
'.getInitialProps()" should resolve to an object. But found "'
)
.concat(a, '" instead.')),
@@ -2115,8 +2126,8 @@
var r = new URL((0, n.getLocationOrigin)()),
a = e ? new URL(e, r) : r,
i = new URL(t, a),
- u = i.pathname,
- s = i.searchParams,
+ s = i.pathname,
+ u = i.searchParams,
c = i.search,
l = i.hash,
f = i.href;
@@ -2125,8 +2136,8 @@
"invariant: invalid relative URL, router received ".concat(t)
);
return {
- pathname: u,
- query: (0, o.searchParamsToUrlQuery)(s),
+ pathname: s,
+ query: (0, o.searchParamsToUrlQuery)(u),
search: c,
hash: l,
href: f.slice(r.origin.length)
@@ -2144,8 +2155,8 @@
o = "function" === typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
i = o.asyncIterator || "@@asyncIterator",
- u = o.toStringTag || "@@toStringTag";
- function s(t, e, r) {
+ s = o.toStringTag || "@@toStringTag";
+ function u(t, e, r) {
return (
Object.defineProperty(t, e, {
value: r,
@@ -2157,9 +2168,9 @@
);
}
try {
- s({}, "");
+ u({}, "");
} catch (I) {
- s = function(t, e, r) {
+ u = function(t, e, r) {
return (t[e] = r);
};
}
@@ -2179,10 +2190,10 @@
for (r.method = o, r.arg = a; ; ) {
var i = r.delegate;
if (i) {
- var u = S(i, r);
- if (u) {
- if (u === v) continue;
- return u;
+ var s = S(i, r);
+ if (s) {
+ if (s === v) continue;
+ return s;
}
}
if ("next" === r.method) r.sent = r._sent = r.arg;
@@ -2191,13 +2202,13 @@
r.dispatchException(r.arg);
} else "return" === r.method && r.abrupt("return", r.arg);
n = p;
- var s = l(t, e, r);
- if ("normal" === s.type) {
- if (((n = r.done ? d : h), s.arg === v)) continue;
- return { value: s.arg, done: r.done };
+ var u = l(t, e, r);
+ if ("normal" === u.type) {
+ if (((n = r.done ? d : h), u.arg === v)) continue;
+ return { value: u.arg, done: r.done };
}
- "throw" === s.type &&
- ((n = d), (r.method = "throw"), (r.arg = s.arg));
+ "throw" === u.type &&
+ ((n = d), (r.method = "throw"), (r.arg = u.arg));
}
};
})(t, r, i)),
@@ -2230,24 +2241,24 @@
var x = (g.prototype = y.prototype = Object.create(w));
function P(t) {
["next", "throw", "return"].forEach(function(e) {
- s(t, e, function(t) {
+ u(t, e, function(t) {
return this._invoke(e, t);
});
});
}
function k(t, e) {
- function r(o, a, i, u) {
- var s = l(t[o], t, a);
- if ("throw" !== s.type) {
- var c = s.arg,
+ function r(o, a, i, s) {
+ var u = l(t[o], t, a);
+ if ("throw" !== u.type) {
+ var c = u.arg,
f = c.value;
return f && "object" === typeof f && n.call(f, "__await")
? e.resolve(f.__await).then(
function(t) {
- r("next", t, i, u);
+ r("next", t, i, s);
},
function(t) {
- r("throw", t, i, u);
+ r("throw", t, i, s);
}
)
: e.resolve(f).then(
@@ -2255,11 +2266,11 @@
(c.value = t), i(c);
},
function(t) {
- return r("throw", t, i, u);
+ return r("throw", t, i, s);
}
);
}
- u(s.arg);
+ s(u.arg);
}
var o;
this._invoke = function(t, n) {
@@ -2347,7 +2358,7 @@
return (
(m.prototype = x.constructor = g),
(g.constructor = m),
- (m.displayName = s(g, u, "GeneratorFunction")),
+ (m.displayName = u(g, s, "GeneratorFunction")),
(t.isGeneratorFunction = function(t) {
var e = "function" === typeof t && t.constructor;
return (
@@ -2359,7 +2370,7 @@
return (
Object.setPrototypeOf
? Object.setPrototypeOf(t, g)
- : ((t.__proto__ = g), s(t, u, "GeneratorFunction")),
+ : ((t.__proto__ = g), u(t, s, "GeneratorFunction")),
(t.prototype = Object.create(x)),
t
);
@@ -2382,7 +2393,7 @@
});
}),
P(x),
- s(x, u, "Generator"),
+ u(x, s, "Generator"),
(x[a] = function() {
return this;
}),
@@ -2435,8 +2446,8 @@
var r = this;
function o(n, o) {
return (
- (u.type = "throw"),
- (u.arg = t),
+ (s.type = "throw"),
+ (s.arg = t),
(r.next = n),
o && ((r.method = "next"), (r.arg = e)),
!!o
@@ -2444,15 +2455,15 @@
}
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
var i = this.tryEntries[a],
- u = i.completion;
+ s = i.completion;
if ("root" === i.tryLoc) return o("end");
if (i.tryLoc <= this.prev) {
- var s = n.call(i, "catchLoc"),
+ var u = n.call(i, "catchLoc"),
c = n.call(i, "finallyLoc");
- if (s && c) {
+ if (u && c) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return o(i.finallyLoc);
- } else if (s) {
+ } else if (u) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
} else {
if (!c)
@@ -2554,16 +2565,16 @@
a = void 0;
try {
for (
- var i, u = t[Symbol.iterator]();
- !(n = (i = u.next()).done) &&
+ var i, s = t[Symbol.iterator]();
+ !(n = (i = s.next()).done) &&
(r.push(i.value), !e || r.length !== e);
n = !0
);
- } catch (s) {
- (o = !0), (a = s);
+ } catch (u) {
+ (o = !0), (a = u);
} finally {
try {
- n || null == u.return || u.return();
+ n || null == s.return || s.return();
} finally {
if (o) throw a;
}
@@ -2615,24 +2626,24 @@
);
}
var i,
- u = !0,
- s = !1;
+ s = !0,
+ u = !1;
return {
s: function() {
r = t[Symbol.iterator]();
},
n: function() {
var t = r.next();
- return (u = t.done), t;
+ return (s = t.done), t;
},
e: function(t) {
- (s = !0), (i = t);
+ (u = !0), (i = t);
},
f: function() {
try {
- u || null == r.return || r.return();
+ s || null == r.return || r.return();
} finally {
- if (s) throw i;
+ if (u) throw i;
}
}
};
@@ -2643,10 +2654,10 @@
return n;
}
var i = r("284h"),
- u = r("TqRt");
+ s = r("TqRt");
(e.__esModule = !0),
(e.useRouter = function() {
- return s.default.useContext(l.RouterContext);
+ return u.default.useContext(l.RouterContext);
}),
(e.makePublicRouterInstance = function(t) {
var e,
@@ -2660,8 +2671,8 @@
? (n[i] = r[i])
: (n[i] = Object.assign(Array.isArray(r[i]) ? [] : {}, r[i]));
}
- } catch (u) {
- a.e(u);
+ } catch (s) {
+ a.e(s);
} finally {
a.f();
}
@@ -2676,11 +2687,11 @@
);
}),
(e.createRouter = e.withRouter = e.default = void 0);
- var s = u(r("q1tI")),
+ var u = s(r("q1tI")),
c = i(r("elyg"));
(e.Router = c.default), (e.NextRouter = c.NextRouter);
var l = r("qOIg"),
- f = u(r("0Bsm"));
+ f = s(r("0Bsm"));
e.withRouter = f.default;
var h = {
router: null,
@@ -2833,12 +2844,12 @@
yXPU: function(t, e) {
function r(t, e, r, n, o, a, i) {
try {
- var u = t[a](i),
- s = u.value;
+ var s = t[a](i),
+ u = s.value;
} catch (c) {
return void r(c);
}
- u.done ? e(s) : Promise.resolve(s).then(n, o);
+ s.done ? e(u) : Promise.resolve(u).then(n, o);
}
t.exports = function(t) {
return function() {
@@ -2846,13 +2857,13 @@
n = arguments;
return new Promise(function(o, a) {
var i = t.apply(e, n);
- function u(t) {
- r(i, o, a, u, s, "next", t);
- }
function s(t) {
- r(i, o, a, u, s, "throw", t);
+ r(i, o, a, s, u, "next", t);
+ }
+ function u(t) {
+ r(i, o, a, s, u, "throw", t);
}
- u(void 0);
+ s(void 0);
});
};
};
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "QuIzjWLw6SyrwIb4orJEF",
+ "buildId": "_DnceoxvxRomhWeYX5dPE",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_buildManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_ssgManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "QuIzjWLw6SyrwIb4orJEF",
+ "buildId": "_DnceoxvxRomhWeYX5dPE",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_buildManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_ssgManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "QuIzjWLw6SyrwIb4orJEF",
+ "buildId": "_DnceoxvxRomhWeYX5dPE",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_buildManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/QuIzjWLw6SyrwIb4orJEF/_ssgManifest.js"
+ src="/_next/static/_DnceoxvxRomhWeYX5dPE/_ssgManifest.js"
async=""
></script>
</body>
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 12.7s | 12.8s | |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.197 | 2.328 | |
/ avg req/sec | 1138.05 | 1073.7 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.536 | 1.564 | |
/error-in-render avg req/sec | 1627.79 | 1598.93 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | 13.4 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 614 B | 616 B | |
link.html gzip | 620 B | 621 B | |
withRouter.html gzip | 609 B | 609 B | ✓ |
Overall change | 1.84 kB | 1.85 kB |
Diffs
Diff for 677f882d2ed8..5ec6837e3.js
@@ -1589,6 +1589,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
* Map of all components loaded in `Router`
*/
// Static Data Cache
+ // In-flight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) {
var _this = this;
@@ -1615,6 +1616,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.basePath = void 0;
this.components = void 0;
this.sdc = {};
+ this.sdr = {};
this.sub = void 0;
this.clc = void 0;
this.pageLoader = void 0;
@@ -3205,7 +3207,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
{
key: "_getServerData",
value: function _getServerData(dataHref) {
- return fetchNextData(dataHref, this.isSsr);
+ var _this6 = this;
+
+ var _URL2 = new URL(dataHref, window.location.href),
+ resourceKey = _URL2.href;
+
+ if (this.sdr[resourceKey]) {
+ return this.sdr[resourceKey];
+ }
+
+ return (this.sdr[resourceKey] = fetchNextData(
+ dataHref,
+ this.isSsr
+ )
+ .then(function(data) {
+ delete _this6.sdr[resourceKey];
+ return data;
+ })
+ ["catch"](function(err) {
+ delete _this6.sdr[resourceKey];
+ throw err;
+ }));
}
},
{
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.42120b530b65ec6837e3.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.974d1f9dc3688e48070d.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 14.8s | 14.9s | |
nodeModulesSize | 42.8 MB | 42.8 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..e7a0.js gzip | 13.4 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.65 kB | 6.65 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..df71.js gzip | N/A | 13.4 kB | N/A |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_error.js | 1.02 MB | 1.02 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.5 kB | 10.5 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.02 MB | 1.02 MB | ✓ |
link.js | 1.08 MB | 1.08 MB | |
routerDirect.js | 1.07 MB | 1.07 MB | |
withRouter.js | 1.07 MB | 1.07 MB | |
Overall change | 5.27 MB | 5.27 MB |
Webpack 5 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 14.9s | 14.5s | -347ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.177 | 2.182 | 0 |
/ avg req/sec | 1148.29 | 1145.78 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.561 | 1.503 | -0.06 |
/error-in-render avg req/sec | 1601.58 | 1663.47 | +61.89 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
597-74632e79..1d47.js gzip | 13.3 kB | 13.3 kB | |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.6 kB | 6.6 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 586 B | 585 B | -1 B |
link.html gzip | 592 B | 592 B | ✓ |
withRouter.html gzip | 581 B | 581 B | ✓ |
Overall change | 1.76 kB | 1.76 kB | -1 B |
Diffs
Diff for 677f882d2ed8..eaa79e7a0.js
@@ -75,9 +75,9 @@
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in t)
if (Object.prototype.hasOwnProperty.call(t, i)) {
- var u = a ? Object.getOwnPropertyDescriptor(t, i) : null;
- u && (u.get || u.set)
- ? Object.defineProperty(r, i, u)
+ var s = a ? Object.getOwnPropertyDescriptor(t, i) : null;
+ s && (s.get || s.set)
+ ? Object.defineProperty(r, i, s)
: (r[i] = t[i]);
}
return (r.default = t), e && e.set(t, r), r;
@@ -168,8 +168,8 @@
r = t.hostname,
o = t.protocol || "",
i = t.pathname || "",
- u = t.hash || "",
- s = t.query || "",
+ s = t.hash || "",
+ u = t.query || "",
c = !1;
(e = e ? encodeURIComponent(e).replace(/%3A/i, ":") + "@" : ""),
t.host
@@ -177,15 +177,15 @@
: r &&
((c = e + (~r.indexOf(":") ? "[".concat(r, "]") : r)),
t.port && (c += ":" + t.port));
- s &&
- "object" === typeof s &&
- (s = String(n.urlQueryToSearchParams(s)));
- var l = t.search || (s && "?".concat(s)) || "";
+ u &&
+ "object" === typeof u &&
+ (u = String(n.urlQueryToSearchParams(u)));
+ var l = t.search || (u && "?".concat(u)) || "";
o && ":" !== o.substr(-1) && (o += ":");
t.slashes || ((!o || a.test(o)) && !1 !== c)
? ((c = "//" + (c || "")), i && "/" !== i[0] && (i = "/" + i))
: c || (c = "");
- u && "#" !== u[0] && (u = "#" + u);
+ s && "#" !== s[0] && (s = "#" + s);
l && "?" !== l[0] && (l = "?" + l);
return (
(i = i.replace(/[?#]/g, encodeURIComponent)),
@@ -195,7 +195,7 @@
.concat(c)
.concat(i)
.concat(l)
- .concat(u)
+ .concat(s)
);
});
var n = (function(t) {
@@ -272,8 +272,8 @@
(e.getClientBuildManifest = p),
(e.default = void 0);
i(r("Lab5"));
- var u = r("0G5g");
- function s(t, e, r) {
+ var s = r("0G5g");
+ function u(t, e, r) {
var n,
o = e.get(t);
if (o) return "future" in o ? o.future : Promise.resolve(o);
@@ -306,7 +306,7 @@
}
function h(t, e) {
return new Promise(function(r, n) {
- return (0, u.requestIdleCallback)(function() {
+ return (0, s.requestIdleCallback)(function() {
return setTimeout(function() {
return n(e);
}, t);
@@ -397,7 +397,7 @@
}
return {
whenEntrypoint: function(t) {
- return s(t, e);
+ return u(t, e);
},
onEntrypoint: function(t, r) {
Promise.resolve(r)
@@ -419,12 +419,12 @@
},
loadRoute: function(r) {
var i = this;
- return s(
+ return u(
r,
l,
a(
n.mark(function a() {
- var u, s, c, l, y, m, g, w;
+ var s, u, c, l, y, m, g, w;
return n.wrap(
function(n) {
for (;;)
@@ -433,12 +433,12 @@
return (n.prev = 0), (n.next = 3), d(t, r);
case 3:
return (
- (u = n.sent),
- (s = u.scripts),
- (c = u.css),
+ (s = n.sent),
+ (u = s.scripts),
+ (c = s.css),
(n.next = 8),
Promise.all([
- e.has(r) ? [] : Promise.all(s.map(p)),
+ e.has(r) ? [] : Promise.all(u.map(p)),
Promise.all(c.map(v))
])
);
@@ -527,7 +527,7 @@
);
})
.then(function() {
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return n.loadRoute(e);
});
})
@@ -713,7 +713,7 @@
o = r("yXPU"),
a = r("lwsE"),
i = r("W8MJ"),
- u = r("J4zp");
+ s = r("J4zp");
(e.__esModule = !0),
(e.getDomainLocale = function(t, e, r, n) {
0;
@@ -728,7 +728,7 @@
(e.interpolateAs = L),
(e.resolveHref = O),
(e.default = void 0);
- var s = r("X24+"),
+ var u = r("X24+"),
c = r("Nh2W"),
l = r("wkBG"),
f = (r("3wub"), w(r("dZ6Y"))),
@@ -763,7 +763,7 @@
return (function(t, e) {
return e && t.startsWith("/")
? "/" === t
- ? (0, s.normalizePathTrailingSlash)(e)
+ ? (0, u.normalizePathTrailingSlash)(e)
: "".concat(e).concat("/" === P(t) ? t.substring(1) : t)
: t;
})(t, "");
@@ -789,21 +789,21 @@
a = o.groups,
i = (e !== t ? (0, m.getRouteMatcher)(o)(e) : "") || r;
n = t;
- var u = Object.keys(a);
+ var s = Object.keys(a);
return (
- u.every(function(t) {
+ s.every(function(t) {
var e = i[t] || "",
r = a[t],
o = r.repeat,
- u = r.optional,
- s = "[".concat(o ? "..." : "").concat(t, "]");
+ s = r.optional,
+ u = "[".concat(o ? "..." : "").concat(t, "]");
return (
- u && (s = "".concat(e ? "" : "/", "[").concat(s, "]")),
+ s && (u = "".concat(e ? "" : "/", "[").concat(u, "]")),
o && !Array.isArray(e) && (e = [e]),
- (u || t in i) &&
+ (s || t in i) &&
(n =
n.replace(
- s,
+ u,
o
? e
.map(function(t) {
@@ -814,7 +814,7 @@
) || "/")
);
}) || (n = ""),
- { params: u, result: n }
+ { params: s, result: n }
);
}
function C(t, e) {
@@ -832,18 +832,18 @@
if (!R(o)) return r ? [o] : o;
try {
var a = new URL(o, n);
- a.pathname = (0, s.normalizePathTrailingSlash)(a.pathname);
+ a.pathname = (0, u.normalizePathTrailingSlash)(a.pathname);
var i = "";
if ((0, p.isDynamicRoute)(a.pathname) && a.searchParams && r) {
- var u = (0, v.searchParamsToUrlQuery)(a.searchParams),
- c = L(a.pathname, a.pathname, u),
+ var s = (0, v.searchParamsToUrlQuery)(a.searchParams),
+ c = L(a.pathname, a.pathname, s),
l = c.result,
f = c.params;
l &&
(i = (0, h.formatWithValidation)({
pathname: l,
hash: a.hash,
- query: C(u, f)
+ query: C(s, f)
}));
}
var d =
@@ -859,12 +859,12 @@
}
function T(t, e, r) {
var n = O(t.pathname, e, !0),
- o = u(n, 2),
+ o = s(n, 2),
a = o[0],
i = o[1],
- s = (0, h.getLocationOrigin)(),
- c = a.startsWith(s),
- l = i && i.startsWith(s);
+ u = (0, h.getLocationOrigin)(),
+ c = a.startsWith(u),
+ l = i && i.startsWith(u);
(a = I(a)), (i = i ? I(i) : i);
var f = c ? a : S(a),
p = r ? I(O(t.pathname, r)) : i || a;
@@ -874,7 +874,7 @@
var r =
!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
n = t.pathname,
- o = (0, s.removePathTrailingSlash)(
+ o = (0, u.removePathTrailingSlash)(
(0, l.denormalizePagePath)(r ? E(n) : n)
);
return (
@@ -888,7 +888,7 @@
)
return (t.pathname = r ? S(e) : e), !0;
}),
- (t.pathname = (0, s.removePathTrailingSlash)(t.pathname))),
+ (t.pathname = (0, u.removePathTrailingSlash)(t.pathname))),
t
);
}
@@ -915,7 +915,7 @@
var N = (function() {
function t(e, r, n, o) {
var i = this,
- u = o.initialProps,
+ s = o.initialProps,
c = o.pageLoader,
l = o.App,
f = o.wrapApp,
@@ -933,6 +933,7 @@
(this.basePath = void 0),
(this.components = void 0),
(this.sdc = {}),
+ (this.sdr = {}),
(this.sub = void 0),
(this.clc = void 0),
(this.pageLoader = void 0),
@@ -960,8 +961,8 @@
o = e.options,
a = e.idx;
i._idx = a;
- var u = (0, d.parseRelativeUrl)(r).pathname;
- (i.isSsr && n === i.asPath && u === i.pathname) ||
+ var s = (0, d.parseRelativeUrl)(r).pathname;
+ (i.isSsr && n === i.asPath && s === i.pathname) ||
(i._bps && !i._bps(e)) ||
i.change(
"replaceState",
@@ -975,25 +976,25 @@
);
}
} else {
- var s = i.pathname,
+ var u = i.pathname,
c = i.query;
i.changeState(
"replaceState",
- (0, h.formatWithValidation)({ pathname: S(s), query: c }),
+ (0, h.formatWithValidation)({ pathname: S(u), query: c }),
(0, h.getURL)()
);
}
}),
- (this.route = (0, s.removePathTrailingSlash)(e)),
+ (this.route = (0, u.removePathTrailingSlash)(e)),
(this.components = {}),
"/_error" !== e &&
(this.components[this.route] = {
Component: v,
initial: !0,
- props: u,
+ props: s,
err: y,
- __N_SSG: u && u.__N_SSG,
- __N_SSP: u && u.__N_SSP
+ __N_SSG: s && s.__N_SSG,
+ __N_SSP: s && s.__N_SSP
}),
(this.components["/_app"] = { Component: l, styleSheets: [] }),
(this.events = t.events),
@@ -1068,7 +1069,7 @@
key: "change",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u) {
+ n.mark(function e(r, o, a, i, s) {
var l,
f,
v,
@@ -1188,10 +1189,10 @@
((O = b.pathname),
(o = (0, h.formatWithValidation)(b))),
(O = O
- ? (0, s.removePathTrailingSlash)(E(O))
+ ? (0, u.removePathTrailingSlash)(E(O))
: O),
this.urlIsNew(w) || f || (r = "replaceState"),
- (N = (0, s.removePathTrailingSlash)(O)),
+ (N = (0, u.removePathTrailingSlash)(O)),
(U = a),
R(a))
) {
@@ -1369,7 +1370,7 @@
I,
w,
J,
- u || (it || !i.scroll ? null : { x: 0, y: 0 })
+ s || (it || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
Y = Y || t;
@@ -1446,7 +1447,7 @@
key: "handleRouteInfoError",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u, s) {
+ n.mark(function e(r, o, a, i, s, u) {
var l, f, h, p;
return n.wrap(
function(e) {
@@ -1459,11 +1460,11 @@
}
throw r;
case 2:
- if (!(0, c.isAssetError)(r) && !s) {
+ if (!(0, c.isAssetError)(r) && !u) {
e.next = 6;
break;
}
- throw (t.events.emit("routeChangeError", r, i, u),
+ throw (t.events.emit("routeChangeError", r, i, s),
(window.location.href = i),
b());
case 6:
@@ -1526,7 +1527,7 @@
o,
a,
i,
- u,
+ s,
!0
)
)
@@ -1554,8 +1555,8 @@
key: "getRouteInfo",
value: (function() {
var t = o(
- n.mark(function t(e, r, o, a, i, u) {
- var s,
+ n.mark(function t(e, r, o, a, i, s) {
+ var u,
c,
l,
f,
@@ -1571,15 +1572,15 @@
case 0:
if (
((t.prev = 0),
- (s = this.components[e]),
- !u.shallow || !s || this.route !== e)
+ (u = this.components[e]),
+ !s.shallow || !u || this.route !== e)
) {
t.next = 4;
break;
}
- return t.abrupt("return", s);
+ return t.abrupt("return", u);
case 4:
- if (!(c = s && "initial" in s ? void 0 : s)) {
+ if (!(c = u && "initial" in u ? void 0 : u)) {
t.next = 9;
break;
}
@@ -1644,7 +1645,7 @@
(t.t1 = t.catch(0)),
t.abrupt(
"return",
- this.handleRouteInfoError(t.t1, r, o, a, u)
+ this.handleRouteInfoError(t.t1, r, o, a, s)
)
);
case 30:
@@ -1687,21 +1688,21 @@
value: function(t) {
if (!this.asPath) return !1;
var e = this.asPath.split("#"),
- r = u(e, 2),
+ r = s(e, 2),
n = r[0],
o = r[1],
a = t.split("#"),
- i = u(a, 2),
- s = i[0],
+ i = s(a, 2),
+ u = i[0],
c = i[1];
- return !(!c || n !== s || o !== c) || (n === s && o !== c);
+ return !(!c || n !== u || o !== c) || (n === u && o !== c);
}
},
{
key: "scrollToHash",
value: function(t) {
var e = t.split("#"),
- r = u(e, 2)[1];
+ r = s(e, 2)[1];
if ("" !== r && "top" !== r) {
var n = document.getElementById(r);
if (n) n.scrollIntoView();
@@ -1727,7 +1728,7 @@
o,
a,
i,
- u,
+ s,
c,
l,
f,
@@ -1751,11 +1752,11 @@
this.pageLoader.getPageList()
);
case 7:
- (u = t.sent),
- (a = j(a, u, !1)).pathname !== i &&
+ (s = t.sent),
+ (a = j(a, s, !1)).pathname !== i &&
((i = a.pathname),
(e = (0, h.formatWithValidation)(a))),
- (c = (0, s.removePathTrailingSlash)(i)),
+ (c = (0, u.removePathTrailingSlash)(i)),
(l = r),
(t.next = 19);
break;
@@ -1764,11 +1765,11 @@
(f = p.__rewrites),
(v = (0, y.default)(
S(_(E(r), this.locale)),
- u,
+ s,
f,
a.query,
function(t) {
- return j({ pathname: t }, u).pathname;
+ return j({ pathname: t }, s).pathname;
},
this.locales
)).matchedPage &&
@@ -1906,7 +1907,17 @@
{
key: "_getServerData",
value: function(t) {
- return M(t, this.isSsr);
+ var e = this,
+ r = new URL(t, window.location.href).href;
+ return this.sdr[r]
+ ? this.sdr[r]
+ : (this.sdr[r] = M(t, this.isSsr)
+ .then(function(t) {
+ return delete e.sdr[r], t;
+ })
+ .catch(function(t) {
+ throw (delete e.sdr[r], t);
+ }));
}
},
{
@@ -1964,8 +1975,8 @@
e = i();
return t.substring(e.length);
}),
- (e.getDisplayName = u),
- (e.isResSent = s),
+ (e.getDisplayName = s),
+ (e.isResSent = u),
(e.loadGetInitialProps = c),
(e.formatWithValidation = function(t) {
0;
@@ -1983,10 +1994,10 @@
.concat(r)
.concat(n ? ":" + n : "");
}
- function u(t) {
+ function s(t) {
return "string" === typeof t ? t : t.displayName || t.name || "Unknown";
}
- function s(t) {
+ function u(t) {
return t.finished || t.headersSent;
}
function c(t, e) {
@@ -2023,7 +2034,7 @@
case 12:
return (t.next = 14), e.getInitialProps(r);
case 14:
- if (((a = t.sent), !o || !s(o))) {
+ if (((a = t.sent), !o || !u(o))) {
t.next = 17;
break;
}
@@ -2035,7 +2046,7 @@
}
throw ((i = '"'
.concat(
- u(e),
+ s(e),
'.getInitialProps()" should resolve to an object. But found "'
)
.concat(a, '" instead.')),
@@ -2115,8 +2126,8 @@
var r = new URL((0, n.getLocationOrigin)()),
a = e ? new URL(e, r) : r,
i = new URL(t, a),
- u = i.pathname,
- s = i.searchParams,
+ s = i.pathname,
+ u = i.searchParams,
c = i.search,
l = i.hash,
f = i.href;
@@ -2125,8 +2136,8 @@
"invariant: invalid relative URL, router received ".concat(t)
);
return {
- pathname: u,
- query: (0, o.searchParamsToUrlQuery)(s),
+ pathname: s,
+ query: (0, o.searchParamsToUrlQuery)(u),
search: c,
hash: l,
href: f.slice(r.origin.length)
@@ -2144,8 +2155,8 @@
o = "function" === typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
i = o.asyncIterator || "@@asyncIterator",
- u = o.toStringTag || "@@toStringTag";
- function s(t, e, r) {
+ s = o.toStringTag || "@@toStringTag";
+ function u(t, e, r) {
return (
Object.defineProperty(t, e, {
value: r,
@@ -2157,9 +2168,9 @@
);
}
try {
- s({}, "");
+ u({}, "");
} catch (I) {
- s = function(t, e, r) {
+ u = function(t, e, r) {
return (t[e] = r);
};
}
@@ -2179,10 +2190,10 @@
for (r.method = o, r.arg = a; ; ) {
var i = r.delegate;
if (i) {
- var u = S(i, r);
- if (u) {
- if (u === v) continue;
- return u;
+ var s = S(i, r);
+ if (s) {
+ if (s === v) continue;
+ return s;
}
}
if ("next" === r.method) r.sent = r._sent = r.arg;
@@ -2191,13 +2202,13 @@
r.dispatchException(r.arg);
} else "return" === r.method && r.abrupt("return", r.arg);
n = p;
- var s = l(t, e, r);
- if ("normal" === s.type) {
- if (((n = r.done ? d : h), s.arg === v)) continue;
- return { value: s.arg, done: r.done };
+ var u = l(t, e, r);
+ if ("normal" === u.type) {
+ if (((n = r.done ? d : h), u.arg === v)) continue;
+ return { value: u.arg, done: r.done };
}
- "throw" === s.type &&
- ((n = d), (r.method = "throw"), (r.arg = s.arg));
+ "throw" === u.type &&
+ ((n = d), (r.method = "throw"), (r.arg = u.arg));
}
};
})(t, r, i)),
@@ -2230,24 +2241,24 @@
var x = (g.prototype = y.prototype = Object.create(w));
function P(t) {
["next", "throw", "return"].forEach(function(e) {
- s(t, e, function(t) {
+ u(t, e, function(t) {
return this._invoke(e, t);
});
});
}
function k(t, e) {
- function r(o, a, i, u) {
- var s = l(t[o], t, a);
- if ("throw" !== s.type) {
- var c = s.arg,
+ function r(o, a, i, s) {
+ var u = l(t[o], t, a);
+ if ("throw" !== u.type) {
+ var c = u.arg,
f = c.value;
return f && "object" === typeof f && n.call(f, "__await")
? e.resolve(f.__await).then(
function(t) {
- r("next", t, i, u);
+ r("next", t, i, s);
},
function(t) {
- r("throw", t, i, u);
+ r("throw", t, i, s);
}
)
: e.resolve(f).then(
@@ -2255,11 +2266,11 @@
(c.value = t), i(c);
},
function(t) {
- return r("throw", t, i, u);
+ return r("throw", t, i, s);
}
);
}
- u(s.arg);
+ s(u.arg);
}
var o;
this._invoke = function(t, n) {
@@ -2347,7 +2358,7 @@
return (
(m.prototype = x.constructor = g),
(g.constructor = m),
- (m.displayName = s(g, u, "GeneratorFunction")),
+ (m.displayName = u(g, s, "GeneratorFunction")),
(t.isGeneratorFunction = function(t) {
var e = "function" === typeof t && t.constructor;
return (
@@ -2359,7 +2370,7 @@
return (
Object.setPrototypeOf
? Object.setPrototypeOf(t, g)
- : ((t.__proto__ = g), s(t, u, "GeneratorFunction")),
+ : ((t.__proto__ = g), u(t, s, "GeneratorFunction")),
(t.prototype = Object.create(x)),
t
);
@@ -2382,7 +2393,7 @@
});
}),
P(x),
- s(x, u, "Generator"),
+ u(x, s, "Generator"),
(x[a] = function() {
return this;
}),
@@ -2435,8 +2446,8 @@
var r = this;
function o(n, o) {
return (
- (u.type = "throw"),
- (u.arg = t),
+ (s.type = "throw"),
+ (s.arg = t),
(r.next = n),
o && ((r.method = "next"), (r.arg = e)),
!!o
@@ -2444,15 +2455,15 @@
}
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
var i = this.tryEntries[a],
- u = i.completion;
+ s = i.completion;
if ("root" === i.tryLoc) return o("end");
if (i.tryLoc <= this.prev) {
- var s = n.call(i, "catchLoc"),
+ var u = n.call(i, "catchLoc"),
c = n.call(i, "finallyLoc");
- if (s && c) {
+ if (u && c) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return o(i.finallyLoc);
- } else if (s) {
+ } else if (u) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
} else {
if (!c)
@@ -2554,16 +2565,16 @@
a = void 0;
try {
for (
- var i, u = t[Symbol.iterator]();
- !(n = (i = u.next()).done) &&
+ var i, s = t[Symbol.iterator]();
+ !(n = (i = s.next()).done) &&
(r.push(i.value), !e || r.length !== e);
n = !0
);
- } catch (s) {
- (o = !0), (a = s);
+ } catch (u) {
+ (o = !0), (a = u);
} finally {
try {
- n || null == u.return || u.return();
+ n || null == s.return || s.return();
} finally {
if (o) throw a;
}
@@ -2615,24 +2626,24 @@
);
}
var i,
- u = !0,
- s = !1;
+ s = !0,
+ u = !1;
return {
s: function() {
r = t[Symbol.iterator]();
},
n: function() {
var t = r.next();
- return (u = t.done), t;
+ return (s = t.done), t;
},
e: function(t) {
- (s = !0), (i = t);
+ (u = !0), (i = t);
},
f: function() {
try {
- u || null == r.return || r.return();
+ s || null == r.return || r.return();
} finally {
- if (s) throw i;
+ if (u) throw i;
}
}
};
@@ -2643,10 +2654,10 @@
return n;
}
var i = r("284h"),
- u = r("TqRt");
+ s = r("TqRt");
(e.__esModule = !0),
(e.useRouter = function() {
- return s.default.useContext(l.RouterContext);
+ return u.default.useContext(l.RouterContext);
}),
(e.makePublicRouterInstance = function(t) {
var e,
@@ -2660,8 +2671,8 @@
? (n[i] = r[i])
: (n[i] = Object.assign(Array.isArray(r[i]) ? [] : {}, r[i]));
}
- } catch (u) {
- a.e(u);
+ } catch (s) {
+ a.e(s);
} finally {
a.f();
}
@@ -2676,11 +2687,11 @@
);
}),
(e.createRouter = e.withRouter = e.default = void 0);
- var s = u(r("q1tI")),
+ var u = s(r("q1tI")),
c = i(r("elyg"));
(e.Router = c.default), (e.NextRouter = c.NextRouter);
var l = r("qOIg"),
- f = u(r("0Bsm"));
+ f = s(r("0Bsm"));
e.withRouter = f.default;
var h = {
router: null,
@@ -2833,12 +2844,12 @@
yXPU: function(t, e) {
function r(t, e, r, n, o, a, i) {
try {
- var u = t[a](i),
- s = u.value;
+ var s = t[a](i),
+ u = s.value;
} catch (c) {
return void r(c);
}
- u.done ? e(s) : Promise.resolve(s).then(n, o);
+ s.done ? e(u) : Promise.resolve(u).then(n, o);
}
t.exports = function(t) {
return function() {
@@ -2846,13 +2857,13 @@
n = arguments;
return new Promise(function(o, a) {
var i = t.apply(e, n);
- function u(t) {
- r(i, o, a, u, s, "next", t);
- }
function s(t) {
- r(i, o, a, u, s, "throw", t);
+ r(i, o, a, s, u, "next", t);
+ }
+ function u(t) {
+ r(i, o, a, s, u, "throw", t);
}
- u(void 0);
+ s(void 0);
});
};
};
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "cvtIdlNbHfPyFfReVdHal",
+ "buildId": "_2R96818evbVQNbigxfcs",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_buildManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_ssgManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "cvtIdlNbHfPyFfReVdHal",
+ "buildId": "_2R96818evbVQNbigxfcs",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_buildManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_ssgManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "cvtIdlNbHfPyFfReVdHal",
+ "buildId": "_2R96818evbVQNbigxfcs",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.45a1f5b1723eaa79e7a0.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.92498cc91063b836df71.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_buildManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/cvtIdlNbHfPyFfReVdHal/_ssgManifest.js"
+ src="/_next/static/_2R96818evbVQNbigxfcs/_ssgManifest.js"
async=""
></script>
</body>
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 12s | 12s | -36ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.025 | 2.028 | 0 |
/ avg req/sec | 1234.48 | 1232.64 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.344 | 1.347 | 0 |
/error-in-render avg req/sec | 1859.87 | 1856.01 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..af39.js gzip | 13.4 kB | 13.4 kB | |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.64 kB | 6.64 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 613 B | 614 B | |
link.html gzip | 620 B | 620 B | ✓ |
withRouter.html gzip | 607 B | 609 B | |
Overall change | 1.84 kB | 1.84 kB |
Diffs
Diff for 677f882d2ed8..cbdf31d2b.js
@@ -1593,6 +1593,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
* Map of all components loaded in `Router`
*/
// Static Data Cache
+ // In-flight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) {
var _this = this;
@@ -1619,6 +1620,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this.basePath = void 0;
this.components = void 0;
this.sdc = {};
+ this.sdr = {};
this.sub = void 0;
this.clc = void 0;
this.pageLoader = void 0;
@@ -3209,7 +3211,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
{
key: "_getServerData",
value: function _getServerData(dataHref) {
- return fetchNextData(dataHref, this.isSsr);
+ var _this6 = this;
+
+ var _URL2 = new URL(dataHref, window.location.href),
+ resourceKey = _URL2.href;
+
+ if (this.sdr[resourceKey]) {
+ return this.sdr[resourceKey];
+ }
+
+ return (this.sdr[resourceKey] = fetchNextData(
+ dataHref,
+ this.isSsr
+ )
+ .then(function(data) {
+ delete _this6.sdr[resourceKey];
+ return data;
+ })
+ ["catch"](function(err) {
+ delete _this6.sdr[resourceKey];
+ throw err;
+ }));
}
},
{
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
async=""
></script>
<script
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
as="script"
/>
<link
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
async=""
></script>
<script
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
as="script"
/>
<link
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c6f31967688cbdf31d2b.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.3f42defbaad29e58243f.js"
async=""
></script>
<script
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 14.2s | 14.1s | -101ms |
nodeModulesSize | 42.8 MB | 42.8 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
677f882d2ed8..af39.js gzip | 13.4 kB | N/A | N/A |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-HASH.js gzip | 6.64 kB | 6.64 kB | ✓ |
webpack-HASH.js gzip | 751 B | 751 B | ✓ |
677f882d2ed8..a2e7.js gzip | N/A | 13.4 kB | N/A |
Overall change | 59.7 kB | 59.8 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-2a09aa2..4a98.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-8b758..aef6.js gzip | 3.46 kB | 3.46 kB | ✓ |
amp-e3e9bc99..932c.js gzip | 536 B | 536 B | ✓ |
hooks-5023ef..3670.js gzip | 888 B | 888 B | ✓ |
index-3a2b03..c677.js gzip | 227 B | 227 B | ✓ |
link-177412b..043e.js gzip | 1.67 kB | 1.67 kB | ✓ |
routerDirect..1a66.js gzip | 303 B | 303 B | ✓ |
withRouter-9..1b7d.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.66 kB | 8.66 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 347 B | 347 B | ✓ |
Overall change | 347 B | 347 B | ✓ |
Serverless bundles Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_error.js | 1.02 MB | 1.02 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
500.html | 2.65 kB | 2.65 kB | ✓ |
amp.amp.html | 10.5 kB | 10.5 kB | ✓ |
amp.html | 1.86 kB | 1.86 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1.02 MB | 1.02 MB | ✓ |
link.js | 1.08 MB | 1.08 MB | |
routerDirect.js | 1.07 MB | 1.07 MB | |
withRouter.js | 1.07 MB | 1.07 MB | |
Overall change | 5.27 MB | 5.27 MB |
Webpack 5 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
buildDuration | 13.8s | 13.9s | |
nodeModulesSize | 42.8 MB | 42.8 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.984 | 2.066 | |
/ avg req/sec | 1259.92 | 1210.14 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.257 | 1.346 | |
/error-in-render avg req/sec | 1988.92 | 1857.19 |
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
597-a2994d94..f0c2.js gzip | 13.3 kB | 13.3 kB | |
framework.HASH.js gzip | 39.3 kB | 39.3 kB | ✓ |
main-HASH.js gzip | 6.59 kB | 6.59 kB | ✓ |
webpack-HASH.js gzip | 954 B | 954 B | ✓ |
Overall change | 60.1 kB | 60.2 kB |
Legacy Client Bundles (polyfills)
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | 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 | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_app-aedc815..1421.js gzip | 1.26 kB | 1.26 kB | ✓ |
_error-71ec2..1a96.js gzip | 3.38 kB | 3.38 kB | ✓ |
amp-33a09cb0..6745.js gzip | 536 B | 536 B | ✓ |
hooks-4e968a..f870.js gzip | 902 B | 902 B | ✓ |
index-5c6845..f75c.js gzip | 230 B | 230 B | ✓ |
link-99f0c6c..b84a.js gzip | 1.65 kB | 1.65 kB | ✓ |
routerDirect..bb56.js gzip | 306 B | 306 B | ✓ |
withRouter-7..2133.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.57 kB | 8.57 kB | ✓ |
Client Build Manifests
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
_buildManifest.js gzip | 326 B | 326 B | ✓ |
Overall change | 326 B | 326 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary | shuding/next.js feat-dedupe-in-flight-server-requests | Change | |
---|---|---|---|
index.html gzip | 585 B | 587 B | |
link.html gzip | 591 B | 593 B | |
withRouter.html gzip | 580 B | 582 B | |
Overall change | 1.76 kB | 1.76 kB |
Diffs
Diff for 677f882d2ed8..2a063af39.js
@@ -75,9 +75,9 @@
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in t)
if (Object.prototype.hasOwnProperty.call(t, i)) {
- var u = a ? Object.getOwnPropertyDescriptor(t, i) : null;
- u && (u.get || u.set)
- ? Object.defineProperty(r, i, u)
+ var s = a ? Object.getOwnPropertyDescriptor(t, i) : null;
+ s && (s.get || s.set)
+ ? Object.defineProperty(r, i, s)
: (r[i] = t[i]);
}
return (r.default = t), e && e.set(t, r), r;
@@ -168,8 +168,8 @@
r = t.hostname,
o = t.protocol || "",
i = t.pathname || "",
- u = t.hash || "",
- s = t.query || "",
+ s = t.hash || "",
+ u = t.query || "",
c = !1;
(e = e ? encodeURIComponent(e).replace(/%3A/i, ":") + "@" : ""),
t.host
@@ -177,15 +177,15 @@
: r &&
((c = e + (~r.indexOf(":") ? "[".concat(r, "]") : r)),
t.port && (c += ":" + t.port));
- s &&
- "object" === typeof s &&
- (s = String(n.urlQueryToSearchParams(s)));
- var l = t.search || (s && "?".concat(s)) || "";
+ u &&
+ "object" === typeof u &&
+ (u = String(n.urlQueryToSearchParams(u)));
+ var l = t.search || (u && "?".concat(u)) || "";
o && ":" !== o.substr(-1) && (o += ":");
t.slashes || ((!o || a.test(o)) && !1 !== c)
? ((c = "//" + (c || "")), i && "/" !== i[0] && (i = "/" + i))
: c || (c = "");
- u && "#" !== u[0] && (u = "#" + u);
+ s && "#" !== s[0] && (s = "#" + s);
l && "?" !== l[0] && (l = "?" + l);
return (
(i = i.replace(/[?#]/g, encodeURIComponent)),
@@ -195,7 +195,7 @@
.concat(c)
.concat(i)
.concat(l)
- .concat(u)
+ .concat(s)
);
});
var n = (function(t) {
@@ -272,8 +272,8 @@
(e.getClientBuildManifest = p),
(e.default = void 0);
i(r("Lab5"));
- var u = r("0G5g");
- function s(t, e, r) {
+ var s = r("0G5g");
+ function u(t, e, r) {
var n,
o = e.get(t);
if (o) return "future" in o ? o.future : Promise.resolve(o);
@@ -312,7 +312,7 @@
(a = !0), n(t);
})
.catch(o),
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return setTimeout(function() {
a || o(r);
}, e);
@@ -403,7 +403,7 @@
}
return {
whenEntrypoint: function(t) {
- return s(t, e);
+ return u(t, e);
},
onEntrypoint: function(t, r) {
Promise.resolve(r)
@@ -425,12 +425,12 @@
},
loadRoute: function(r) {
var i = this;
- return s(
+ return u(
r,
l,
a(
n.mark(function a() {
- var u, s, c, l, y, m, g, w;
+ var s, u, c, l, y, m, g, w;
return n.wrap(
function(n) {
for (;;)
@@ -439,12 +439,12 @@
return (n.prev = 0), (n.next = 3), d(t, r);
case 3:
return (
- (u = n.sent),
- (s = u.scripts),
- (c = u.css),
+ (s = n.sent),
+ (u = s.scripts),
+ (c = s.css),
(n.next = 8),
Promise.all([
- e.has(r) ? [] : Promise.all(s.map(p)),
+ e.has(r) ? [] : Promise.all(u.map(p)),
Promise.all(c.map(v))
])
);
@@ -529,7 +529,7 @@
);
})
.then(function() {
- (0, u.requestIdleCallback)(function() {
+ (0, s.requestIdleCallback)(function() {
return n.loadRoute(e);
});
})
@@ -715,7 +715,7 @@
o = r("yXPU"),
a = r("lwsE"),
i = r("W8MJ"),
- u = r("J4zp");
+ s = r("J4zp");
(e.__esModule = !0),
(e.getDomainLocale = function(t, e, r, n) {
0;
@@ -730,7 +730,7 @@
(e.interpolateAs = L),
(e.resolveHref = O),
(e.default = void 0);
- var s = r("X24+"),
+ var u = r("X24+"),
c = r("Nh2W"),
l = r("wkBG"),
f = (r("3wub"), w(r("dZ6Y"))),
@@ -765,7 +765,7 @@
return (function(t, e) {
return e && t.startsWith("/")
? "/" === t
- ? (0, s.normalizePathTrailingSlash)(e)
+ ? (0, u.normalizePathTrailingSlash)(e)
: "".concat(e).concat("/" === P(t) ? t.substring(1) : t)
: t;
})(t, "");
@@ -791,21 +791,21 @@
a = o.groups,
i = (e !== t ? (0, m.getRouteMatcher)(o)(e) : "") || r;
n = t;
- var u = Object.keys(a);
+ var s = Object.keys(a);
return (
- u.every(function(t) {
+ s.every(function(t) {
var e = i[t] || "",
r = a[t],
o = r.repeat,
- u = r.optional,
- s = "[".concat(o ? "..." : "").concat(t, "]");
+ s = r.optional,
+ u = "[".concat(o ? "..." : "").concat(t, "]");
return (
- u && (s = "".concat(e ? "" : "/", "[").concat(s, "]")),
+ s && (u = "".concat(e ? "" : "/", "[").concat(u, "]")),
o && !Array.isArray(e) && (e = [e]),
- (u || t in i) &&
+ (s || t in i) &&
(n =
n.replace(
- s,
+ u,
o
? e
.map(function(t) {
@@ -816,7 +816,7 @@
) || "/")
);
}) || (n = ""),
- { params: u, result: n }
+ { params: s, result: n }
);
}
function C(t, e) {
@@ -834,18 +834,18 @@
if (!R(o)) return r ? [o] : o;
try {
var a = new URL(o, n);
- a.pathname = (0, s.normalizePathTrailingSlash)(a.pathname);
+ a.pathname = (0, u.normalizePathTrailingSlash)(a.pathname);
var i = "";
if ((0, p.isDynamicRoute)(a.pathname) && a.searchParams && r) {
- var u = (0, v.searchParamsToUrlQuery)(a.searchParams),
- c = L(a.pathname, a.pathname, u),
+ var s = (0, v.searchParamsToUrlQuery)(a.searchParams),
+ c = L(a.pathname, a.pathname, s),
l = c.result,
f = c.params;
l &&
(i = (0, h.formatWithValidation)({
pathname: l,
hash: a.hash,
- query: C(u, f)
+ query: C(s, f)
}));
}
var d =
@@ -861,12 +861,12 @@
}
function T(t, e, r) {
var n = O(t.pathname, e, !0),
- o = u(n, 2),
+ o = s(n, 2),
a = o[0],
i = o[1],
- s = (0, h.getLocationOrigin)(),
- c = a.startsWith(s),
- l = i && i.startsWith(s);
+ u = (0, h.getLocationOrigin)(),
+ c = a.startsWith(u),
+ l = i && i.startsWith(u);
(a = I(a)), (i = i ? I(i) : i);
var f = c ? a : S(a),
p = r ? I(O(t.pathname, r)) : i || a;
@@ -876,7 +876,7 @@
var r =
!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2],
n = t.pathname,
- o = (0, s.removePathTrailingSlash)(
+ o = (0, u.removePathTrailingSlash)(
(0, l.denormalizePagePath)(r ? E(n) : n)
);
return (
@@ -890,7 +890,7 @@
)
return (t.pathname = r ? S(e) : e), !0;
}),
- (t.pathname = (0, s.removePathTrailingSlash)(t.pathname))),
+ (t.pathname = (0, u.removePathTrailingSlash)(t.pathname))),
t
);
}
@@ -917,7 +917,7 @@
var N = (function() {
function t(e, r, n, o) {
var i = this,
- u = o.initialProps,
+ s = o.initialProps,
c = o.pageLoader,
l = o.App,
f = o.wrapApp,
@@ -935,6 +935,7 @@
(this.basePath = void 0),
(this.components = void 0),
(this.sdc = {}),
+ (this.sdr = {}),
(this.sub = void 0),
(this.clc = void 0),
(this.pageLoader = void 0),
@@ -962,8 +963,8 @@
o = e.options,
a = e.idx;
i._idx = a;
- var u = (0, d.parseRelativeUrl)(r).pathname;
- (i.isSsr && n === i.asPath && u === i.pathname) ||
+ var s = (0, d.parseRelativeUrl)(r).pathname;
+ (i.isSsr && n === i.asPath && s === i.pathname) ||
(i._bps && !i._bps(e)) ||
i.change(
"replaceState",
@@ -977,25 +978,25 @@
);
}
} else {
- var s = i.pathname,
+ var u = i.pathname,
c = i.query;
i.changeState(
"replaceState",
- (0, h.formatWithValidation)({ pathname: S(s), query: c }),
+ (0, h.formatWithValidation)({ pathname: S(u), query: c }),
(0, h.getURL)()
);
}
}),
- (this.route = (0, s.removePathTrailingSlash)(e)),
+ (this.route = (0, u.removePathTrailingSlash)(e)),
(this.components = {}),
"/_error" !== e &&
(this.components[this.route] = {
Component: v,
initial: !0,
- props: u,
+ props: s,
err: y,
- __N_SSG: u && u.__N_SSG,
- __N_SSP: u && u.__N_SSP
+ __N_SSG: s && s.__N_SSG,
+ __N_SSP: s && s.__N_SSP
}),
(this.components["/_app"] = { Component: l, styleSheets: [] }),
(this.events = t.events),
@@ -1070,7 +1071,7 @@
key: "change",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u) {
+ n.mark(function e(r, o, a, i, s) {
var l,
f,
v,
@@ -1190,10 +1191,10 @@
((O = b.pathname),
(o = (0, h.formatWithValidation)(b))),
(O = O
- ? (0, s.removePathTrailingSlash)(E(O))
+ ? (0, u.removePathTrailingSlash)(E(O))
: O),
this.urlIsNew(w) || f || (r = "replaceState"),
- (N = (0, s.removePathTrailingSlash)(O)),
+ (N = (0, u.removePathTrailingSlash)(O)),
(U = a),
R(a))
) {
@@ -1371,7 +1372,7 @@
I,
w,
J,
- u || (it || !i.scroll ? null : { x: 0, y: 0 })
+ s || (it || !i.scroll ? null : { x: 0, y: 0 })
).catch(function(t) {
if (!t.cancelled) throw t;
Y = Y || t;
@@ -1448,7 +1449,7 @@
key: "handleRouteInfoError",
value: (function() {
var e = o(
- n.mark(function e(r, o, a, i, u, s) {
+ n.mark(function e(r, o, a, i, s, u) {
var l, f, h, p;
return n.wrap(
function(e) {
@@ -1461,11 +1462,11 @@
}
throw r;
case 2:
- if (!(0, c.isAssetError)(r) && !s) {
+ if (!(0, c.isAssetError)(r) && !u) {
e.next = 6;
break;
}
- throw (t.events.emit("routeChangeError", r, i, u),
+ throw (t.events.emit("routeChangeError", r, i, s),
(window.location.href = i),
b());
case 6:
@@ -1528,7 +1529,7 @@
o,
a,
i,
- u,
+ s,
!0
)
)
@@ -1556,8 +1557,8 @@
key: "getRouteInfo",
value: (function() {
var t = o(
- n.mark(function t(e, r, o, a, i, u) {
- var s,
+ n.mark(function t(e, r, o, a, i, s) {
+ var u,
c,
l,
f,
@@ -1573,15 +1574,15 @@
case 0:
if (
((t.prev = 0),
- (s = this.components[e]),
- !u.shallow || !s || this.route !== e)
+ (u = this.components[e]),
+ !s.shallow || !u || this.route !== e)
) {
t.next = 4;
break;
}
- return t.abrupt("return", s);
+ return t.abrupt("return", u);
case 4:
- if (!(c = s && "initial" in s ? void 0 : s)) {
+ if (!(c = u && "initial" in u ? void 0 : u)) {
t.next = 9;
break;
}
@@ -1646,7 +1647,7 @@
(t.t1 = t.catch(0)),
t.abrupt(
"return",
- this.handleRouteInfoError(t.t1, r, o, a, u)
+ this.handleRouteInfoError(t.t1, r, o, a, s)
)
);
case 30:
@@ -1689,21 +1690,21 @@
value: function(t) {
if (!this.asPath) return !1;
var e = this.asPath.split("#"),
- r = u(e, 2),
+ r = s(e, 2),
n = r[0],
o = r[1],
a = t.split("#"),
- i = u(a, 2),
- s = i[0],
+ i = s(a, 2),
+ u = i[0],
c = i[1];
- return !(!c || n !== s || o !== c) || (n === s && o !== c);
+ return !(!c || n !== u || o !== c) || (n === u && o !== c);
}
},
{
key: "scrollToHash",
value: function(t) {
var e = t.split("#"),
- r = u(e, 2)[1];
+ r = s(e, 2)[1];
if ("" !== r && "top" !== r) {
var n = document.getElementById(r);
if (n) n.scrollIntoView();
@@ -1729,7 +1730,7 @@
o,
a,
i,
- u,
+ s,
c,
l,
f,
@@ -1753,11 +1754,11 @@
this.pageLoader.getPageList()
);
case 7:
- (u = t.sent),
- (a = j(a, u, !1)).pathname !== i &&
+ (s = t.sent),
+ (a = j(a, s, !1)).pathname !== i &&
((i = a.pathname),
(e = (0, h.formatWithValidation)(a))),
- (c = (0, s.removePathTrailingSlash)(i)),
+ (c = (0, u.removePathTrailingSlash)(i)),
(l = r),
(t.next = 19);
break;
@@ -1766,11 +1767,11 @@
(f = p.__rewrites),
(v = (0, y.default)(
S(_(E(r), this.locale)),
- u,
+ s,
f,
a.query,
function(t) {
- return j({ pathname: t }, u).pathname;
+ return j({ pathname: t }, s).pathname;
},
this.locales
)).matchedPage &&
@@ -1908,7 +1909,17 @@
{
key: "_getServerData",
value: function(t) {
- return M(t, this.isSsr);
+ var e = this,
+ r = new URL(t, window.location.href).href;
+ return this.sdr[r]
+ ? this.sdr[r]
+ : (this.sdr[r] = M(t, this.isSsr)
+ .then(function(t) {
+ return delete e.sdr[r], t;
+ })
+ .catch(function(t) {
+ throw (delete e.sdr[r], t);
+ }));
}
},
{
@@ -1966,8 +1977,8 @@
e = i();
return t.substring(e.length);
}),
- (e.getDisplayName = u),
- (e.isResSent = s),
+ (e.getDisplayName = s),
+ (e.isResSent = u),
(e.loadGetInitialProps = c),
(e.formatWithValidation = function(t) {
0;
@@ -1985,10 +1996,10 @@
.concat(r)
.concat(n ? ":" + n : "");
}
- function u(t) {
+ function s(t) {
return "string" === typeof t ? t : t.displayName || t.name || "Unknown";
}
- function s(t) {
+ function u(t) {
return t.finished || t.headersSent;
}
function c(t, e) {
@@ -2025,7 +2036,7 @@
case 12:
return (t.next = 14), e.getInitialProps(r);
case 14:
- if (((a = t.sent), !o || !s(o))) {
+ if (((a = t.sent), !o || !u(o))) {
t.next = 17;
break;
}
@@ -2037,7 +2048,7 @@
}
throw ((i = '"'
.concat(
- u(e),
+ s(e),
'.getInitialProps()" should resolve to an object. But found "'
)
.concat(a, '" instead.')),
@@ -2117,8 +2128,8 @@
var r = new URL((0, n.getLocationOrigin)()),
a = e ? new URL(e, r) : r,
i = new URL(t, a),
- u = i.pathname,
- s = i.searchParams,
+ s = i.pathname,
+ u = i.searchParams,
c = i.search,
l = i.hash,
f = i.href;
@@ -2127,8 +2138,8 @@
"invariant: invalid relative URL, router received ".concat(t)
);
return {
- pathname: u,
- query: (0, o.searchParamsToUrlQuery)(s),
+ pathname: s,
+ query: (0, o.searchParamsToUrlQuery)(u),
search: c,
hash: l,
href: f.slice(r.origin.length)
@@ -2146,8 +2157,8 @@
o = "function" === typeof Symbol ? Symbol : {},
a = o.iterator || "@@iterator",
i = o.asyncIterator || "@@asyncIterator",
- u = o.toStringTag || "@@toStringTag";
- function s(t, e, r) {
+ s = o.toStringTag || "@@toStringTag";
+ function u(t, e, r) {
return (
Object.defineProperty(t, e, {
value: r,
@@ -2159,9 +2170,9 @@
);
}
try {
- s({}, "");
+ u({}, "");
} catch (I) {
- s = function(t, e, r) {
+ u = function(t, e, r) {
return (t[e] = r);
};
}
@@ -2181,10 +2192,10 @@
for (r.method = o, r.arg = a; ; ) {
var i = r.delegate;
if (i) {
- var u = S(i, r);
- if (u) {
- if (u === v) continue;
- return u;
+ var s = S(i, r);
+ if (s) {
+ if (s === v) continue;
+ return s;
}
}
if ("next" === r.method) r.sent = r._sent = r.arg;
@@ -2193,13 +2204,13 @@
r.dispatchException(r.arg);
} else "return" === r.method && r.abrupt("return", r.arg);
n = p;
- var s = l(t, e, r);
- if ("normal" === s.type) {
- if (((n = r.done ? d : h), s.arg === v)) continue;
- return { value: s.arg, done: r.done };
+ var u = l(t, e, r);
+ if ("normal" === u.type) {
+ if (((n = r.done ? d : h), u.arg === v)) continue;
+ return { value: u.arg, done: r.done };
}
- "throw" === s.type &&
- ((n = d), (r.method = "throw"), (r.arg = s.arg));
+ "throw" === u.type &&
+ ((n = d), (r.method = "throw"), (r.arg = u.arg));
}
};
})(t, r, i)),
@@ -2232,24 +2243,24 @@
var x = (g.prototype = y.prototype = Object.create(w));
function P(t) {
["next", "throw", "return"].forEach(function(e) {
- s(t, e, function(t) {
+ u(t, e, function(t) {
return this._invoke(e, t);
});
});
}
function k(t, e) {
- function r(o, a, i, u) {
- var s = l(t[o], t, a);
- if ("throw" !== s.type) {
- var c = s.arg,
+ function r(o, a, i, s) {
+ var u = l(t[o], t, a);
+ if ("throw" !== u.type) {
+ var c = u.arg,
f = c.value;
return f && "object" === typeof f && n.call(f, "__await")
? e.resolve(f.__await).then(
function(t) {
- r("next", t, i, u);
+ r("next", t, i, s);
},
function(t) {
- r("throw", t, i, u);
+ r("throw", t, i, s);
}
)
: e.resolve(f).then(
@@ -2257,11 +2268,11 @@
(c.value = t), i(c);
},
function(t) {
- return r("throw", t, i, u);
+ return r("throw", t, i, s);
}
);
}
- u(s.arg);
+ s(u.arg);
}
var o;
this._invoke = function(t, n) {
@@ -2349,7 +2360,7 @@
return (
(m.prototype = x.constructor = g),
(g.constructor = m),
- (m.displayName = s(g, u, "GeneratorFunction")),
+ (m.displayName = u(g, s, "GeneratorFunction")),
(t.isGeneratorFunction = function(t) {
var e = "function" === typeof t && t.constructor;
return (
@@ -2361,7 +2372,7 @@
return (
Object.setPrototypeOf
? Object.setPrototypeOf(t, g)
- : ((t.__proto__ = g), s(t, u, "GeneratorFunction")),
+ : ((t.__proto__ = g), u(t, s, "GeneratorFunction")),
(t.prototype = Object.create(x)),
t
);
@@ -2384,7 +2395,7 @@
});
}),
P(x),
- s(x, u, "Generator"),
+ u(x, s, "Generator"),
(x[a] = function() {
return this;
}),
@@ -2437,8 +2448,8 @@
var r = this;
function o(n, o) {
return (
- (u.type = "throw"),
- (u.arg = t),
+ (s.type = "throw"),
+ (s.arg = t),
(r.next = n),
o && ((r.method = "next"), (r.arg = e)),
!!o
@@ -2446,15 +2457,15 @@
}
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
var i = this.tryEntries[a],
- u = i.completion;
+ s = i.completion;
if ("root" === i.tryLoc) return o("end");
if (i.tryLoc <= this.prev) {
- var s = n.call(i, "catchLoc"),
+ var u = n.call(i, "catchLoc"),
c = n.call(i, "finallyLoc");
- if (s && c) {
+ if (u && c) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return o(i.finallyLoc);
- } else if (s) {
+ } else if (u) {
if (this.prev < i.catchLoc) return o(i.catchLoc, !0);
} else {
if (!c)
@@ -2556,16 +2567,16 @@
a = void 0;
try {
for (
- var i, u = t[Symbol.iterator]();
- !(n = (i = u.next()).done) &&
+ var i, s = t[Symbol.iterator]();
+ !(n = (i = s.next()).done) &&
(r.push(i.value), !e || r.length !== e);
n = !0
);
- } catch (s) {
- (o = !0), (a = s);
+ } catch (u) {
+ (o = !0), (a = u);
} finally {
try {
- n || null == u.return || u.return();
+ n || null == s.return || s.return();
} finally {
if (o) throw a;
}
@@ -2617,24 +2628,24 @@
);
}
var i,
- u = !0,
- s = !1;
+ s = !0,
+ u = !1;
return {
s: function() {
r = t[Symbol.iterator]();
},
n: function() {
var t = r.next();
- return (u = t.done), t;
+ return (s = t.done), t;
},
e: function(t) {
- (s = !0), (i = t);
+ (u = !0), (i = t);
},
f: function() {
try {
- u || null == r.return || r.return();
+ s || null == r.return || r.return();
} finally {
- if (s) throw i;
+ if (u) throw i;
}
}
};
@@ -2645,10 +2656,10 @@
return n;
}
var i = r("284h"),
- u = r("TqRt");
+ s = r("TqRt");
(e.__esModule = !0),
(e.useRouter = function() {
- return s.default.useContext(l.RouterContext);
+ return u.default.useContext(l.RouterContext);
}),
(e.makePublicRouterInstance = function(t) {
var e,
@@ -2662,8 +2673,8 @@
? (n[i] = r[i])
: (n[i] = Object.assign(Array.isArray(r[i]) ? [] : {}, r[i]));
}
- } catch (u) {
- a.e(u);
+ } catch (s) {
+ a.e(s);
} finally {
a.f();
}
@@ -2678,11 +2689,11 @@
);
}),
(e.createRouter = e.withRouter = e.default = void 0);
- var s = u(r("q1tI")),
+ var u = s(r("q1tI")),
c = i(r("elyg"));
(e.Router = c.default), (e.NextRouter = c.NextRouter);
var l = r("qOIg"),
- f = u(r("0Bsm"));
+ f = s(r("0Bsm"));
e.withRouter = f.default;
var h = {
router: null,
@@ -2835,12 +2846,12 @@
yXPU: function(t, e) {
function r(t, e, r, n, o, a, i) {
try {
- var u = t[a](i),
- s = u.value;
+ var s = t[a](i),
+ u = s.value;
} catch (c) {
return void r(c);
}
- u.done ? e(s) : Promise.resolve(s).then(n, o);
+ s.done ? e(u) : Promise.resolve(u).then(n, o);
}
t.exports = function(t) {
return function() {
@@ -2848,13 +2859,13 @@
n = arguments;
return new Promise(function(o, a) {
var i = t.apply(e, n);
- function u(t) {
- r(i, o, a, u, s, "next", t);
- }
function s(t) {
- r(i, o, a, u, s, "throw", t);
+ r(i, o, a, s, u, "next", t);
+ }
+ function u(t) {
+ r(i, o, a, s, u, "throw", t);
}
- u(void 0);
+ s(void 0);
});
};
};
Diff for index.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/",
"query": {},
- "buildId": "CK_P5Kqf7Ll5NDNqdD8UT",
+ "buildId": "Pw0Mm6F04odSd3azQ0cVL",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_buildManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_ssgManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_ssgManifest.js"
async=""
></script>
</body>
Diff for link.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
as="script"
/>
<link
@@ -48,7 +48,7 @@
"props": { "pageProps": {} },
"page": "/link",
"query": {},
- "buildId": "CK_P5Kqf7Ll5NDNqdD8UT",
+ "buildId": "Pw0Mm6F04odSd3azQ0cVL",
"isFallback": false,
"gip": true
}
@@ -70,7 +70,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
async=""
></script>
<script
@@ -82,11 +82,11 @@
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_buildManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_ssgManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_ssgManifest.js"
async=""
></script>
</body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
as="script"
/>
<link
@@ -43,7 +43,7 @@
"props": { "pageProps": {} },
"page": "/withRouter",
"query": {},
- "buildId": "CK_P5Kqf7Ll5NDNqdD8UT",
+ "buildId": "Pw0Mm6F04odSd3azQ0cVL",
"isFallback": false,
"gip": true
}
@@ -65,7 +65,7 @@
async=""
></script>
<script
- src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4ca177ac12b2a063af39.js"
+ src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.cf6d753e84db9064a2e7.js"
async=""
></script>
<script
@@ -77,11 +77,11 @@
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_buildManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_buildManifest.js"
async=""
></script>
<script
- src="/_next/static/CK_P5Kqf7Ll5NDNqdD8UT/_ssgManifest.js"
+ src="/_next/static/Pw0Mm6F04odSd3azQ0cVL/_ssgManifest.js"
async=""
></script>
</body>
This PR adds request deduplication for
_getServerData
. If a request with the same URL is already in-flight, we don't send another new request. When a request succeeds or fails, we delete the cache.A potential improvement this brings is, when
getServerSideProps
of a new route is slow to load, the user might keep clicking on the link which causes new requests, and the route will never update because results of old requests were ditched. Also adds a test case for this scenario.Closes #19238.