Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shallow routing never happens unless the new route is the existing route #11453

Closed
wants to merge 1 commit into from

Conversation

samschooler
Copy link

@samschooler samschooler commented Mar 29, 2020

I'm not sure this is a bug, or a feature, so please tell me if I'm wrong.

Right now the logic for returning a cached route is:

shallow && cachedRouteInfo && this.route === route

However, this means this will only returned the cachedRouteInfo if the route is current page.

In this PR I changed the logic to:

cachedRouteInfo &&
      isEqual(cachedRouteInfo.query, query) &&
      (shallow || this.route === route)

This makes it so if the route is cached, the query is the same, andshallow is enabled or it is the current route, return cachedRouteInfo

The query stuff was put in because if a shallow cached route is returned, the query string is incorrect. This will fetch cached routes with shallow enabled only if the query string is different from the previous request. This functionality is a personal choice, I'm not sure what the "expected behavior" with caching and query strings is.

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
buildDuration 10.2s 10.5s ⚠️ +304ms
nodeModulesSize 52.8 MB 52.8 MB ⚠️ +26 B
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
de003c3a9d30..66af.js gzip N/A 10.1 kB N/A
Overall change 56.2 kB 56.2 kB -1 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB ⚠️ +1 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB ⚠️ +1 B
Legacy Client Bundles (polyfills)
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary samschooler/next.js fix/shallow-routing 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 samschooler/next.js fix/shallow-routing Change
index.html gzip 917 B 916 B -1 B
link.html gzip 925 B 924 B -1 B
withRouter.html gzip 915 B 911 B -4 B
Overall change 2.76 kB 2.75 kB -6 B

Diffs

Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.85b1af78ac1de334b04f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.85b1af78ac1de334b04f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for de003c3a9d30..23.module.js
@@ -762,9 +762,9 @@ class Router {
   getRouteInfo(route, pathname, query, as) {
     var shallow = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
     var cachedRouteInfo = this.components[route]; // If there is a shallow route transition possible
-    // If the route is already rendered on the screen.
+    // If the route is already rendered on the screen and cached.
 
-    if (shallow && cachedRouteInfo && this.route === route) {
+    if (cachedRouteInfo && (shallow || this.route === route)) {
       return Promise.resolve(cachedRouteInfo);
     }
Diff for de003c3a9d30..177e37fca.js
@@ -839,9 +839,9 @@ var Router = /*#__PURE__*/function () {
 
       var shallow = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
       var cachedRouteInfo = this.components[route]; // If there is a shallow route transition possible
-      // If the route is already rendered on the screen.
+      // If the route is already rendered on the screen and cached.
 
-      if (shallow && cachedRouteInfo && this.route === route) {
+      if (cachedRouteInfo && (shallow || this.route === route)) {
         return Promise.resolve(cachedRouteInfo);
       }
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.85b1af78ac1de334b04f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.15fd7d356d224838760d.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
buildDuration 10.8s 10.9s ⚠️ +158ms
nodeModulesSize 52.8 MB 52.8 MB ⚠️ +26 B
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
de003c3a9d30..66af.js gzip N/A 10.1 kB N/A
Overall change 56.2 kB 56.2 kB -1 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
de003c3a9d30..dule.js gzip N/A 6.71 kB N/A
Overall change 51.4 kB 51.4 kB ⚠️ +1 B
Legacy Client Bundles (polyfills)
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary samschooler/next.js fix/shallow-routing 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 samschooler/next.js fix/shallow-routing Change
_error.js gzip 294 kB 294 kB ⚠️ +1 B
404.html gzip 1.32 kB 1.32 kB -2 B
hooks.html gzip 958 B 954 B -4 B
index.js gzip 293 kB 294 kB ⚠️ +595 B
link.js gzip 301 kB 302 kB ⚠️ +530 B
routerDirect.js gzip 300 kB 300 kB ⚠️ +627 B
withRouter.js gzip 300 kB 300 kB -16 B
Overall change 1.49 MB 1.49 MB ⚠️ +1.73 kB

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Failing test suites

test/integration/query-with-encoding/test/index.test.js

  • Query String with Encoding > new line > should have correct query on Router#push
  • Query String with Encoding > percent > should have correct query on Router#push
  • Query String with Encoding > plus > should have correct query on Router#push
  • Query String with Encoding > trailing space > should have correct query on Router#push
Expand output

● Query String with Encoding › new line › should have correct query on Router#push

expect(received).toBe(expected) // Object.is equality

Expected: "{\"abc\":\"def\\n\"}"
Received: "{}"

  53 |         await waitFor(1000)
  54 |         const text = await browser.elementByCss('#query-content').text()
> 55 |         expect(text).toBe('{"abc":"def\\n"}')
     |                      ^
  56 |       } finally {
  57 |         await browser.close()
  58 |       }

  at Object.<anonymous> (integration/query-with-encoding/test/index.test.js:55:22)

● Query String with Encoding › trailing space › should have correct query on Router#push

expect(received).toBe(expected) // Object.is equality

Expected: "{\"abc\":\"def \"}"
Received: "{}"

  106 |         await waitFor(1000)
  107 |         const text = await browser.elementByCss('#query-content').text()
> 108 |         expect(text).toBe('{"abc":"def "}')
      |                      ^
  109 |       } finally {
  110 |         await browser.close()
  111 |       }

  at Object.<anonymous> (integration/query-with-encoding/test/index.test.js:108:22)

● Query String with Encoding › percent › should have correct query on Router#push

expect(received).toBe(expected) // Object.is equality

Expected: "{\"abc\":\"def%\"}"
Received: "{}"

  159 |         await waitFor(1000)
  160 |         const text = await browser.elementByCss('#query-content').text()
> 161 |         expect(text).toBe('{"abc":"def%"}')
      |                      ^
  162 |       } finally {
  163 |         await browser.close()
  164 |       }

  at Object.<anonymous> (integration/query-with-encoding/test/index.test.js:161:22)

● Query String with Encoding › plus › should have correct query on Router#push

expect(received).toBe(expected) // Object.is equality

Expected: "{\"abc\":\"def+\"}"
Received: "{}"

  212 |         await waitFor(1000)
  213 |         const text = await browser.elementByCss('#query-content').text()
> 214 |         expect(text).toBe('{"abc":"def+"}')
      |                      ^
  215 |       } finally {
  216 |         await browser.close()
  217 |       }

  at Object.<anonymous> (integration/query-with-encoding/test/index.test.js:214:22)
      at runMicrotasks (<anonymous>)

test/integration/basic/test/index.test.js

  • Basic Features > Dynamic import > Import mapping > should load new components and render for prop changes
  • Basic Features > Error Recovery > should recover after exporting an invalid page
  • Basic Features > Error Recovery > should recover from errors in getInitialProps in client
  • Basic Features > Error Recovery > should recover after an error reported via SSR
Expand output

● Basic Features › Dynamic import › Import mapping › should load new components and render for prop changes

: Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.Error:

  276 |       })
  277 | 
