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

basePath: Resolve links against router pathname instead of window.location #14804

Merged
merged 8 commits into from
Jul 7, 2020

Conversation

Janpot
Copy link
Contributor

@Janpot Janpot commented Jul 2, 2020

Currently following links are broken when using basePath:

// pages/hello.js
    <Link href="#hashlink">
      <a id="hashlink">Hash Link</a>
    </Link>

with basePath: '/docs', this will navigate to /docs/docs/hello#hashlink instead of /docs/hello#hashlink

I have a further optimization that builds on this branch that removes url.parse and url.resolve in favor for new URL() in router and link. Will PR when this gets merged.

@ijjk ijjk added the type: next label Jul 2, 2020
@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 12s 11.9s -100ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Page Load Tests Overall increase ✓
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 2.002 1.935 -0.07
/ avg req/sec 1248.56 1292.12 +43.56
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.162 1.178 ⚠️ +0.02
/error-in-render avg req/sec 2151.06 2121.66 ⚠️ -29.4
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 958 B -1 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB -1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-85ce3c6a45ee465c8213.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-ebd9e092dc6613f88deb.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-85ce3c6a45ee465c8213.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 12.7s 12.6s -66ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -406 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -406 B
Commit: da6ee53

@Janpot Janpot changed the title Resolve against router pathname and not window.location Resolve links against router pathname and not window.location Jul 2, 2020
@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 11.4s 11.5s ⚠️ +94ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 1.915 1.896 -0.02
/ avg req/sec 1305.67 1318.38 +12.71
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.18 1.215 ⚠️ +0.04
/error-in-render avg req/sec 2118.89 2057.21 ⚠️ -61.68
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 958 B -1 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB -1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-85ce3c6a45ee465c8213.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-ebd9e092dc6613f88deb.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-85ce3c6a45ee465c8213.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 12.7s 12.7s ⚠️ +66ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -406 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -406 B
Commit: 5cd19c9

@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Failing test suites

Commit: 5cd19c9

test/integration/basepath/test/index.test.js

  • basePath development > should render error in dev overlay correctly
Expand output

● basePath development › should render error in dev overlay correctly

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `basePath development should render error in dev overlay correctly 1`

- Snapshot  - 7
+ Received  + 7

- pages/hello.js (52:14) @ onClick
+ pages/hello.js (56:14) @ onClick

-   50 |   id="trigger-error"
+   54 |   id="trigger-error"
-   51 |   onClick={() => {
+   55 |   onClick={() => {
- > 52 |     throw new Error('oops heres an error')
+ > 56 |     throw new Error('oops heres an error')
       |          ^
-   53 |   }}
+   57 |   }}
-   54 | >
+   58 | >
-   55 |   click me for error
+   59 |   click me for error

  42 | 
  43 |       const errorSource = await getRedboxSource(browser)
