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
Simplify <Link>
Prefetch Deduping
#9987
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages Overall decrease ✓
Client Pages Modern Overall decrease ✓
Client Build Manifests
Rendered Page Sizes Overall decrease ✓
DiffsDiff for link.js@@ -488,6 +488,7 @@
var observer
var listeners = new _map['default']()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -654,10 +655,7 @@
value: function handleRef(ref) {
var _this2 = this
- var isPrefetched =
- _router['default'].router.pageLoader.prefetched[
- this.getHref()
- ]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners() Diff for link.module.js@@ -363,6 +363,7 @@
var observer
var listeners = new _map.default()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -496,8 +497,7 @@
}
handleRef(ref) {
- var isPrefetched =
- _router.default.router.pageLoader.prefetched[this.getHref()]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners() Diff for de003c3a9d30..5d46f1a1e.js@@ -2089,12 +2089,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+
+ var route = toRoute(pathname)
_this4.pageLoader.prefetch(route).then(resolve, reject)
}) Diff for de003c3a9d30..33.module.js@@ -2354,13 +2354,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+ var route = toRoute(pathname)
this.pageLoader.prefetch(route).then(resolve, reject)
})
} Diff for main-HASH.js@@ -1263,7 +1263,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt['default'])()
this.loadingRoutes = {}
@@ -1490,7 +1489,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) { Diff for main-HASH.module.js@@ -851,7 +851,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt.default)()
this.loadingRoutes = {}
@@ -1036,7 +1035,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) { Diff for index.html@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module" Diff for link.html@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -156,25 +156,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module" Diff for withRouter.html@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module" Serverless Mode (Increase detected
|
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
buildDuration | 13.4s | 13.6s | |
nodeModulesSize | 48.9 MB | 48.9 MB | -342 B |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.11 kB | -18 B |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..4cf7.js gzip | 13.7 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7ed0.js gzip | N/A | 13.7 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -18 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.19 kB | 4.17 kB | -18 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.5 kB | N/A |
Overall change | 62.1 kB | 62.1 kB | -18 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.js gzip | 1.33 kB | 1.33 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.9 kB | 2.89 kB | -13 B |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.87 kB | 9.86 kB | -13 B |
Client Pages Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.module.js gzip | 757 B | 757 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.47 kB | 2.46 kB | -11 B |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.41 kB | 7.4 kB | -11 B |
Client Build Manifests
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_error.js gzip | 77.7 kB | 77.8 kB | |
hooks.html gzip | 1.05 kB | 1.05 kB | -1 B |
index.js gzip | 78 kB | 78 kB | |
link.js gzip | 80.3 kB | 80.4 kB | |
routerDirect.js gzip | 78 kB | 78 kB | |
withRouter.js gzip | 78.1 kB | 78.1 kB | |
Overall change | 393 kB | 393 kB |
Commit: 0d2f98a
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages Overall decrease ✓
Client Pages Modern Overall increase
|
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.module.js gzip | 757 B | 757 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.47 kB | 2.47 kB | |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.41 kB | 7.41 kB |
Client Build Manifests
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
index.html gzip | 1.02 kB | 1.02 kB | -2 B |
link.html gzip | 1.03 kB | 1.03 kB | -1 B |
withRouter.html gzip | 1.02 kB | 1.01 kB | -2 B |
Overall change | 3.07 kB | 3.06 kB | -5 B |
Diffs
Diff for link.js
@@ -488,6 +488,7 @@
var observer
var listeners = new _map['default']()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -654,10 +655,7 @@
value: function handleRef(ref) {
var _this2 = this
- var isPrefetched =
- _router['default'].router.pageLoader.prefetched[
- this.getHref()
- ]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners()
@@ -679,7 +677,11 @@
value: function prefetch() {
if (!this.p || false) return // Prefetch the JSON page if asked (only in the client)
- _router['default'].prefetch(this.getHref())
+ var href = this.getHref()
+
+ _router['default'].prefetch(href)
+
+ prefetched[href] = true
},
},
{
Diff for link.module.js
@@ -363,6 +363,7 @@
var observer
var listeners = new _map.default()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -496,8 +497,7 @@
}
handleRef(ref) {
- var isPrefetched =
- _router.default.router.pageLoader.prefetched[this.getHref()]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners()
@@ -514,7 +514,11 @@
prefetch() {
if (!this.p || false) return // Prefetch the JSON page if asked (only in the client)
- _router.default.prefetch(this.getHref())
+ var href = this.getHref()
+
+ _router.default.prefetch(href)
+
+ prefetched[href] = true
}
render() {
Diff for de003c3a9d30..5d46f1a1e.js
@@ -2089,12 +2089,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+
+ var route = toRoute(pathname)
_this4.pageLoader.prefetch(route).then(resolve, reject)
})
Diff for de003c3a9d30..33.module.js
@@ -2354,13 +2354,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+ var route = toRoute(pathname)
this.pageLoader.prefetch(route).then(resolve, reject)
})
}
Diff for main-HASH.js
@@ -1263,7 +1263,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt['default'])()
this.loadingRoutes = {}
@@ -1490,7 +1489,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) {
Diff for main-HASH.module.js
@@ -851,7 +851,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt.default)()
this.loadingRoutes = {}
@@ -1036,7 +1035,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) {
Diff for index.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Diff for link.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -156,25 +156,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Diff for withRouter.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
buildDuration | 12.8s | 13s | |
nodeModulesSize | 48.9 MB | 48.9 MB | -256 B |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.11 kB | -18 B |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..4cf7.js gzip | 13.7 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7ed0.js gzip | N/A | 13.7 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -18 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.19 kB | 4.17 kB | -18 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.5 kB | N/A |
Overall change | 62.1 kB | 62.1 kB | -18 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.js gzip | 1.33 kB | 1.33 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.9 kB | 2.9 kB | -1 B |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.87 kB | 9.87 kB | -1 B |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.module.js gzip | 757 B | 757 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.47 kB | 2.47 kB | |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.41 kB | 7.41 kB |
Client Build Manifests
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_error.js gzip | 77.7 kB | 77.8 kB | |
hooks.html gzip | 1.05 kB | 1.05 kB | -1 B |
index.js gzip | 78 kB | 78 kB | |
link.js gzip | 80.3 kB | 80.4 kB | |
routerDirect.js gzip | 78 kB | 78 kB | |
withRouter.js gzip | 78.1 kB | 78.1 kB | |
Overall change | 393 kB | 393 kB |
Commit: dd0b962
ijjk
reviewed
Jan 7, 2020
ijjk
approved these changes
Jan 7, 2020
Co-Authored-By: JJ Kasper <jj@jjsweb.site>
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages Overall decrease ✓
Client Pages Modern Overall increase
|
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.module.js gzip | 757 B | 757 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.47 kB | 2.47 kB | |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.41 kB | 7.41 kB |
Client Build Manifests
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
index.html gzip | 1.02 kB | 1.02 kB | -2 B |
link.html gzip | 1.03 kB | 1.03 kB | -1 B |
withRouter.html gzip | 1.02 kB | 1.01 kB | -2 B |
Overall change | 3.07 kB | 3.06 kB | -5 B |
Diffs
Diff for link.js
@@ -488,6 +488,7 @@
var observer
var listeners = new _map['default']()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -654,10 +655,7 @@
value: function handleRef(ref) {
var _this2 = this
- var isPrefetched =
- _router['default'].router.pageLoader.prefetched[
- this.getHref()
- ]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners()
@@ -679,7 +677,11 @@
value: function prefetch() {
if (!this.p || false) return // Prefetch the JSON page if asked (only in the client)
- _router['default'].prefetch(this.getHref())
+ var href = this.getHref()
+
+ _router['default'].prefetch(href)
+
+ prefetched[href] = true
},
},
{
Diff for link.module.js
@@ -363,6 +363,7 @@
var observer
var listeners = new _map.default()
var IntersectionObserver = true ? window.IntersectionObserver : undefined
+ var prefetched = {}
function getObserver() {
// Return shared instance of IntersectionObserver if already created
@@ -496,8 +497,7 @@
}
handleRef(ref) {
- var isPrefetched =
- _router.default.router.pageLoader.prefetched[this.getHref()]
+ var isPrefetched = prefetched[this.getHref()]
if (this.p && IntersectionObserver && ref && ref.tagName) {
this.cleanUpListeners()
@@ -514,7 +514,11 @@
prefetch() {
if (!this.p || false) return // Prefetch the JSON page if asked (only in the client)
- _router.default.prefetch(this.getHref())
+ var href = this.getHref()
+
+ _router.default.prefetch(href)
+
+ prefetched[href] = true
}
render() {
Diff for de003c3a9d30..5d46f1a1e.js
@@ -2089,12 +2089,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+
+ var route = toRoute(pathname)
_this4.pageLoader.prefetch(route).then(resolve, reject)
})
Diff for de003c3a9d30..33.module.js
@@ -2354,13 +2354,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
return
- } // @ts-ignore pathname is always defined
-
- var route = toRoute(pathname) // Prefetch is not supported in development mode because it would trigger on-demand-entries
+ } // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (false) {
- }
+ } // @ts-ignore pathname is always defined
+ var route = toRoute(pathname)
this.pageLoader.prefetch(route).then(resolve, reject)
})
}
Diff for main-HASH.js
@@ -1263,7 +1263,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt['default'])()
this.loadingRoutes = {}
@@ -1490,7 +1489,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) {
Diff for main-HASH.module.js
@@ -851,7 +851,6 @@
this.buildId = buildId
this.assetPrefix = assetPrefix
this.pageCache = {}
- this.prefetched = {}
this.pageRegisterEvents = (0, _mitt.default)()
this.loadingRoutes = {}
@@ -1036,7 +1035,6 @@
url = route
} else {
route = normalizeRoute(route)
- this.prefetched[route] = true
var scriptRoute = (route === '/' ? '/index' : route) + '.js'
if (true && hasNoModule) {
Diff for index.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Diff for link.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -156,25 +156,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Diff for withRouter.html
@@ -39,13 +39,13 @@
/>
<link
rel="preload"
- href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ href="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
as="script"
crossorigin="anonymous"
/>
@@ -151,25 +151,25 @@
type="module"
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.2f93bd9bec75d46f1a1e.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.70c66df54d21a52f8812.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bc6579cf6308df6d2e33.module.js"
+ src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.81d530ce41345e943b94.module.js"
defer=""
crossorigin="anonymous"
type="module"
></script
><script
- src="/_next/static/runtime/main-4f117fc3a711021de25e.js"
+ src="/_next/static/runtime/main-2d8dd0896a0a3d09b733.js"
defer=""
crossorigin="anonymous"
nomodule=""
></script
><script
- src="/_next/static/runtime/main-f85b8e82af1d65257132.module.js"
+ src="/_next/static/runtime/main-fa24bccf7a4533e1e3a1.module.js"
defer=""
crossorigin="anonymous"
type="module"
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
buildDuration | 13.4s | 13.7s | |
nodeModulesSize | 48.9 MB | 48.9 MB | -256 B |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.11 kB | -18 B |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..4cf7.js gzip | 13.7 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7ed0.js gzip | N/A | 13.7 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -18 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.19 kB | 4.17 kB | -18 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.5 kB | N/A |
Overall change | 62.1 kB | 62.1 kB | -18 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages Overall decrease ✓
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.js gzip | 1.33 kB | 1.33 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.9 kB | 2.9 kB | -1 B |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.87 kB | 9.87 kB | -1 B |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_app.module.js gzip | 757 B | 757 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.47 kB | 2.47 kB | |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.41 kB | 7.41 kB |
Client Build Manifests
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | Timer/next.js simplify-dedupe | Change | |
---|---|---|---|
_error.js gzip | 77.7 kB | 77.8 kB | |
hooks.html gzip | 1.05 kB | 1.05 kB | -1 B |
index.js gzip | 78 kB | 78 kB | |
link.js gzip | 80.3 kB | 80.4 kB | |
routerDirect.js gzip | 78 kB | 78 kB | |
withRouter.js gzip | 78.1 kB | 78.1 kB | |
Overall change | 393 kB | 393 kB |
Commit: 33765b6
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request removes the deeply shared state with
pageLoader
for a simpler alternative.Alternative To: #9644
Closes: #9959
Fixes: #9951