> 278 |       it('should load new components and render for prop changes', async () => {
      |       ^
  279 |         const browser = await webdriver(context.appPort, '/dynamic/bundle')
  280 | 
  281 |         await browser

  at new Spec (../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
  at Suite.<anonymous> (integration/basic/test/dynamic.js:278:7)

● Basic Features › Error Recovery › should recover after exporting an invalid page

StaleElementReferenceError: stale element reference: element is not attached to the page document
  (Session info: headless chrome=80.0.3987.149)

  285 | 
  286 |         while (true) {
> 287 |           const bodyText = await browser.elementByCss('body').text()
      |                            ^
  288 |           if (
  289 |             /Dynamic Bundle/.test(bodyText) &&
  290 |             /Hello World 1/.test(bodyText) &&

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:563:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:489:26)
      at runMicrotasks (<anonymous>)
  at thenableWebDriverProxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:699:17)
  at Object.<anonymous> (integration/basic/test/dynamic.js:287:28)

● Basic Features › Error Recovery › should recover from errors in getInitialProps in client

TIMED OUT CHECK FOR IFRAME

  379 |     }
  380 |     console.error('TIMED OUT CHECK FOR IFRAME')
> 381 |     throw new Error('TIMED OUT CHECK FOR IFRAME')
      |           ^
  382 |   }, 1000 * 30)
  383 |   while (!found) {
  384 |     try {

  at Timeout._onTimeout (lib/next-test-utils.js:381:11)

● Basic Features › Error Recovery › should recover after an error reported via SSR

TIMED OUT CHECK FOR IFRAME

  379 |     }
  380 |     console.error('TIMED OUT CHECK FOR IFRAME')
> 381 |     throw new Error('TIMED OUT CHECK FOR IFRAME')
      |           ^
  382 |   }, 1000 * 30)
  383 |   while (!found) {
  384 |     try {

  at Timeout._onTimeout (lib/next-test-utils.js:381:11)

test/integration/production/test/index.test.js

  • Production Usage > Dynamic import > Import mapping > should load new components and render for prop changes
Expand output

● Production Usage › Dynamic import › Import mapping › should load new components and render for prop changes

: Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 300000ms timeout specified by jest.setTimeout.Error:

  152 |       })
  153 | 