> 44 |       expect(errorSource).toMatchInlineSnapshot(`
     |                           ^
  45 |         "pages${
  46 |           process.platform === 'win32' ? '\\\\' : '/'
  47 |         }hello.js (52:14) @ onClick

  at Object.<anonymous> (integration/basepath/test/index.test.js:44:27)

@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 12.4s 12.5s ⚠️ +179ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 1.983 1.953 -0.03
/ avg req/sec 1260.62 1279.75 +19.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.212 1.241 ⚠️ +0.03
/error-in-render avg req/sec 2062.19 2014.79 ⚠️ -47.4
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 958 B -1 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB -1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-85ce3c6a45ee465c8213.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-ebd9e092dc6613f88deb.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-85ce3c6a45ee465c8213.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-ebd9e092dc6613f88deb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 13.4s 13.3s -94ms
nodeModulesSize 66 MB 66 MB -1.21 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -406 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -406 B
Commit: 1e1cfba

@Janpot Janpot marked this pull request as ready for review July 2, 2020 20:38
@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 10.8s 11.1s ⚠️ +247ms
nodeModulesSize 66 MB 66 MB -1.05 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 1.698 1.759 ⚠️ +0.06
/ avg req/sec 1471.91 1420.99 ⚠️ -50.92
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.09 1.114 ⚠️ +0.02
/error-in-render avg req/sec 2293.86 2244.27 ⚠️ -49.59
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 267 B -1 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 539 B -1 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 960 B ⚠️ +1 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB ⚠️ +1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-27dc99f1cf9e2f8285bf.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-22d5420493a928964b1f.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-22d5420493a928964b1f.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-27dc99f1cf9e2f8285bf.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-22d5420493a928964b1f.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 11.6s 11.4s -211ms
nodeModulesSize 66 MB 66 MB -1.05 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 267 B -1 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 539 B -1 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -402 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -402 B
Commit: cbb63b5

@ijjk
Copy link
Member

ijjk commented Jul 2, 2020

Failing test suites

Commit: cbb63b5

test/integration/create-next-app/index.test.js

  • create next app > valid example
  • create next app > should allow example with GitHub URL
  • create next app > should allow example with GitHub URL and example-path
  • create next app > should use --example-path over the file path in the GitHub URL
Expand output

● create next app › valid example

Command failed with exit code 1 (EPERM): node /home/runner/work/next.js/next.js/packages/create-next-app/dist/index.js valid-example --example basic-css

  90 |     await usingTempDir(async (cwd) => {
  91 |       const projectName = 'valid-example'
> 92 |       const res = await run(cwd, projectName, '--example', 'basic-css')
     |                   ^
  93 |       expect(res.exitCode).toBe(0)
  94 | 
  95 |       expect(

  at makeError (../node_modules/execa/lib/error.js:58:11)
  at handlePromise (../node_modules/execa/index.js:112:26)
  at integration/create-next-app/index.test.js:92:19
  at usingTempDir (integration/create-next-app/index.test.js:30:12)
  at Object.<anonymous> (integration/create-next-app/index.test.js:90:5)

● create next app › should allow example with GitHub URL

Command failed with exit code 1 (EPERM): node /home/runner/work/next.js/next.js/packages/create-next-app/dist/index.js github-app --example https://github.com/zeit/next-learn-demo/tree/master/1-navigate-between-pages

  109 |     await usingTempDir(async (cwd) => {
  110 |       const projectName = 'github-app'
> 111 |       const res = await run(
      |                   ^
  112 |         cwd,
  113 |         projectName,
  114 |         '--example',

  at makeError (../node_modules/execa/lib/error.js:58:11)
  at handlePromise (../node_modules/execa/index.js:112:26)
  at integration/create-next-app/index.test.js:111:19
  at usingTempDir (integration/create-next-app/index.test.js:30:12)
  at Object.<anonymous> (integration/create-next-app/index.test.js:109:5)

● create next app › should allow example with GitHub URL and example-path

Command failed with exit code 1 (EPERM): node /home/runner/work/next.js/next.js/packages/create-next-app/dist/index.js github-example-path --example https://github.com/zeit/next-learn-demo/tree/master --example-path 1-navigate-between-pages

  135 |     await usingTempDir(async (cwd) => {
  136 |       const projectName = 'github-example-path'
> 137 |       const res = await run(
      |                   ^
  138 |         cwd,
  139 |         projectName,
  140 |         '--example',

  at makeError (../node_modules/execa/lib/error.js:58:11)
  at handlePromise (../node_modules/execa/index.js:112:26)
  at integration/create-next-app/index.test.js:137:19
  at usingTempDir (integration/create-next-app/index.test.js:30:12)
  at Object.<anonymous> (integration/create-next-app/index.test.js:135:5)

● create next app › should use --example-path over the file path in the GitHub URL

Command failed with exit code 1 (EPERM): node /home/runner/work/next.js/next.js/packages/create-next-app/dist/index.js github-example-path-2 --example https://github.com/zeit/next-learn-demo/tree/master/1-navigate-between-pages --example-path 1-navigate-between-pages

  163 |     await usingTempDir(async (cwd) => {
  164 |       const projectName = 'github-example-path-2'
> 165 |       const res = await run(
      |                   ^
  166 |         cwd,
  167 |         projectName,
  168 |         '--example',

  at makeError (../node_modules/execa/lib/error.js:58:11)
  at handlePromise (../node_modules/execa/index.js:112:26)
  at integration/create-next-app/index.test.js:165:19
  at usingTempDir (integration/create-next-app/index.test.js:30:12)
  at Object.<anonymous> (integration/create-next-app/index.test.js:163:5)

@ijjk
Copy link
Member

ijjk commented Jul 3, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 13s 13.2s ⚠️ +210ms
nodeModulesSize 66 MB 66 MB -974 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 2.192 2.173 -0.02
/ avg req/sec 1140.33 1150.44 +10.11
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.481 1.525 ⚠️ +0.04
/error-in-render avg req/sec 1687.76 1639.2 ⚠️ -48.56
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 271 B -1 B
Overall change 540 B 539 B -1 B
Rendered Page Sizes
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 959 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-724c96536766536fd91e.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-3f72276743d325d61f71.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-3f72276743d325d61f71.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-724c96536766536fd91e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-3f72276743d325d61f71.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 14.4s 14.4s -17ms
nodeModulesSize 66 MB 66 MB -974 B
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 271 B -1 B
Overall change 540 B 539 B -1 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -382 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -382 B
Commit: 68f7d6c

@ijjk
Copy link
Member

ijjk commented Jul 3, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 13.7s 13.9s ⚠️ +236ms
nodeModulesSize 66 MB 66 MB -943 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 2.335 2.503 ⚠️ +0.17
/ avg req/sec 1070.83 998.64 ⚠️ -72.19
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.606 1.66 ⚠️ +0.05
/error-in-render avg req/sec 1556.48 1506.33 ⚠️ -50.15
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 961 B ⚠️ +2 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB ⚠️ +2 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-d0cd3d2b80934d6c003a.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-5a10d6c964f4c88363cd.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-d0cd3d2b80934d6c003a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 14.7s 14.9s ⚠️ +189ms
nodeModulesSize 66 MB 66 MB -943 B
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 914 kB 914 kB -352 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -352 B
Commit: 528e7d4

@ijjk
Copy link
Member

ijjk commented Jul 3, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 12.8s 12.8s ⚠️ +17ms
nodeModulesSize 66 MB 66 MB -943 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 2.184 2.298 ⚠️ +0.11
/ avg req/sec 1144.81 1087.73 ⚠️ -57.08
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.455 1.475 ⚠️ +0.02
/error-in-render avg req/sec 1718.72 1694.45 ⚠️ -24.27
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 955 B 955 B
link.html gzip 961 B 962 B ⚠️ +1 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.87 kB ⚠️ +1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-d0cd3d2b80934d6c003a.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-5a10d6c964f4c88363cd.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-d0cd3d2b80934d6c003a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 14.7s 14.2s -522ms
nodeModulesSize 66 MB 66 MB -943 B
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..18e4.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary Janpot/next.js refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 915 kB 914 kB -352 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -352 B
Commit: 38eea9e

@Janpot Janpot changed the title Resolve links against router pathname and not window.location basePath: Resolve links against router pathname instead of window.location Jul 3, 2020
@ijjk
Copy link
Member

ijjk commented Jul 7, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 13.7s 13.6s -173ms
nodeModulesSize 66.1 MB 66.1 MB -943 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
/ failed reqs 0 0
/ total time (seconds) 2.273 2.36 ⚠️ +0.09
/ avg req/sec 1099.73 1059.42 ⚠️ -40.31
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.499 1.58 ⚠️ +0.08
/error-in-render avg req/sec 1667.54 1582.12 ⚠️ -85.42
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..6834.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link 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 refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary Janpot/next.js refactor-link Change
index.html gzip 953 B 953 B
link.html gzip 959 B 960 B ⚠️ +1 B
withRouter.html gzip 945 B 945 B
Overall change 2.86 kB 2.86 kB ⚠️ +1 B

Diffs

Diff for _buildManifest.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-f35cd1774d910f5523ed.js"],
   "/_error": ["static\u002Fpages\u002F_error-f39e6723c6acde17325a.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-9e216cd51bf04b309e08.js"],
-  "/link": ["static\u002Fpages\u002Flink-4ce0c7178d36c3b390c2.js"],
+  "/link": ["static\u002Fpages\u002Flink-d0cd3d2b80934d6c003a.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-b95d3f54c75949a43da6.js"
   ],
Diff for _buildManifest.module.js
@@ -2,7 +2,7 @@ self.__BUILD_MANIFEST = {
   "/": ["static\u002Fpages\u002Findex-da343bca3b67f1bcf42d.module.js"],
   "/_error": ["static\u002Fpages\u002F_error-b3c4c3f8dbb1417657e6.module.js"],
   "/hooks": ["static\u002Fpages\u002Fhooks-dc8f274035a2839a1e61.module.js"],
-  "/link": ["static\u002Fpages\u002Flink-4c38d18e319a774ec055.module.js"],
+  "/link": ["static\u002Fpages\u002Flink-5a10d6c964f4c88363cd.module.js"],
   "/routerDirect": [
     "static\u002Fpages\u002FrouterDirect-c62f258dff7fece0a732.module.js"
   ],
Diff for link.html
@@ -36,7 +36,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      href="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -146,13 +146,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/pages/link-4ce0c7178d36c3b390c2.js"
+      src="/_next/static/pages/link-d0cd3d2b80934d6c003a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/pages/link-4c38d18e319a774ec055.module.js"
+      src="/_next/static/pages/link-5a10d6c964f4c88363cd.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
buildDuration 14.8s 14.6s -214ms
nodeModulesSize 66.1 MB 66.1 MB -943 B
Client Bundles (main, webpack, commons)
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..6834.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary Janpot/next.js refactor-link Change
main-HASH.module.js gzip 5.71 kB 5.71 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.09 kB 7.09 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary Janpot/next.js refactor-link 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 refactor-link Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles Overall decrease ✓
vercel/next.js canary Janpot/next.js refactor-link Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 876 kB 876 kB
link.js 915 kB 914 kB -352 B
routerDirect.js 908 kB 908 kB
withRouter.js 908 kB 908 kB
Overall change 4.49 MB 4.49 MB -352 B
Commit: f666821

@kodiakhq kodiakhq bot merged commit 2f78d88 into vercel:canary Jul 7, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
…ation (vercel#14804)

Currently following links are broken when using `basePath`:
```jsx
// pages/hello.js
    <Link href="#hashlink">
      <a id="hashlink">Hash Link</a>
    </Link>
```
with `basePath: '/docs'`, this will navigate to `/docs/docs/hello#hashlink` instead of `/docs/hello#hashlink`

I have a further optimization that builds on this branch that removes `url.parse` and `url.resolve` in favor for `new URL()` in router and link. Will PR when this gets merged.
? resolve(router.pathname, formatUrl(props.as))
: resolvedHref,
}
}, [router.pathname, props.href, props.as])

Choose a reason for hiding this comment

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

This line breaks the component if rendered outside <RouteContext>, since router is undefined.

See #15543

@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.

4 participants