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

Ensure basePath behavior with GS(S)P redirect #18988

Merged
merged 5 commits into from
Nov 11, 2020

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Nov 9, 2020

This ensures we match the basePath handling for redirects in next.config.js with redirects from getStaticProps and getServerSideProps and also adds a separate test suite to ensure GS(S)P redirects with basePath work correctly

Fixes: #18984
Closes: #18892

@ijjk ijjk added the type: next label Nov 9, 2020
@vercel vercel bot temporarily deployed to Preview November 9, 2020 17:55 Inactive
@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Nov 9, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 13.7s 14.3s ⚠️ +576ms
nodeModulesSize 85 MB 85 MB ⚠️ +2.97 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
/ failed reqs 0 0
/ total time (seconds) 2.726 2.705 -0.02
/ avg req/sec 917.18 924.23 +7.05
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.755 1.781 ⚠️ +0.03
/error-in-render avg req/sec 1424.85 1403.83 ⚠️ -21.02
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB ⚠️ +24 B
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB 7.05 kB ⚠️ +16 B
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
index.html gzip 1 kB 999 B -3 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 995 B 992 B -3 B
Overall change 3.01 kB 3 kB -8 B

Diffs

Diff for 677f882d2ed8..41.module.js
@@ -1232,10 +1232,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   destination
                 );
 
-                this._resolveHref(parsedHref, pages);
+                this._resolveHref(parsedHref, pages, false);
 
                 if (pages.includes(parsedHref.pathname)) {
-                  return this.change(method, destination, destination, options);
+                  var { url: newUrl, as: newAs } = prepareUrlAs(
+                    this,
+                    destination,
+                    destination
+                  );
+                  return this.change(method, newUrl, newAs, options);
                 }
               }
Diff for 677f882d2ed8..b2be9a27e.js
@@ -1275,6 +1275,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     __N_SSP,
                     destination,
                     parsedHref,
+                    _prepareUrlAs3,
+                    newUrl,
+                    newAs,
                     appComp;
 
                   return _regeneratorRuntime.wrap(
@@ -1513,7 +1516,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                 props.pageProps.__N_REDIRECT
                               )
                             ) {
-                              _context.next = 66;
+                              _context.next = 67;
                               break;
                             }
 
@@ -1522,38 +1525,40 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             // it's not
 
                             if (!destination.startsWith("/")) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
                             parsedHref = (0,
                             _parseRelativeUrl.parseRelativeUrl)(destination);
 
-                            this._resolveHref(parsedHref, pages);
+                            this._resolveHref(parsedHref, pages, false);
 
                             if (!pages.includes(parsedHref.pathname)) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
+                            (_prepareUrlAs3 = prepareUrlAs(
+                              this,
+                              destination,
+                              destination
+                            )),
+                              (newUrl = _prepareUrlAs3.url),
+                              (newAs = _prepareUrlAs3.as);
                             return _context.abrupt(
                               "return",
-                              this.change(
-                                method,
-                                destination,
-                                destination,
-                                options
-                              )
+                              this.change(method, newUrl, newAs, options)
                             );
 
-                          case 64:
+                          case 65:
                             window.location.href = destination;
                             return _context.abrupt(
                               "return",
                               new Promise(function() {})
                             );
 