> 154 |       it('should load new components and render for prop changes', async () => {
      |       ^
  155 |         const browser = await webdriver(context.appPort, '/dynamic/bundle')
  156 | 
  157 |         await browser

  at new Spec (../node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
  at Suite.<anonymous> (integration/production/test/dynamic.js:154:7)

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
buildDuration 10.6s 10.9s ⚠️ +294ms
nodeModulesSize 52.8 MB 52.8 MB ⚠️ +53.4 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
de003c3a9d30..007d.js gzip N/A 13.7 kB N/A
Overall change 56.2 kB 59.8 kB ⚠️ +3.55 kB
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
de003c3a9d30..dule.js gzip N/A 10.3 kB N/A
Overall change 51.4 kB 54.9 kB ⚠️ +3.57 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary samschooler/next.js fix/shallow-routing 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 samschooler/next.js fix/shallow-routing Change
index.html gzip 917 B 916 B -1 B
link.html gzip 925 B 924 B -1 B
withRouter.html gzip 915 B 912 B -3 B
Overall change 2.76 kB 2.75 kB -5 B

Diffs

Diff for de003c3a9d30..23.module.js
deleted
Diff for de003c3a9d30..177e37fca.js

Diff too large to display

Diff for de003c3a9d30..99.module.js

Diff too large to display

Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0ccb59ebe68708e60f3c.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0ccb59ebe68708e60f3c.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d70844b46f3177e37fca.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-1d4fa480fe12c18ddc5f.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0ccb59ebe68708e60f3c.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.4d44f4c48cecd53bbf99.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-496c627e4cae2c2e76d4.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-2bd6e9e56ab1a4d74c13.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
buildDuration 11.5s 11.5s ⚠️ +47ms
nodeModulesSize 52.8 MB 52.8 MB ⚠️ +53.4 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
de003c3a9d30..007d.js gzip N/A 13.7 kB N/A
Overall change 56.2 kB 59.8 kB ⚠️ +3.55 kB
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
de003c3a9d30..dule.js gzip N/A 10.3 kB N/A
Overall change 51.4 kB 54.9 kB ⚠️ +3.57 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary samschooler/next.js fix/shallow-routing Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary samschooler/next.js fix/shallow-routing 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 samschooler/next.js fix/shallow-routing Change
_error.js gzip 294 kB 294 kB -190 B
404.html gzip 1.32 kB 1.32 kB -1 B
hooks.html gzip 958 B 955 B -3 B
index.js gzip 294 kB 293 kB -1.27 kB
link.js gzip 302 kB 315 kB ⚠️ +13.7 kB
routerDirect.js gzip 300 kB 314 kB ⚠️ +13.2 kB
withRouter.js gzip 300 kB 313 kB ⚠️ +13.2 kB
Overall change 1.49 MB 1.53 MB ⚠️ +38.6 kB

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Failing test suites

test/integration/size-limit/test/index.test.js

  • Production response size > should not increase the overall response size of default build
  • Production response size > should not increase the overall response size of modern build
Expand output

● Production response size › should not increase the overall response size of default build

expect(received).toBeLessThanOrEqual(expected)

Expected: <= 1024
Received:    10942

  82 |     // These numbers are without gzip compression!
  83 |     const delta = responseSizesBytes - 257 * 1024
> 84 |     expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
     |                   ^
  85 |     expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target
  86 |   })
  87 | 

  at Object.<anonymous> (integration/size-limit/test/index.test.js:84:19)

● Production response size › should not increase the overall response size of modern build

expect(received).toBeLessThanOrEqual(expected)

Expected: <= 1024
Received:    11060

  102 |     // These numbers are without gzip compression!
  103 |     const delta = responseSizesBytes - 165 * 1024
> 104 |     expect(delta).toBeLessThanOrEqual(1024) // don't increase size more than 1kb
      |                   ^
  105 |     expect(delta).toBeGreaterThanOrEqual(-1024) // don't decrease size more than 1kb without updating target
  106 |   })
  107 | })

  at Object.<anonymous> (integration/size-limit/test/index.test.js:104:19)

