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

Make sure bad links in router methods resolve in production #15135

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

Janpot
Copy link
Contributor

@Janpot Janpot commented Jul 13, 2020

edge-case I introduced in #14827

@ijjk
Copy link
Member

ijjk commented Jul 13, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
buildDuration 13.9s 13.4s -525ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +63 B
Page Load Tests Overall increase ✓
vercel/next.js canary Janpot/next.js bad-link-router-push Change
/ failed reqs 0 0
/ total time (seconds) 2.293 2.323 ⚠️ +0.03
/ avg req/sec 1090.21 1076.16 ⚠️ -14.05
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.521 1.415 -0.11
/error-in-render avg req/sec 1643.9 1767.23 +123.33
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..d979.js gzip 9.77 kB 9.77 kB ⚠️ +1 B
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.4 kB 56.4 kB ⚠️ +1 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.16 kB 6.17 kB ⚠️ +4 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.9 kB 51.9 kB ⚠️ +4 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js bad-link-router-push Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js bad-link-router-push Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Janpot/next.js bad-link-router-push Change
index.html gzip 956 B 955 B -1 B
link.html gzip 962 B 962 B
withRouter.html gzip 947 B 947 B
Overall change 2.87 kB 2.86 kB -1 B

Diffs

Diff for 19b7e98f51cc..a0a6b272c.js
@@ -1130,7 +1130,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   }
 
                   var parsed = tryParseRelativeUrl(url);
-                  if (!parsed) return;
+                  if (!parsed) return resolve(false);
                   var pathname = parsed.pathname,
                     searchParams = parsed.searchParams;
                   var query = (0,
Diff for 19b7e98f51cc..2c.module.js
@@ -966,7 +966,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             }
 
             var parsed = tryParseRelativeUrl(url);
-            if (!parsed) return;
+            if (!parsed) return resolve(false);
             var { pathname, searchParams } = parsed;
             var query = (0, _searchParamsToUrlQuery.searchParamsToUrlQuery)(
               searchParams
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.57d1fe46206a0a6b272c.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.b5c2b9fbb9c2ee983bad.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.57d1fe46206a0a6b272c.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.b5c2b9fbb9c2ee983bad.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      href="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.57d1fe46206a0a6b272c.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.b5c2b9fbb9c2ee983bad.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.e45f41c352a27ba1912c.module.js"
+      src="/_next/static/chunks/19b7e98f51cc0d86c45d01159bbbfb942bfe49b8.5bca75f3a87d540d7c48.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
buildDuration 15.7s 15.3s -334ms
nodeModulesSize 66.5 MB 66.5 MB ⚠️ +63 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
main-HASH.js gzip 6.72 kB 6.72 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..d979.js gzip 9.77 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
19b7e98f51cc..cead.js gzip N/A 9.77 kB N/A
Overall change 56.4 kB 56.4 kB ⚠️ +1 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
main-HASH.module.js gzip 5.79 kB 5.79 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 6.16 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
19b7e98f51cc..dule.js gzip N/A 6.17 kB N/A
Overall change 51.9 kB 51.9 kB ⚠️ +4 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js bad-link-router-push Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js bad-link-router-push Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 273 B 273 B
Overall change 540 B 540 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary Janpot/next.js bad-link-router-push Change
_error.js 881 kB 881 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 881 kB 881 kB
link.js 923 kB 923 kB ⚠️ +15 B
routerDirect.js 917 kB 917 kB ⚠️ +15 B
withRouter.js 917 kB 917 kB ⚠️ +15 B
Overall change 4.53 MB 4.53 MB ⚠️ +45 B
Commit: bec5d33

@kodiakhq kodiakhq bot merged commit cd79c82 into vercel:canary Jul 13, 2020
@Janpot Janpot deleted the bad-link-router-push branch July 14, 2020 06:14
@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.

3 participants