-                          case 66:
+                          case 67:
                             Router.events.emit("beforeHistoryChange", as);
                             this.changeState(
                               method,
@@ -1565,7 +1570,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 71;
+                            _context.next = 72;
                             return this.set(
                               route,
                               pathname,
@@ -1577,9 +1582,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 71:
+                          case 72:
                             if (!error) {
-                              _context.next = 74;
+                              _context.next = 75;
                               break;
                             }
 
@@ -1590,7 +1595,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 74:
+                          case 75:
                             if (false) {
                             }
 
@@ -1600,21 +1605,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 80:
-                            _context.prev = 80;
+                          case 81:
+                            _context.prev = 81;
                             _context.t0 = _context["catch"](52);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 84;
+                              _context.next = 85;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 84:
+                          case 85:
                             throw _context.t0;
 
-                          case 85:
+                          case 86:
                           case "end":
                             return _context.stop();
                         }
@@ -1622,7 +1627,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[52, 80]]
+                    [[52, 81]]
                   );
                 })
               );
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 15.6s 15.9s ⚠️ +303ms
nodeModulesSize 85 MB 85 MB ⚠️ +2.97 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-56c34a4..e157.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..3888.js gzip N/A 11.3 kB N/A
Overall change 58.4 kB 58.4 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-c8c3589..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 7.05 kB N/A
Overall change 53.1 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_error.js 915 kB 916 kB ⚠️ +512 B
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 916 kB ⚠️ +512 B
link.js 964 kB 965 kB ⚠️ +641 B
routerDirect.js 957 kB 958 kB ⚠️ +641 B
withRouter.js 957 kB 958 kB ⚠️ +641 B
Overall change 4.72 MB 4.72 MB ⚠️ +2.95 kB
Commit: 797a510

@vercel vercel bot temporarily deployed to Preview November 9, 2020 18:37 Inactive
@ijjk
Copy link
Member Author

ijjk commented Nov 9, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 12.9s 12.9s -54ms
nodeModulesSize 85 MB 85 MB ⚠️ +3.35 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
/ failed reqs 0 0
/ total time (seconds) 2.381 2.336 -0.04
/ avg req/sec 1050.02 1070.13 +20.11
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.242 1.22 -0.02
/error-in-render avg req/sec 2012.54 2048.75 +36.21
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB ⚠️ +24 B
framework.HASH.js gzip 39 kB 39 kB
main-6a509b2..b31a.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB 7.05 kB ⚠️ +16 B
framework.HA..dule.js gzip 39 kB 39 kB
main-0547acd..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
index.html gzip 1 kB 1 kB -3 B
link.html gzip 1.01 kB 1.01 kB -3 B
withRouter.html gzip 996 B 993 B -3 B
Overall change 3.01 kB 3 kB -9 B

Diffs

Diff for 677f882d2ed8..41.module.js
@@ -1232,10 +1232,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   destination
                 );
 
-                this._resolveHref(parsedHref, pages);
+                this._resolveHref(parsedHref, pages, false);
 
                 if (pages.includes(parsedHref.pathname)) {
-                  return this.change(method, destination, destination, options);
+                  var { url: newUrl, as: newAs } = prepareUrlAs(
+                    this,
+                    destination,
+                    destination
+                  );
+                  return this.change(method, newUrl, newAs, options);
                 }
               }
Diff for 677f882d2ed8..b2be9a27e.js
@@ -1275,6 +1275,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     __N_SSP,
                     destination,
                     parsedHref,
+                    _prepareUrlAs3,
+                    newUrl,
+                    newAs,
                     appComp;
 
                   return _regeneratorRuntime.wrap(
@@ -1513,7 +1516,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                 props.pageProps.__N_REDIRECT
                               )
                             ) {
-                              _context.next = 66;
+                              _context.next = 67;
                               break;
                             }
 
@@ -1522,38 +1525,40 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             // it's not
 
                             if (!destination.startsWith("/")) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
                             parsedHref = (0,
                             _parseRelativeUrl.parseRelativeUrl)(destination);
 
-                            this._resolveHref(parsedHref, pages);
+                            this._resolveHref(parsedHref, pages, false);
 
                             if (!pages.includes(parsedHref.pathname)) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
+                            (_prepareUrlAs3 = prepareUrlAs(
+                              this,
+                              destination,
+                              destination
+                            )),
+                              (newUrl = _prepareUrlAs3.url),
+                              (newAs = _prepareUrlAs3.as);
                             return _context.abrupt(
                               "return",
-                              this.change(
-                                method,
-                                destination,
-                                destination,
-                                options
-                              )
+                              this.change(method, newUrl, newAs, options)
                             );
 
-                          case 64:
+                          case 65:
                             window.location.href = destination;
                             return _context.abrupt(
                               "return",
                               new Promise(function() {})
                             );
 
-                          case 66:
+                          case 67:
                             Router.events.emit("beforeHistoryChange", as);
                             this.changeState(
                               method,
@@ -1565,7 +1570,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 71;
+                            _context.next = 72;
                             return this.set(
                               route,
                               pathname,
@@ -1577,9 +1582,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 71:
+                          case 72:
                             if (!error) {
-                              _context.next = 74;
+                              _context.next = 75;
                               break;
                             }
 
@@ -1590,7 +1595,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 74:
+                          case 75:
                             if (false) {
                             }
 
@@ -1600,21 +1605,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 80:
-                            _context.prev = 80;
+                          case 81:
+                            _context.prev = 81;
                             _context.t0 = _context["catch"](52);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 84;
+                              _context.next = 85;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 84:
+                          case 85:
                             throw _context.t0;
 
-                          case 85:
+                          case 86:
                           case "end":
                             return _context.stop();
                         }
@@ -1622,7 +1627,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[52, 80]]
+                    [[52, 81]]
                   );
                 })
               );
Diff for index.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -126,13 +126,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -121,13 +121,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 14.4s 14.6s ⚠️ +151ms
nodeModulesSize 85 MB 85 MB ⚠️ +3.35 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-6a509b2..b31a.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..3888.js gzip N/A 11.3 kB N/A
Overall change 58.4 kB 58.4 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-0547acd..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 7.05 kB N/A
Overall change 53.1 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_error.js 915 kB 916 kB ⚠️ +512 B
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 916 kB ⚠️ +512 B
link.js 964 kB 965 kB ⚠️ +641 B
routerDirect.js 957 kB 958 kB ⚠️ +641 B
withRouter.js 957 kB 958 kB ⚠️ +641 B
Overall change 4.72 MB 4.72 MB ⚠️ +2.95 kB
Commit: 6805d0a

@vercel vercel bot temporarily deployed to Preview November 11, 2020 01:53 Inactive
@ijjk
Copy link
Member Author

ijjk commented Nov 11, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 14.2s 12.8s -1.4s
nodeModulesSize 80.4 MB 85 MB ⚠️ +4.67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
/ failed reqs 0 0
/ total time (seconds) 2.775 2.642 -0.13
/ avg req/sec 900.76 946.37 +45.61
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.614 1.61 0
/error-in-render avg req/sec 1549.37 1553.03 +3.66
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB ⚠️ +24 B
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB 7.48 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.5 kB 58.5 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB 7.05 kB ⚠️ +16 B
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.2 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
index.html gzip 970 B 969 B -1 B
link.html gzip 978 B 977 B -1 B
withRouter.html gzip 964 B 963 B -1 B
Overall change 2.91 kB 2.91 kB -3 B

Diffs

Diff for 677f882d2ed8..41.module.js
@@ -1232,10 +1232,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   destination
                 );
 
-                this._resolveHref(parsedHref, pages);
+                this._resolveHref(parsedHref, pages, false);
 
                 if (pages.includes(parsedHref.pathname)) {
-                  return this.change(method, destination, destination, options);
+                  var { url: newUrl, as: newAs } = prepareUrlAs(
+                    this,
+                    destination,
+                    destination
+                  );
+                  return this.change(method, newUrl, newAs, options);
                 }
               }
Diff for 677f882d2ed8..b2be9a27e.js
@@ -1275,6 +1275,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     __N_SSP,
                     destination,
                     parsedHref,
+                    _prepareUrlAs3,
+                    newUrl,
+                    newAs,
                     appComp;
 
                   return _regeneratorRuntime.wrap(
@@ -1513,7 +1516,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                 props.pageProps.__N_REDIRECT
                               )
                             ) {
-                              _context.next = 66;
+                              _context.next = 67;
                               break;
                             }
 
@@ -1522,38 +1525,40 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             // it's not
 
                             if (!destination.startsWith("/")) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
                             parsedHref = (0,
                             _parseRelativeUrl.parseRelativeUrl)(destination);
 
-                            this._resolveHref(parsedHref, pages);
+                            this._resolveHref(parsedHref, pages, false);
 
                             if (!pages.includes(parsedHref.pathname)) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
+                            (_prepareUrlAs3 = prepareUrlAs(
+                              this,
+                              destination,
+                              destination
+                            )),
+                              (newUrl = _prepareUrlAs3.url),
+                              (newAs = _prepareUrlAs3.as);
                             return _context.abrupt(
                               "return",
-                              this.change(
-                                method,
-                                destination,
-                                destination,
-                                options
-                              )
+                              this.change(method, newUrl, newAs, options)
                             );
 
-                          case 64:
+                          case 65:
                             window.location.href = destination;
                             return _context.abrupt(
                               "return",
                               new Promise(function() {})
                             );
 
-                          case 66:
+                          case 67:
                             Router.events.emit("beforeHistoryChange", as);
                             this.changeState(
                               method,
@@ -1565,7 +1570,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 71;
+                            _context.next = 72;
                             return this.set(
                               route,
                               pathname,
@@ -1577,9 +1582,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 71:
+                          case 72:
                             if (!error) {
-                              _context.next = 74;
+                              _context.next = 75;
                               break;
                             }
 
@@ -1590,7 +1595,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 74:
+                          case 75:
                             if (false) {
                             }
 
@@ -1600,21 +1605,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 80:
-                            _context.prev = 80;
+                          case 81:
+                            _context.prev = 81;
                             _context.t0 = _context["catch"](52);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 84;
+                              _context.next = 85;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 84:
+                          case 85:
                             throw _context.t0;
 
-                          case 85:
+                          case 86:
                           case "end":
                             return _context.stop();
                         }
@@ -1622,7 +1627,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[52, 80]]
+                    [[52, 81]]
                   );
                 })
               );
Diff for index.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 16s 16s -47ms
nodeModulesSize 85 MB 85 MB ⚠️ +3.35 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB 7.48 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..3888.js gzip N/A 11.3 kB N/A
Overall change 58.5 kB 58.5 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 7.05 kB N/A
Overall change 53.2 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_error.js 915 kB 916 kB ⚠️ +512 B
404.html 4.61 kB 4.61 kB
hooks.html 3.86 kB 3.86 kB
index.js 916 kB 916 kB ⚠️ +512 B
link.js 965 kB 965 kB ⚠️ +641 B
routerDirect.js 957 kB 958 kB ⚠️ +641 B
withRouter.js 957 kB 958 kB ⚠️ +641 B
Overall change 4.72 MB 4.72 MB ⚠️ +2.95 kB
Commit: 1a80947

@ijjk
Copy link
Member Author

ijjk commented Nov 11, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 12.1s 12.2s ⚠️ +106ms
nodeModulesSize 85 MB 85 MB ⚠️ +3.35 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
/ failed reqs 0 0
/ total time (seconds) 2.297 2.367 ⚠️ +0.07
/ avg req/sec 1088.59 1056.2 ⚠️ -32.39
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.182 1.243 ⚠️ +0.06
/error-in-render avg req/sec 2114.79 2010.61 ⚠️ -104.18
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB ⚠️ +24 B
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB 7.48 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.5 kB 58.5 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB 7.05 kB ⚠️ +16 B
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.2 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
index.html gzip 970 B 969 B -1 B
link.html gzip 978 B 977 B -1 B
withRouter.html gzip 964 B 963 B -1 B
Overall change 2.91 kB 2.91 kB -3 B

Diffs

Diff for 677f882d2ed8..41.module.js
@@ -1232,10 +1232,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   destination
                 );
 
-                this._resolveHref(parsedHref, pages);
+                this._resolveHref(parsedHref, pages, false);
 
                 if (pages.includes(parsedHref.pathname)) {
-                  return this.change(method, destination, destination, options);
+                  var { url: newUrl, as: newAs } = prepareUrlAs(
+                    this,
+                    destination,
+                    destination
+                  );
+                  return this.change(method, newUrl, newAs, options);
                 }
               }
Diff for 677f882d2ed8..b2be9a27e.js
@@ -1275,6 +1275,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     __N_SSP,
                     destination,
                     parsedHref,
+                    _prepareUrlAs3,
+                    newUrl,
+                    newAs,
                     appComp;
 
                   return _regeneratorRuntime.wrap(
@@ -1513,7 +1516,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                 props.pageProps.__N_REDIRECT
                               )
                             ) {
-                              _context.next = 66;
+                              _context.next = 67;
                               break;
                             }
 
@@ -1522,38 +1525,40 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             // it's not
 
                             if (!destination.startsWith("/")) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
                             parsedHref = (0,
                             _parseRelativeUrl.parseRelativeUrl)(destination);
 
-                            this._resolveHref(parsedHref, pages);
+                            this._resolveHref(parsedHref, pages, false);
 
                             if (!pages.includes(parsedHref.pathname)) {
-                              _context.next = 64;
+                              _context.next = 65;
                               break;
                             }
 
+                            (_prepareUrlAs3 = prepareUrlAs(
+                              this,
+                              destination,
+                              destination
+                            )),
+                              (newUrl = _prepareUrlAs3.url),
+                              (newAs = _prepareUrlAs3.as);
                             return _context.abrupt(
                               "return",
-                              this.change(
-                                method,
-                                destination,
-                                destination,
-                                options
-                              )
+                              this.change(method, newUrl, newAs, options)
                             );
 
-                          case 64:
+                          case 65:
                             window.location.href = destination;
                             return _context.abrupt(
                               "return",
                               new Promise(function() {})
                             );
 
-                          case 66:
+                          case 67:
                             Router.events.emit("beforeHistoryChange", as);
                             this.changeState(
                               method,
@@ -1565,7 +1570,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 71;
+                            _context.next = 72;
                             return this.set(
                               route,
                               pathname,
@@ -1577,9 +1582,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 71:
+                          case 72:
                             if (!error) {
-                              _context.next = 74;
+                              _context.next = 75;
                               break;
                             }
 
@@ -1590,7 +1595,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 74:
+                          case 75:
                             if (false) {
                             }
 
@@ -1600,21 +1605,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 80:
-                            _context.prev = 80;
+                          case 81:
+                            _context.prev = 81;
                             _context.t0 = _context["catch"](52);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 84;
+                              _context.next = 85;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 84:
+                          case 85:
                             throw _context.t0;
 
-                          case 85:
+                          case 86:
                           case "end":
                             return _context.stop();
                         }
@@ -1622,7 +1627,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[52, 80]]
+                    [[52, 81]]
                   );
                 })
               );
Diff for index.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6b4511cd17e1524c6341.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a2ba07a682852f748bcf.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
buildDuration 13.8s 14.2s ⚠️ +352ms
nodeModulesSize 85 MB 85 MB ⚠️ +3.35 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB 7.48 kB
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..3888.js gzip N/A 11.3 kB N/A
Overall change 58.5 kB 58.5 kB ⚠️ +24 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
677f882d2ed8..dule.js gzip 7.04 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 7.05 kB N/A
Overall change 53.2 kB 53.2 kB ⚠️ +16 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 652 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js gssp/redirect-basepath Change
_error.js 915 kB 916 kB ⚠️ +512 B
404.html 4.61 kB 4.61 kB
hooks.html 3.86 kB 3.86 kB
index.js 916 kB 916 kB ⚠️ +512 B
link.js 965 kB 965 kB ⚠️ +641 B
routerDirect.js 957 kB 958 kB ⚠️ +641 B
withRouter.js 957 kB 958 kB ⚠️ +641 B
Overall change 4.72 MB 4.72 MB ⚠️ +2.95 kB
Commit: 6543966

@kodiakhq kodiakhq bot merged commit 48acc47 into vercel:canary Nov 11, 2020
@ijjk ijjk deleted the gssp/redirect-basepath branch November 11, 2020 16:58
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 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.

SSR redirect destition with basePath
2 participants