test/integration/client-navigation/test/index.test.js

  • Client Navigation > with hash changes > when hash get removed > should not run getInitialProps
  • Client Navigation > with hash changes with state > when passing state via hash change > should increment the history state counter
  • Client Navigation > with shallow routing > should update the url without running getInitialProps
  • Client Navigation > with shallow routing > should handle the back button and should not run getInitialProps
  • Client Navigation > with shallow routing > should run getInitialProps always when rending the page to the screen
  • Client Navigation > with the current url > should reload the page
  • Client Navigation > with the current url > should always replace the state
Expand output

● Client Navigation › with the current url › should reload the page

expect(received).toBe(expected) // Object.is equality

Expected: "COUNT: 1"
Received: "COUNT: 0"

  264 |         .text()
  265 | 
> 266 |       expect(countAfterClicked).toBe('COUNT: 1')
      |                                 ^
  267 |       await browser.close()
  268 |     })
  269 | 

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:266:33)
      at runMicrotasks (<anonymous>)

● Client Navigation › with the current url › should always replace the state

expect(received).toBe(expected) // Object.is equality

Expected: "COUNT: 3"
Received: "COUNT: 1"

  283 | 
  284 |       // counts (page change + two clicks)
> 285 |       expect(countAfterClicked).toBe('COUNT: 3')
      |                                 ^
  286 | 
  287 |       // Since we replace the state, back button would simply go us back to /nav
  288 |       await browser.back().waitForElementByCss('.nav-home')

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:285:33)
      at runMicrotasks (<anonymous>)

● Client Navigation › with hash changes › when hash get removed › should not run getInitialProps

expect(received).toBe(expected) // Object.is equality

Expected: "COUNT: 1"
Received: "COUNT: 0"

  520 |           .text()
  521 | 
> 522 |         expect(counter).toBe('COUNT: 1')
      |                         ^
  523 | 
  524 |         await browser.close()
  525 |       })

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:522:25)
      at runMicrotasks (<anonymous>)

● Client Navigation › with hash changes with state › when passing state via hash change › should increment the history state counter

expect(received).toBe(expected) // Object.is equality

Expected: "COUNT: 2"
Received: "COUNT: 0"

  579 |         const counter = await browser.elementByCss('p').text()
  580 | 
> 581 |         expect(counter).toBe('COUNT: 2')
      |                         ^
  582 | 
  583 |         await browser.close()
  584 |       })

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:581:25)
      at runMicrotasks (<anonymous>)

● Client Navigation › with shallow routing › should update the url without running getInitialProps

expect(received).toBe(expected) // Object.is equality

Expected: "getInitialProps run count: 1"
Received: "getInitialProps run count: 3"

  624 |         .elementByCss('#get-initial-props-run-count')
  625 |         .text()
> 626 |       expect(getInitialPropsRunCount).toBe('getInitialProps run count: 1')
      |                                       ^
  627 | 
  628 |       await browser.close()
  629 |     })

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:626:39)
      at runMicrotasks (<anonymous>)

● Client Navigation › with shallow routing › should handle the back button and should not run getInitialProps

expect(received).toBe(expected) // Object.is equality

Expected: "getInitialProps run count: 1"
Received: "getInitialProps run count: 4"

  649 |         .elementByCss('#get-initial-props-run-count')
  650 |         .text()
> 651 |       expect(getInitialPropsRunCount).toBe('getInitialProps run count: 1')
      |                                       ^
  652 | 
  653 |       await browser.close()
  654 |     })

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:651:39)
      at runMicrotasks (<anonymous>)

● Client Navigation › with shallow routing › should run getInitialProps always when rending the page to the screen

expect(received).toBe(expected) // Object.is equality

Expected: "getInitialProps run count: 2"
Received: "getInitialProps run count: 3"

  674 |         .elementByCss('#get-initial-props-run-count')
  675 |         .text()
> 676 |       expect(getInitialPropsRunCount).toBe('getInitialProps run count: 2')
      |                                       ^
  677 | 
  678 |       await browser.close()
  679 |     })

  at Object.<anonymous> (integration/client-navigation/test/index.test.js:676:39)
      at runMicrotasks (<anonymous>)

Copy link
Member

@Timer Timer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As evidenced by the test cases, this is by design and should be captured in the documentation. Thanks for the PR!

@Timer Timer closed this May 20, 2020
@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants