Skip to content

Commit

Permalink
v9.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Sep 1, 2020
1 parent 48ce4de commit b6df810
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "9.5.3-canary.27"
"version": "9.5.3"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-google-analytics",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-google-analytics"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-sentry",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-sentry"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -77,8 +77,8 @@
"@babel/preset-typescript": "7.10.4",
"@babel/runtime": "7.11.2",
"@babel/types": "7.11.5",
"@next/react-dev-overlay": "9.5.3-canary.27",
"@next/react-refresh-utils": "9.5.3-canary.27",
"@next/react-dev-overlay": "9.5.3",
"@next/react-refresh-utils": "9.5.3",
"ast-types": "0.13.2",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-define": "2.0.0",
Expand Down Expand Up @@ -123,7 +123,7 @@
"react-dom": "^16.6.0"
},
"devDependencies": {
"@next/polyfill-nomodule": "9.5.3-canary.27",
"@next/polyfill-nomodule": "9.5.3",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "9.5.3-canary.27",
"version": "9.5.3",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down

1 comment on commit b6df810

@ijjk
Copy link
Member

@ijjk ijjk commented on b6df810 Sep 1, 2020

Choose a reason for hiding this comment

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

Stats from current release

Default Server Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
buildDuration 12.4s 12.3s -62ms
nodeModulesSize 56.7 MB 55.9 MB -779 kB
Page Load Tests Overall increase ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
/ failed reqs 0 0
/ total time (seconds) 2.177 2.236 ⚠️ +0.06
/ avg req/sec 1148.22 1118.09 ⚠️ -30.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.216 1.169 -0.05
/error-in-render avg req/sec 2056.02 2139.39 +83.37
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
677f882d2ed8..6aa6.js gzip 10 kB 10.3 kB ⚠️ +255 B
framework.HASH.js gzip 39.1 kB 39 kB -180 B
main-9a7a5f4..661e.js gzip 6.71 kB 7.31 kB ⚠️ +597 B
webpack-ccf5..276a.js gzip 751 B 751 B
Overall change 56.6 kB 57.3 kB ⚠️ +672 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
677f882d2ed8..dule.js gzip 5.92 kB 6.13 kB ⚠️ +204 B
framework.HA..dule.js gzip 39.1 kB 39 kB -180 B
main-d0ac695..dule.js gzip 5.79 kB 6.37 kB ⚠️ +586 B
webpack-10c7..dule.js gzip 751 B 751 B
Overall change 51.6 kB 52.2 kB ⚠️ +610 B
Legacy Client Bundles (polyfills) Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
polyfills-75..1629.js gzip 31 kB 31 kB -31 B
Overall change 31 kB 31 kB -31 B
Client Pages Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_app-874bd8a..0103.js gzip 1.28 kB 1.28 kB
_error-fa39c..ec40.js gzip 3.45 kB 3.44 kB -16 B
hooks-585f07..95a3.js gzip 887 B 887 B
index-c7b63f..fc02.js gzip 227 B 227 B
link-4c2bd9b..eadd.js gzip 1.29 kB 1.29 kB -7 B
routerDirect..ebc7.js gzip 284 B 284 B
withRouter-2..db68.js gzip 284 B 284 B
Overall change 7.71 kB 7.69 kB -23 B
Client Pages Modern Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_app-97e743e..dule.js gzip 626 B 625 B -1 B
_error-b4004..dule.js gzip 2.3 kB 2.29 kB -14 B
hooks-696209..dule.js gzip 387 B 387 B
index-a4dd74..dule.js gzip 226 B 226 B
link-236a801..dule.js gzip 1.26 kB 1.26 kB -7 B
routerDirect..dule.js gzip 284 B 284 B
withRouter-1..dule.js gzip 282 B 282 B
Overall change 5.37 kB 5.35 kB -22 B
Client Build Manifests Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_buildManifest.js gzip 273 B 323 B ⚠️ +50 B
_buildManife..dule.js gzip 279 B 329 B ⚠️ +50 B
Overall change 552 B 652 B ⚠️ +100 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
index.html gzip 945 B 971 B ⚠️ +26 B
link.html gzip 954 B 976 B ⚠️ +22 B
withRouter.html gzip 939 B 965 B ⚠️ +26 B
Overall change 2.84 kB 2.91 kB ⚠️ +74 B

Diffs

Diff for _buildManifest.js
@@ -1,17 +1,27 @@
 self.__BUILD_MANIFEST = {
+  __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-deefd9533fb3f2325f40.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-a0c4519f5ca8e97fa7be.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-8001dc76075832ee8949.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3e536e855e7143324b04.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-46fd48c0b73b2f2d75a4.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
   "/withRouter": [
     "static\u002Fchunks\u002Fpages\u002FwithRouter-9af1d72bd996729e701e.js"
+  ],
+  sortedPages: [
+    "\u002F",
+    "\u002F_app",
+    "\u002F_error",
+    "\u002Fhooks",
+    "\u002Flink",
+    "\u002FrouterDirect",
+    "\u002FwithRouter"
   ]
 };
 self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB();
Diff for _buildManifest.module.js
@@ -1,21 +1,31 @@
 self.__BUILD_MANIFEST = {
+  __rewrites: [],
   "/": [
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-ad76988e8f95d02c0721.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
   ],
   "/link": [
-    "static\u002Fchunks\u002Fpages\u002Flink-6fa73e7e8736497268e2.module.js"
+    "static\u002Fchunks\u002Fpages\u002Flink-e2f1e0e7ed02569239da.module.js"
   ],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-368af3dfef3c9cd99dc3.module.js"
   ],
   "/withRouter": [
     "static\u002Fchunks\u002Fpages\u002FwithRouter-654e4c0aa8f6a4177d77.module.js"
+  ],
+  sortedPages: [
+    "\u002F",
+    "\u002F_app",
+    "\u002F_error",
+    "\u002Fhooks",
+    "\u002Flink",
+    "\u002FrouterDirect",
+    "\u002FwithRouter"
   ]
 };
 self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB();
Diff for _error-ad769..21.module.js
@@ -450,7 +450,7 @@ Also adds support for deduplicated `key` properties
               var newProps;
             }
 
-            return _react.default.cloneElement(c, {
+            return /*#__PURE__*/ _react.default.cloneElement(c, {
               key
             });
           });
@@ -501,7 +501,7 @@ Also adds support for deduplicated `key` properties
             };
       }
 
-      var HeadManagerContext = _react.default.createContext({});
+      var HeadManagerContext = /*#__PURE__*/ _react.default.createContext({});
 
       exports.HeadManagerContext = HeadManagerContext;
 
@@ -637,7 +637,7 @@ Also adds support for deduplicated `key` properties
             };
       }
 
-      var AmpStateContext = _react.default.createContext({});
+      var AmpStateContext = /*#__PURE__*/ _react.default.createContext({});
 
       exports.AmpStateContext = AmpStateContext;
Diff for _error-deefd..3f2325f40.js
@@ -539,7 +539,7 @@ Also adds support for deduplicated `key` properties
               var newProps;
             }
 
-            return _react["default"].cloneElement(c, {
+            return /*#__PURE__*/ _react["default"].cloneElement(c, {
               key: key
             });
           });
@@ -613,7 +613,9 @@ Also adds support for deduplicated `key` properties
             };
       }
 
-      var HeadManagerContext = _react["default"].createContext({});
+      var HeadManagerContext = /*#__PURE__*/ _react["default"].createContext(
+        {}
+      );
 
       exports.HeadManagerContext = HeadManagerContext;
 
@@ -1011,7 +1013,7 @@ Also adds support for deduplicated `key` properties
             };
       }
 
-      var AmpStateContext = _react["default"].createContext({});
+      var AmpStateContext = /*#__PURE__*/ _react["default"].createContext({});
 
       exports.AmpStateContext = AmpStateContext;
Diff for link-3e536e8..143324b04.js
@@ -78,8 +78,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var _router = __webpack_require__("elyg");
 
-      var _utils = __webpack_require__("g/15");
-
       var _router2 = __webpack_require__("nOHt");
 
       var cachedObserver;
@@ -198,7 +196,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       function Link(props) {
         if (false) {
-          var hasWarned;
+          var hasWarned,
+            optionalProps,
+            optionalPropsGuard,
+            requiredProps,
+            requiredPropsGuard,
+            createPropError;
         }
 
         var p = props.prefetch !== false;
@@ -307,11 +310,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
           childProps.href = (0, _router.addBasePath)(as);
         }
 
-        return _react["default"].cloneElement(child, childProps);
-      }
-
-      if (false) {
-        var exact, PropTypes, warn;
+        return /*#__PURE__*/ _react["default"].cloneElement(child, childProps);
       }
 
       var _default = Link;
Diff for link-6fa73e7..e2.module.js
@@ -74,8 +74,6 @@
 
       var _router = __webpack_require__("elyg");
 
-      var _utils = __webpack_require__("g/15");
-
       var _router2 = __webpack_require__("nOHt");
 
       var cachedObserver;
@@ -194,7 +192,11 @@
 
       function Link(props) {
         if (false) {
-          var hasWarned;
+          var hasWarned,
+            optionalProps,
+            optionalPropsGuard,
+            requiredProps,
+            requiredPropsGuard;
         }
 
         var p = props.prefetch !== false;
@@ -289,11 +291,7 @@
           childProps.href = (0, _router.addBasePath)(as);
         }
 
-        return _react.default.cloneElement(child, childProps);
-      }
-
-      if (false) {
-        var exact, PropTypes, warn;
+        return /*#__PURE__*/ _react.default.cloneElement(child, childProps);
       }
 
       var _default = Link;
Diff for 677f882d2ed8..29ff1dba4.js
@@ -363,6 +363,13 @@
       /***/
     },
 
+    /***/ S3md: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+
+      /***/
+
+    },
+
     /***/ SksO: /***/ function(module, exports) {
       function _setPrototypeOf(o, p) {
         module.exports = _setPrototypeOf =
@@ -633,7 +640,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           },
           off: function off(type, handler) {
             if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
               all[type].splice(all[type].indexOf(handler) >>> 0, 1);
             }
           },
@@ -681,21 +687,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
+      var _normalizeTrailingSlash = __webpack_require__("X24+");
+
+      var _denormalizePagePath = __webpack_require__("wkBG");
+
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
 
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
+      var _parseRelativeUrl = __webpack_require__("hS4m");
 
       var _querystring = __webpack_require__("3WeD");
 
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _resolveRewrites = _interopRequireDefault(
+        __webpack_require__("S3md")
+      );
 
-      var _normalizeTrailingSlash = __webpack_require__("X24+");
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function _interopRequireDefault(obj) {
         return obj && obj.__esModule
@@ -792,17 +804,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         };
       }
 
-      function tryParseRelativeUrl(url) {
-        try {
-          return (0, _parseRelativeUrl.parseRelativeUrl)(url);
-        } catch (err) {
-          if (false) {
-          }
-
-          return null;
-        }
-      }
-
       var manualScrollRestoration = false && false;
 
       function fetchRetry(url, attempts) {
@@ -860,6 +861,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             App = _ref.App,
             wrapApp = _ref.wrapApp,
             Component = _ref.Component,
+            initialStyleSheets = _ref.initialStyleSheets,
             err = _ref.err,
             subscription = _ref.subscription,
             isFallback = _ref.isFallback;
@@ -882,6 +884,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.isSsr = void 0;
           this.isFallback = void 0;
           this._inFlightRoute = void 0;
+          this._shallow = void 0;
 
           this.onPopState = function(e) {
             var state = e.state;
@@ -936,7 +939,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               return;
             }
 
-            _this.change("replaceState", url, as, options);
+            _this.change(
+              "replaceState",
+              url,
+              as,
+              Object.assign({}, options, {
+                shallow: options.shallow && _this._shallow
+              })
+            );
           }; // represents the current component key
 
           this.route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(
@@ -950,6 +960,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           if (_pathname !== "/_error") {
             this.components[this.route] = {
               Component: Component,
+              styleSheets: initialStyleSheets,
               props: initialProps,
               err: err,
               __N_SSG: initialProps && initialProps.__N_SSG,
@@ -958,7 +969,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           }
 
           this.components["/_app"] = {
-            Component: App
+            Component: App,
+            styleSheets: [
+              /* /_app does not need its stylesheets managed */
+            ]
           }; // Backwards compat for Router.router.events
           // TODO: Should be remove the following major version as it was never documented
 
@@ -1008,35 +1022,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         }
 
         _createClass(Router, [
-          {
-            key: "update",
-            value: function update(route, mod) {
-              var Component = mod["default"] || mod;
-              var data = this.components[route];
-
-              if (!data) {
-                throw new Error(
-                  "Cannot update unavailable route: ".concat(route)
-                );
-              }
-
-              var newData = Object.assign({}, data, {
-                Component: Component,
-                __N_SSG: mod.__N_SSG,
-                __N_SSP: mod.__N_SSP
-              });
-              this.components[route] = newData; // pages/_app.js updated
-
-              if (route === "/_app") {
-                this.notify(this.components[this.route]);
-                return;
-              }
-
-              if (route === this.route) {
-                this.notify(newData);
-              }
-            }
-          },
           {
             key: "reload",
             value: function reload() {
@@ -1110,14 +1095,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   as,
                   options
                 ) {
+                  var _this2 = this;
+
                   var cleanedAs,
+                    pages,
+                    _yield$this$pageLoade,
+                    rewrites,
                     parsed,
+                    _parsed,
                     pathname,
                     searchParams,
                     query,
                     route,
                     _options$shallow,
                     shallow,
+                    resolvedAs,
                     _ref3,
                     asPathname,
                     routeRegex,
@@ -1168,7 +1160,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             }
 
                             this.asPath = cleanedAs;
-                            Router.events.emit("hashChangeStart", as);
+                            Router.events.emit("hashChangeStart", as); // TODO: do we need the resolved href when only a hash change?
+
                             this.changeState(method, url, as, options);
                             this.scrollToHash(cleanedAs);
                             this.notify(this.components[this.route]);
@@ -1176,18 +1169,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             return _context.abrupt("return", true);
 
                           case 16:
-                            parsed = tryParseRelativeUrl(url);
+                            _context.next = 18;
+                            return this.pageLoader.getPageList();
 
-                            if (parsed) {
-                              _context.next = 19;
-                              break;
-                            }
+                          case 18:
+                            pages = _context.sent;
+                            _context.next = 21;
+                            return this.pageLoader.promisedBuildManifest;
 
-                            return _context.abrupt("return", false);
+                          case 21:
+                            _yield$this$pageLoade = _context.sent;
+                            rewrites = _yield$this$pageLoade.__rewrites;
+                            parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+                              url
+                            );
+                            (_parsed = parsed),
+                              (pathname = _parsed.pathname),
+                              (searchParams = _parsed.searchParams);
+                            parsed = this._resolveHref(parsed, pages);
+
+                            if (parsed.pathname !== pathname) {
+                              pathname = parsed.pathname;
+                              url = (0, _utils.formatWithValidation)(parsed);
+                            }
 
-                          case 19:
-                            (pathname = parsed.pathname),
-                              (searchParams = parsed.searchParams);
                             query = (0, _querystring.searchParamsToUrlQuery)(
                               searchParams
                             ); // url and as should always be prefixed with basePath by this
@@ -1217,15 +1222,23 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               (shallow =
                                 _options$shallow === void 0
                                   ? false
-                                  : _options$shallow);
+                                  : _options$shallow); // we need to resolve the as value using rewrites for dynamic SSG
+                            // pages to allow building the data URL correctly
+
+                            resolvedAs = as;
+
+                            if (false) {
+                            }
+
+                            resolvedAs = delBasePath(resolvedAs);
 
                             if (!(0, _isDynamic.isDynamicRoute)(route)) {
-                              _context.next = 37;
+                              _context.next = 47;
                               break;
                             }
 
                             (_ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(
-                              cleanedAs
+                              resolvedAs
                             )),
                               (asPathname = _ref3.pathname);
                             routeRegex = (0, _routeRegex.getRouteRegex)(route);
@@ -1234,7 +1247,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             )(asPathname);
 
                             if (routeMatch) {
-                              _context.next = 36;
+                              _context.next = 46;
                               break;
                             }
 
@@ -1245,7 +1258,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             });
 
                             if (!(missingParams.length > 0)) {
-                              _context.next = 34;
+                              _context.next = 44;
                               break;
                             }
 
@@ -1262,18 +1275,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                 "Read more: https://err.sh/vercel/next.js/incompatible-href-as"
                             );
 
-                          case 34:
-                            _context.next = 37;
+                          case 44:
+                            _context.next = 47;
                             break;
 
-                          case 36:
+                          case 46:
                             // Merge params into `query`, overwriting any specified in search
                             Object.assign(query, routeMatch);
 
-                          case 37:
+                          case 47:
                             Router.events.emit("routeChangeStart", as);
-                            _context.prev = 38;
-                            _context.next = 41;
+                            _context.prev = 48;
+                            _context.next = 51;
                             return this.getRouteInfo(
                               route,
                               pathname,
@@ -1282,7 +1295,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               shallow
                             );
 
-                          case 41:
+                          case 51:
                             routeInfo = _context.sent;
                             error = routeInfo.error;
                             Router.events.emit("beforeHistoryChange", as);
@@ -1291,18 +1304,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 48;
+                            _context.next = 58;
                             return this.set(
                               route,
                               pathname,
                               query,
                               cleanedAs,
                               routeInfo
-                            );
+                            )["catch"](function(e) {
+                              if (e.cancelled) error = error || e;
+                              else throw e;
+                            });
 
-                          case 48:
+                          case 58:
                             if (!error) {
-                              _context.next = 51;
+                              _context.next = 61;
                               break;
                             }
 
@@ -1313,28 +1329,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 51:
+                          case 61:
                             if (false) {
                             }
 
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 56:
-                            _context.prev = 56;
-                            _context.t0 = _context["catch"](38);
+                          case 66:
+                            _context.prev = 66;
+                            _context.t0 = _context["catch"](48);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 60;
+                              _context.next = 70;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 60:
+                          case 70:
                             throw _context.t0;
 
-                          case 61:
+                          case 71:
                           case "end":
                             return _context.stop();
                         }
@@ -1342,7 +1358,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[38, 56]]
+                    [[48, 66]]
                   );
                 })
               );
@@ -1366,6 +1382,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               }
 
               if (method !== "pushState" || (0, _utils.getURL)() !== as) {
+                this._shallow = options.shallow;
                 window.history[method](
                   {
                     url: url,
@@ -1392,7 +1409,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   as,
                   loadErrorFail
                 ) {
-                  var _yield$this$fetchComp, Component, routeInfo;
+                  var _yield$this$fetchComp, Component, styleSheets, routeInfo;
 
                   return _regeneratorRuntime.wrap(
                     function _callee2$(_context2) {
@@ -1431,38 +1448,40 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                           case 9:
                             _yield$this$fetchComp = _context2.sent;
                             Component = _yield$this$fetchComp.page;
+                            styleSheets = _yield$this$fetchComp.styleSheets;
                             routeInfo = {
                               Component: Component,
+                              styleSheets: styleSheets,
                               err: err,
                               error: err
                             };
-                            _context2.prev = 12;
-                            _context2.next = 15;
+                            _context2.prev = 13;
+                            _context2.next = 16;
                             return this.getInitialProps(Component, {
                               err: err,
                               pathname: pathname,
                               query: query
                             });
 
-                          case 15:
+                          case 16:
                             routeInfo.props = _context2.sent;
-                            _context2.next = 22;
+                            _context2.next = 23;
                             break;
 
-                          case 18:
-                            _context2.prev = 18;
-                            _context2.t0 = _context2["catch"](12);
+                          case 19:
+                            _context2.prev = 19;
+                            _context2.t0 = _context2["catch"](13);
                             console.error(
                               "Error in error page `getInitialProps`: ",
                               _context2.t0
                             );
                             routeInfo.props = {};
 
-                          case 22:
+                          case 23:
                             return _context2.abrupt("return", routeInfo);
 
-                          case 25:
-                            _context2.prev = 25;
+                          case 26:
+                            _context2.prev = 26;
                             _context2.t1 = _context2["catch"](6);
                             return _context2.abrupt(
                               "return",
@@ -1475,7 +1494,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               )
                             );
 
-                          case 28:
+                          case 29:
                           case "end":
                             return _context2.stop();
                         }
@@ -1484,8 +1503,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _callee2,
                     this,
                     [
-                      [6, 25],
-                      [12, 18]
+                      [6, 26],
+                      [13, 19]
                     ]
                   );
                 })
@@ -1508,7 +1527,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   query,
                   as
                 ) {
-                  var _this2 = this;
+                  var _this3 = this;
 
                   var shallow,
                     cachedRouteInfo,
@@ -1564,6 +1583,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             ) {
                               return {
                                 Component: res.page,
+                                styleSheets: res.styleSheets,
                                 __N_SSG: res.mod.__N_SSG,
                                 __N_SSP: res.mod.__N_SSP
                               };
@@ -1614,7 +1634,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                   pathname: pathname,
                                   query: query
                                 }),
-                                as,
+                                delBasePath(as),
                                 __N_SSG
                               );
                             }
@@ -1622,10 +1642,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             _context3.next = 21;
                             return this._getData(function() {
                               return __N_SSG
-                                ? _this2._getStaticData(dataHref)
+                                ? _this3._getStaticData(dataHref)
                                 : __N_SSP
-                                ? _this2._getServerData(dataHref)
-                                : _this2.getInitialProps(
+                                ? _this3._getServerData(dataHref)
+                                : _this3.getInitialProps(
                                     Component, // we provide AppTree later so this needs to be `any`
                                     {
                                       pathname: pathname,
@@ -1760,6 +1780,34 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             value: function urlIsNew(asPath) {
               return this.asPath !== asPath;
             }
+          },
+          {
+            key: "_resolveHref",
+            value: function _resolveHref(parsedHref, pages) {
+              var pathname = parsedHref.pathname;
+              var cleanPathname = (0, _denormalizePagePath.denormalizePagePath)(
+                delBasePath(pathname)
+              );
+
+              if (cleanPathname === "/404" || cleanPathname === "/_error") {
+                return parsedHref;
+              } // handle resolving href for dynamic routes
+
+              if (!pages.includes(cleanPathname)) {
+                // eslint-disable-next-line array-callback-return
+                pages.some(function(page) {
+                  if (
+                    (0, _isDynamic.isDynamicRoute)(page) &&
+                    (0, _routeRegex.getRouteRegex)(page).re.test(cleanPathname)
+                  ) {
+                    parsedHref.pathname = addBasePath(page);
+                    return true;
+                  }
+                });
+              }
+
+              return parsedHref;
+            }
             /**
              * Prefetch page code, you may wait for the data during page rendering.
              * This feature only works in production!
@@ -1775,9 +1823,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   var asPath,
                     options,
                     parsed,
+                    _parsed2,
                     pathname,
+                    pages,
                     route,
                     _args4 = arguments;
+
                   return _regeneratorRuntime.wrap(
                     function _callee4$(_context4) {
                       while (1) {
@@ -1791,31 +1842,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               _args4.length > 2 && _args4[2] !== undefined
                                 ? _args4[2]
                                 : {};
-                            parsed = tryParseRelativeUrl(url);
-
-                            if (parsed) {
-                              _context4.next = 5;
-                              break;
-                            }
+                            parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
+                              url
+                            );
+                            (_parsed2 = parsed), (pathname = _parsed2.pathname);
+                            _context4.next = 6;
+                            return this.pageLoader.getPageList();
 
-                            return _context4.abrupt("return");
+                          case 6:
+                            pages = _context4.sent;
+                            parsed = this._resolveHref(parsed, pages);
 
-                          case 5:
-                            pathname = parsed.pathname; // Prefetch is not supported in development mode because it would trigger on-demand-entries
+                            if (parsed.pathname !== pathname) {
+                              pathname = parsed.pathname;
+                              url = (0, _utils.formatWithValidation)(parsed);
+                            } // Prefetch is not supported in development mode because it would trigger on-demand-entries
 
                             if (true) {
-                              _context4.next = 8;
+                              _context4.next = 11;
                               break;
                             }
 
                             return _context4.abrupt("return");
 
-                          case 8:
+                          case 11:
                             route = (0,
                             _normalizeTrailingSlash.removePathTrailingSlash)(
                               pathname
                             );
-                            _context4.next = 11;
+                            _context4.next = 14;
                             return Promise.all([
                               this.pageLoader.prefetchData(url, asPath),
                               this.pageLoader[
@@ -1823,7 +1878,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               ](route)
                             ]);
 
-                          case 11:
+                          case 14:
                           case "end":
                             return _context4.stop();
                         }
@@ -1910,7 +1965,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           {
             key: "_getData",
             value: function _getData(fn) {
-              var _this3 = this;
+              var _this4 = this;
 
               var cancelled = false;
 
@@ -1920,8 +1975,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
               this.clc = cancel;
               return fn().then(function(data) {
-                if (cancel === _this3.clc) {
-                  _this3.clc = null;
+                if (cancel === _this4.clc) {
+                  _this4.clc = null;
                 }
 
                 if (cancelled) {
@@ -1937,7 +1992,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           {
             key: "_getStaticData",
             value: function _getStaticData(dataHref) {
-              var _this4 = this;
+              var _this5 = this;
 
               var _URL = new URL(dataHref, window.location.href),
                 cacheKey = _URL.href;
@@ -1947,7 +2002,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               }
 
               return fetchNextData(dataHref, this.isSsr).then(function(data) {
-                _this4.sdc[cacheKey] = data;
+                _this5.sdc[cacheKey] = data;
                 return data;
               });
             }
@@ -3300,11 +3355,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               try {
                 _singletonRouter[eventField].apply(_singletonRouter, arguments);
               } catch (err) {
-                // tslint:disable-next-line:no-console
                 console.error(
                   "Error when running the Router event: ".concat(eventField)
-                ); // tslint:disable-next-line:no-console
-
+                );
                 console.error("".concat(err.message, "\n").concat(err.stack));
               }
             }
@@ -3414,7 +3467,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             };
       }
 
-      var RouterContext = _react["default"].createContext(null);
+      var RouterContext = /*#__PURE__*/ _react["default"].createContext(null);
 
       exports.RouterContext = RouterContext;
 
@@ -3465,6 +3518,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       /***/
     },
 
+    /***/ wkBG: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+      exports.__esModule = true;
+      exports.normalizePathSep = normalizePathSep;
+      exports.denormalizePagePath = denormalizePagePath;
+      function normalizePathSep(path) {
+        return path.replace(/\\/g, "/");
+      }
+      function denormalizePagePath(page) {
+        page = normalizePathSep(page);
+        if (page.startsWith("/index/")) {
+          page = page.slice(6);
+        } else if (page === "/index") {
+          page = "/";
+        }
+        return page;
+      }
+      //# sourceMappingURL=denormalize-page-path.js.map
+
+      /***/
+    },
+
     /***/ wkBT: /***/ function(module, exports) {
       function _nonIterableRest() {
         throw new TypeError(
Diff for 677f882d2ed8..a6.module.js
@@ -329,6 +329,13 @@
       /***/
     },
 
+    /***/ S3md: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+
+      /***/
+
+    },
+
     /***/ TqRt: /***/ function(module, exports) {
       function _interopRequireDefault(obj) {
         return obj && obj.__esModule
@@ -501,7 +508,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           off(type, handler) {
             if (all[type]) {
-              // tslint:disable-next-line:no-bitwise
               all[type].splice(all[type].indexOf(handler) >>> 0, 1);
             }
           },
@@ -540,21 +546,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
+      var _normalizeTrailingSlash = __webpack_require__("X24+");
+
+      var _denormalizePagePath = __webpack_require__("wkBG");
+
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
       var _utils = __webpack_require__("g/15");
 
       var _isDynamic = __webpack_require__("/jkW");
 
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
+      var _parseRelativeUrl = __webpack_require__("hS4m");
 
       var _querystring = __webpack_require__("3WeD");
 
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _resolveRewrites = _interopRequireDefault(
+        __webpack_require__("S3md")
+      );
 
-      var _normalizeTrailingSlash = __webpack_require__("X24+");
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function _interopRequireDefault(obj) {
         return obj && obj.__esModule
@@ -651,17 +663,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         };
       }
 
-      function tryParseRelativeUrl(url) {
-        try {
-          return (0, _parseRelativeUrl.parseRelativeUrl)(url);
-        } catch (err) {
-          if (false) {
-          }
-
-          return null;
-        }
-      }
-
       var manualScrollRestoration = false && false;
 
       function fetchRetry(url, attempts) {
@@ -716,6 +717,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             App,
             wrapApp,
             Component,
+            initialStyleSheets,
             err,
             subscription,
             isFallback
@@ -736,6 +738,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           this.isSsr = void 0;
           this.isFallback = void 0;
           this._inFlightRoute = void 0;
+          this._shallow = void 0;
 
           this.onPopState = e => {
             var state = e.state;
@@ -783,7 +786,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               return;
             }
 
-            this.change("replaceState", url, as, options);
+            this.change(
+              "replaceState",
+              url,
+              as,
+              Object.assign({}, options, {
+                shallow: options.shallow && this._shallow
+              })
+            );
           }; // represents the current component key
 
           this.route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(
@@ -797,6 +807,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           if (_pathname !== "/_error") {
             this.components[this.route] = {
               Component,
+              styleSheets: initialStyleSheets,
               props: initialProps,
               err,
               __N_SSG: initialProps && initialProps.__N_SSG,
@@ -805,7 +816,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           }
 
           this.components["/_app"] = {
-            Component: App
+            Component: App,
+            styleSheets: [
+              /* /_app does not need its stylesheets managed */
+            ]
           }; // Backwards compat for Router.router.events
           // TODO: Should be remove the following major version as it was never documented
 
@@ -854,31 +868,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           }
         }
 
-        update(route, mod) {
-          var Component = mod.default || mod;
-          var data = this.components[route];
-
-          if (!data) {
-            throw new Error("Cannot update unavailable route: ".concat(route));
-          }
-
-          var newData = Object.assign({}, data, {
-            Component,
-            __N_SSG: mod.__N_SSG,
-            __N_SSP: mod.__N_SSP
-          });
-          this.components[route] = newData; // pages/_app.js updated
-
-          if (route === "/_app") {
-            this.notify(this.components[this.route]);
-            return;
-          }
-
-          if (route === this.route) {
-            this.notify(newData);
-          }
-        }
-
         reload() {
           window.location.reload();
         }
@@ -955,17 +944,29 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
           if (!options._h && this.onlyAHashChange(cleanedAs)) {
             this.asPath = cleanedAs;
-            Router.events.emit("hashChangeStart", as);
+            Router.events.emit("hashChangeStart", as); // TODO: do we need the resolved href when only a hash change?
+
             this.changeState(method, url, as, options);
             this.scrollToHash(cleanedAs);
             this.notify(this.components[this.route]);
             Router.events.emit("hashChangeComplete", as);
             return true;
+          } // The build manifest needs to be loaded before auto-static dynamic pages
+          // get their query parameters to allow ensuring they can be parsed properly
+          // when rewritten to
+
+          var pages = await this.pageLoader.getPageList();
+          var { __rewrites: rewrites } = await this.pageLoader
+            .promisedBuildManifest;
+          var parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);
+          var { pathname, searchParams } = parsed;
+          parsed = this._resolveHref(parsed, pages);
+
+          if (parsed.pathname !== pathname) {
+            pathname = parsed.pathname;
+            url = (0, _utils.formatWithValidation)(parsed);
           }
 
-          var parsed = tryParseRelativeUrl(url);
-          if (!parsed) return false;
-          var { pathname, searchParams } = parsed;
           var query = (0, _querystring.searchParamsToUrlQuery)(searchParams); // url and as should always be prefixed with basePath by this
           // point by either next/link or router.push/replace so strip the
           // basePath from the pathname to match the pages dir 1-to-1
@@ -987,11 +988,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           var route = (0, _normalizeTrailingSlash.removePathTrailingSlash)(
             pathname
           );
-          var { shallow = false } = options;
+          var { shallow = false } = options; // we need to resolve the as value using rewrites for dynamic SSG
+          // pages to allow building the data URL correctly
+
+          var resolvedAs = as;
+
+          if (false) {
+          }
+
+          resolvedAs = delBasePath(resolvedAs);
 
           if ((0, _isDynamic.isDynamicRoute)(route)) {
             var { pathname: asPathname } = (0,
-            _parseRelativeUrl.parseRelativeUrl)(cleanedAs);
+            _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
             var routeRegex = (0, _routeRegex.getRouteRegex)(route);
             var routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(
               asPathname
@@ -1040,7 +1049,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               var appComp;
             }
 
-            await this.set(route, pathname, query, cleanedAs, routeInfo);
+            await this.set(route, pathname, query, cleanedAs, routeInfo).catch(
+              e => {
+                if (e.cancelled) error = error || e;
+                else throw e;
+              }
+            );
 
             if (error) {
               Router.events.emit("routeChangeError", error, cleanedAs);
@@ -1071,6 +1085,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           }
 
           if (method !== "pushState" || (0, _utils.getURL)() !== as) {
+            this._shallow = options.shallow;
             window.history[method](
               {
                 url,
@@ -1106,9 +1121,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           }
 
           try {
-            var { page: Component } = await this.fetchComponent("/_error");
+            var { page: Component, styleSheets } = await this.fetchComponent(
+              "/_error"
+            );
             var routeInfo = {
               Component,
+              styleSheets,
               err,
               error: err
             };
@@ -1153,6 +1171,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               ? cachedRouteInfo
               : await this.fetchComponent(route).then(res => ({
                   Component: res.page,
+                  styleSheets: res.styleSheets,
                   __N_SSG: res.mod.__N_SSG,
                   __N_SSP: res.mod.__N_SSP
                 }));
@@ -1170,7 +1189,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   pathname,
                   query
                 }),
-                as,
+                delBasePath(as),
                 __N_SSG
               );
             }
@@ -1259,6 +1278,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         urlIsNew(asPath) {
           return this.asPath !== asPath;
         }
+
+        _resolveHref(parsedHref, pages) {
+          var { pathname } = parsedHref;
+          var cleanPathname = (0, _denormalizePagePath.denormalizePagePath)(
+            delBasePath(pathname)
+          );
+
+          if (cleanPathname === "/404" || cleanPathname === "/_error") {
+            return parsedHref;
+          } // handle resolving href for dynamic routes
+
+          if (!pages.includes(cleanPathname)) {
+            // eslint-disable-next-line array-callback-return
+            pages.some(page => {
+              if (
+                (0, _isDynamic.isDynamicRoute)(page) &&
+                (0, _routeRegex.getRouteRegex)(page).re.test(cleanPathname)
+              ) {
+                parsedHref.pathname = addBasePath(page);
+                return true;
+              }
+            });
+          }
+
+          return parsedHref;
+        }
         /**
          * Prefetch page code, you may wait for the data during page rendering.
          * This feature only works in production!
@@ -1275,9 +1320,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             arguments.length > 2 && arguments[2] !== undefined
               ? arguments[2]
               : {};
-          var parsed = tryParseRelativeUrl(url);
-          if (!parsed) return;
-          var { pathname } = parsed; // Prefetch is not supported in development mode because it would trigger on-demand-entries
+          var parsed = (0, _parseRelativeUrl.parseRelativeUrl)(url);
+          var { pathname } = parsed;
+          var pages = await this.pageLoader.getPageList();
+          parsed = this._resolveHref(parsed, pages);
+
+          if (parsed.pathname !== pathname) {
+            pathname = parsed.pathname;
+            url = (0, _utils.formatWithValidation)(parsed);
+          } // Prefetch is not supported in development mode because it would trigger on-demand-entries
 
           if (false) {
           }
@@ -1718,11 +1769,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
               try {
                 _singletonRouter[eventField](...arguments);
               } catch (err) {
-                // tslint:disable-next-line:no-console
                 console.error(
                   "Error when running the Router event: ".concat(eventField)
-                ); // tslint:disable-next-line:no-console
-
+                );
                 console.error("".concat(err.message, "\n").concat(err.stack));
               }
             }
@@ -1813,13 +1862,35 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             };
       }
 
-      var RouterContext = _react.default.createContext(null);
+      var RouterContext = /*#__PURE__*/ _react.default.createContext(null);
 
       exports.RouterContext = RouterContext;
 
       if (false) {
       }
 
+      /***/
+    },
+
+    /***/ wkBG: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+      exports.__esModule = true;
+      exports.normalizePathSep = normalizePathSep;
+      exports.denormalizePagePath = denormalizePagePath;
+      function normalizePathSep(path) {
+        return path.replace(/\\/g, "/");
+      }
+      function denormalizePagePath(page) {
+        page = normalizePathSep(page);
+        if (page.startsWith("/index/")) {
+          page = page.slice(6);
+        } else if (page === "/index") {
+          page = "/";
+        }
+        return page;
+      }
+      //# sourceMappingURL=denormalize-page-path.js.map
+
       /***/
     }
   }
Diff for main-b2c679a..17.module.js
@@ -143,7 +143,7 @@
             };
       }
 
-      var HeadManagerContext = _react.default.createContext({});
+      var HeadManagerContext = /*#__PURE__*/ _react.default.createContext({});
 
       exports.HeadManagerContext = HeadManagerContext;
 
@@ -171,10 +171,6 @@
         __webpack_require__("284h")
       );
 
-      var _router = __webpack_require__("nOHt");
-
-      var querystring = _interopRequireWildcard3(__webpack_require__("3WeD"));
-
       var _react = _interopRequireDefault(__webpack_require__("q1tI"));
 
       var _reactDom = _interopRequireDefault(__webpack_require__("i8i4"));
@@ -185,26 +181,28 @@
 
       var _routerContext = __webpack_require__("qOIg");
 
+      var _router = __webpack_require__("elyg");
+
       var _isDynamic = __webpack_require__("/jkW");
 
+      var querystring = _interopRequireWildcard3(__webpack_require__("3WeD"));
+
       var envConfig = _interopRequireWildcard3(__webpack_require__("yLiY"));
 
       var _utils = __webpack_require__("g/15");
 
-      var _router2 = __webpack_require__("elyg");
-
       var _headManager = _interopRequireDefault(__webpack_require__("DqTX"));
 
-      var _pageLoader = _interopRequireDefault(__webpack_require__("zmvN"));
+      var _pageLoader = _interopRequireWildcard3(__webpack_require__("zmvN"));
 
       var _performanceRelayer = _interopRequireDefault(
         __webpack_require__("bGXG")
       );
+
+      var _router2 = __webpack_require__("nOHt");
       /* global location */
-      /// <reference types="react-dom/experimental" />
 
       if (!("finally" in Promise.prototype)) {
-        // eslint-disable-next-line no-extend-native
         Promise.prototype.finally = __webpack_require__("Z577");
       }
 
@@ -212,7 +210,7 @@
         document.getElementById("__NEXT_DATA__").textContent
       );
       window.__NEXT_DATA__ = data;
-      var version = "9.5.2";
+      var version = "9.5.3";
       exports.version = version;
       var {
         props: hydrateProps,
@@ -237,8 +235,8 @@
       });
       var asPath = (0, _utils.getURL)(); // make sure not to attempt stripping basePath for 404s
 
-      if ((0, _router2.hasBasePath)(asPath)) {
-        asPath = (0, _router2.delBasePath)(asPath);
+      if ((0, _router.hasBasePath)(asPath)) {
+        asPath = (0, _router.delBasePath)(asPath);
       }
 
       var pageLoader = new _pageLoader.default(buildId, prefix, page);
@@ -264,6 +262,7 @@
       var router;
       exports.router = router;
       var CachedComponent;
+      var cachedStyleSheets;
       var CachedApp, onPerfEntry;
 
       class Container extends _react.default.Component {
@@ -297,6 +296,7 @@
                 ),
               asPath,
               {
+                // @ts-ignore
                 // WARNING: `_h` is an internal option for handing Next.js
                 // client-side hydration. Your app should _never_ use this property.
                 // It may change at any time without notice.
@@ -309,14 +309,6 @@
               }
             );
           }
-
-          if (undefined) {
-            window.__NEXT_HYDRATED = true;
-
-            if (window.__NEXT_HYDRATED_CB) {
-              window.__NEXT_HYDRATED_CB();
-            }
-          }
         }
 
         componentDidUpdate() {
@@ -337,9 +329,7 @@
         render() {
           if (true) {
             return this.props.children;
-          }
-
-          if (false) {
+          } else {
             var ReactDevOverlay;
           }
         }
@@ -349,7 +339,7 @@
       exports.emitter = emitter;
 
       var _default = async function _default() {
-        var { webpackHMR: passedWebpackHMR } =
+        var opts =
           arguments.length > 0 && arguments[0] !== undefined
             ? arguments[0]
             : {};
@@ -398,7 +388,10 @@
         var initialErr = hydrateErr;
 
         try {
-          ({ page: CachedComponent } = await pageLoader.loadPage(page));
+          ({
+            page: CachedComponent,
+            styleSheets: cachedStyleSheets
+          } = await pageLoader.loadPage(page));
 
           if (false) {
             var isValidElementType;
@@ -416,7 +409,7 @@
           await window.__NEXT_PRELOADREADY(dynamicIds);
         }
 
-        exports.router = router = (0, _router.createRouter)(
+        exports.router = router = (0, _router2.createRouter)(
           page,
           query,
           asPath,
@@ -425,14 +418,16 @@
             pageLoader,
             App: CachedApp,
             Component: CachedComponent,
+            initialStyleSheets: cachedStyleSheets,
             wrapApp,
             err: initialErr,
-            isFallback,
+            isFallback: Boolean(isFallback),
             subscription: (_ref3, App) => {
-              var { Component, props, err } = _ref3;
+              var { Component, styleSheets, props, err } = _ref3;
               return render({
                 App,
                 Component,
+                styleSheets,
                 props,
                 err
               });
@@ -446,6 +441,7 @@
         var renderCtx = {
           App: CachedApp,
           Component: CachedComponent,
+          styleSheets: cachedStyleSheets,
           props: hydrateProps,
           err: initialErr
         };
@@ -453,9 +449,7 @@
         if (true) {
           render(renderCtx);
           return emitter;
-        }
-
-        if (false) {
+        } else {
         }
       };
 
@@ -470,17 +464,18 @@
         try {
           await doRender(renderingProps);
         } catch (renderErr) {
+          // bubble up cancelation errors
+          if (renderErr.cancelled) {
+            throw renderErr;
+          }
+
           if (false) {
           }
 
           await renderError(
-            (0, _extends2.default)(
-              (0, _extends2.default)({}, renderingProps),
-              {},
-              {
-                err: renderErr
-              }
-            )
+            (0, _extends2.default)({}, renderingProps, {
+              err: renderErr
+            })
           );
         }
       } // This method handles all runtime and debug errors.
@@ -499,7 +494,7 @@
 
         console.error(err);
         return pageLoader.loadPage("/_error").then(_ref4 => {
-          var { page: ErrorComponent } = _ref4;
+          var { page: ErrorComponent, styleSheets } = _ref4;
           // In production we do a normal render with the `ErrorComponent` as component.
           // If we've gotten here upon initial render, we can use the props from the server.
           // Otherwise, we need to call `getInitialProps` on `App` before mounting.
@@ -522,15 +517,12 @@
               : (0, _utils.loadGetInitialProps)(App, appCtx)
           ).then(initProps =>
             doRender(
-              (0, _extends2.default)(
-                (0, _extends2.default)({}, renderErrorProps),
-                {},
-                {
-                  err,
-                  Component: ErrorComponent,
-                  props: initProps
-                }
-              )
+              (0, _extends2.default)({}, renderErrorProps, {
+                err,
+                Component: ErrorComponent,
+                styleSheets,
+                props: initProps
+              })
             )
           );
         });
@@ -642,7 +634,7 @@
           /*#__PURE__*/ _react.default.createElement(
             _routerContext.RouterContext.Provider,
             {
-              value: (0, _router.makePublicRouterInstance)(router)
+              value: (0, _router2.makePublicRouterInstance)(router)
             },
             /*#__PURE__*/ _react.default.createElement(
               _headManagerContext.HeadManagerContext.Provider,
@@ -656,15 +648,11 @@
       }
 
       var wrapApp = App => wrappedAppProps => {
-        var appProps = (0, _extends2.default)(
-          (0, _extends2.default)({}, wrappedAppProps),
-          {},
-          {
-            Component: CachedComponent,
-            err: hydrateErr,
-            router
-          }
-        );
+        var appProps = (0, _extends2.default)({}, wrappedAppProps, {
+          Component: CachedComponent,
+          err: hydrateErr,
+          router
+        });
         return /*#__PURE__*/ _react.default.createElement(
           AppContainer,
           null,
@@ -672,21 +660,18 @@
         );
       };
 
-      async function doRender(_ref6) {
-        var { App, Component, props, err } = _ref6;
+      function doRender(_ref6) {
+        var { App, Component, props, err, styleSheets } = _ref6;
         Component = Component || lastAppProps.Component;
         props = props || lastAppProps.props;
-        var appProps = (0, _extends2.default)(
-          (0, _extends2.default)({}, props),
-          {},
-          {
-            Component,
-            err,
-            router
-          }
-        ); // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.
+        var appProps = (0, _extends2.default)({}, props, {
+          Component,
+          err,
+          router
+        }); // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error.
 
         lastAppProps = appProps;
+        var canceled = false;
         var resolvePromise;
         var renderPromise = new Promise((resolve, reject) => {
           if (lastRenderReject) {
@@ -699,34 +684,145 @@
           };
 
           lastRenderReject = () => {
+            canceled = true;
             lastRenderReject = null;
-            reject();
+            var error = new Error("Cancel rendering route");
+            error.cancelled = true;
+            reject(error);
           };
-        });
+        }); // This function has a return type to ensure it doesn't start returning a
+        // Promise. It should remain synchronous.
+
+        function onStart() {
+          if (
+            // We can skip this during hydration. Running it wont cause any harm, but
+            // we may as well save the CPU cycles.
+            isInitialRender || // We use `style-loader` in development, so we don't need to do anything
+            // unless we're in production:
+            false
+          ) {
+            return false;
+          }
+
+          var currentStyleTags = (0, _pageLoader.looseToArray)(
+            document.querySelectorAll("style[data-n-href]")
+          );
+          var currentHrefs = new Set(
+            currentStyleTags.map(tag => tag.getAttribute("data-n-href"))
+          );
+          styleSheets.forEach(_ref7 => {
+            var { href, text } = _ref7;
+
+            if (!currentHrefs.has(href)) {
+              var styleTag = document.createElement("style");
+              styleTag.setAttribute("data-n-href", href);
+              styleTag.setAttribute("media", "x");
+              document.head.appendChild(styleTag);
+              styleTag.appendChild(document.createTextNode(text));
+            }
+          });
+          return true;
+        }
+
+        function onCommit() {
+          if (
+            // We use `style-loader` in development, so we don't need to do anything
+            // unless we're in production:
+            true && // We can skip this during hydration. Running it wont cause any harm, but
+            // we may as well save the CPU cycles:
+            !isInitialRender && // Ensure this render was not canceled
+            !canceled
+          ) {
+            var desiredHrefs = new Set(styleSheets.map(s => s.href));
+            var currentStyleTags = (0, _pageLoader.looseToArray)(
+              document.querySelectorAll("style[data-n-href]")
+            );
+            var currentHrefs = currentStyleTags.map(tag =>
+              tag.getAttribute("data-n-href")
+            ); // Toggle `<style>` tags on or off depending on if they're needed:
+
+            for (var idx = 0; idx < currentHrefs.length; ++idx) {
+              if (desiredHrefs.has(currentHrefs[idx])) {
+                currentStyleTags[idx].removeAttribute("media");
+              } else {
+                currentStyleTags[idx].setAttribute("media", "x");
+              }
+            } // Reorder styles into intended order:
+
+            var referenceNode = document.querySelector("noscript[data-n-css]");
+
+            if (
+              // This should be an invariant:
+              referenceNode
+            ) {
+              styleSheets.forEach(_ref8 => {
+                var { href } = _ref8;
+                var targetTag = document.querySelector(
+                  'style[data-n-href="'.concat(href, '"]')
+                );
+
+                if (
+                  // This should be an invariant:
+                  targetTag
+                ) {
+                  referenceNode.parentNode.insertBefore(
+                    targetTag,
+                    referenceNode.nextSibling
+                  );
+                  referenceNode = targetTag;
+                }
+              });
+            } // Finally, clean up server rendered stylesheets:
+
+            (0, _pageLoader.looseToArray)(
+              document.querySelectorAll("link[data-n-p]")
+            ).forEach(el => {
+              el.parentNode.removeChild(el);
+            }); // Force browser to recompute layout, which should prevent a flash of
+            // unstyled content:
+
+            getComputedStyle(document.body, "height");
+          }
+
+          resolvePromise();
+        }
 
         var elem = /*#__PURE__*/ _react.default.createElement(
           Root,
           {
-            callback: resolvePromise
+            callback: onCommit
           },
           /*#__PURE__*/ _react.default.createElement(
             AppContainer,
             null,
             /*#__PURE__*/ _react.default.createElement(App, appProps)
           )
-        ); // We catch runtime errors using componentDidCatch which will trigger renderError
+        );
+
+        onStart(); // We catch runtime errors using componentDidCatch which will trigger renderError
 
         renderReactElement(false ? /*#__PURE__*/ undefined : elem, appElement);
-        await renderPromise;
+        return renderPromise;
       }
 
-      function Root(_ref7) {
-        var { callback, children } = _ref7;
+      function Root(_ref9) {
+        var { callback, children } = _ref9;
 
         // We use `useLayoutEffect` to guarantee the callback is executed
         // as soon as React flushes the update.
         _react.default.useLayoutEffect(() => callback(), [callback]);
 
+        if (undefined) {
+          // eslint-disable-next-line react-hooks/rules-of-hooks
+          _react.default.useEffect(() => {
+            window.__NEXT_HYDRATED = true;
+
+            if (window.__NEXT_HYDRATED_CB) {
+              window.__NEXT_HYDRATED_CB();
+            }
+          }, []);
+        }
+
         return children;
       }
 
@@ -1112,7 +1208,7 @@
       var _interopRequireDefault = __webpack_require__("TqRt");
 
       exports.__esModule = true;
-      exports.default = void 0;
+      exports.default = exports.looseToArray = void 0;
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
@@ -1136,6 +1232,26 @@
 
       var _routeRegex = __webpack_require__("YTqd");
 
+      var looseToArray = input => [].slice.call(input);
+
+      exports.looseToArray = looseToArray;
+
+      function getInitialStylesheets() {
+        return looseToArray(document.styleSheets)
+          .filter(
+            el =>
+              el.ownerNode &&
+              el.ownerNode.tagName === "LINK" &&
+              el.ownerNode.hasAttribute("data-n-p")
+          )
+          .map(sheet => ({
+            href: sheet.ownerNode.getAttribute("href"),
+            text: looseToArray(sheet.cssRules)
+              .map(r => r.cssText)
+              .join("")
+          }));
+      }
+
       function hasRel(rel, link) {
         try {
           link = document.createElement("link");
@@ -1155,15 +1271,10 @@
             "preload" // https://caniuse.com/#feat=link-rel-prefetch
           : // IE 11, Edge 12+, nearly all evergreen
             "prefetch";
+      var relPreload = hasRel("preload") ? "preload" : relPrefetch;
+      var relPreloadStyle = "fetch";
       var hasNoModule = "noModule" in document.createElement("script");
 
-      var requestIdleCallback =
-        window.requestIdleCallback ||
-        function(cb) {
-          return setTimeout(cb, 1);
-        };
-      /** @param {string} route */
-
       function normalizeRoute(route) {
         if (route[0] !== "/") {
           throw new Error(
@@ -1175,21 +1286,51 @@
         return route.replace(/\/$/, "");
       }
 
-      function appendLink(href, rel, as) {
-        return new Promise((res, rej, link) => {
-          link = document.createElement("link");
-          link.crossOrigin = "anonymous";
-          link.href = href;
-          link.rel = rel;
+      function appendLink(href, rel, as, link) {
+        return new Promise((res, rej) => {
+          link = document.createElement("link"); // The order of property assignment here is intentional:
+
           if (as) link.as = as;
+          link.rel = rel;
+          link.crossOrigin = "anonymous";
           link.onload = res;
-          link.onerror = rej;
+          link.onerror = rej; // `href` should always be last:
+
+          link.href = href;
           document.head.appendChild(link);
         });
       }
 
+      function loadScript(url) {
+        return new Promise((res, rej) => {
+          var script = document.createElement("script");
+
+          if (true && hasNoModule) {
+            script.type = "module";
+          }
+
+          script.crossOrigin = "anonymous";
+          script.src = url;
+          script.onload = res;
+
+          script.onerror = () => rej(pageLoadError(url));
+
+          document.body.appendChild(script);
+        });
+      }
+
       class PageLoader {
         constructor(buildId, assetPrefix, initialPage) {
+          this.initialPage = void 0;
+          this.buildId = void 0;
+          this.assetPrefix = void 0;
+          this.pageCache = void 0;
+          this.pageRegisterEvents = void 0;
+          this.loadingRoutes = void 0;
+          this.promisedBuildManifest = void 0;
+          this.promisedSsgManifest = void 0;
+          this.promisedDevPagesManifest = void 0;
+          this.initialPage = initialPage;
           this.buildId = buildId;
           this.assetPrefix = assetPrefix;
           this.pageCache = {};
@@ -1203,17 +1344,15 @@
             this.loadingRoutes[initialPage] = true;
           }
 
-          if (true) {
-            this.promisedBuildManifest = new Promise(resolve => {
-              if (window.__BUILD_MANIFEST) {
+          this.promisedBuildManifest = new Promise(resolve => {
+            if (window.__BUILD_MANIFEST) {
+              resolve(window.__BUILD_MANIFEST);
+            } else {
+              window.__BUILD_MANIFEST_CB = () => {
                 resolve(window.__BUILD_MANIFEST);
-              } else {
-                window.__BUILD_MANIFEST_CB = () => {
-                  resolve(window.__BUILD_MANIFEST);
-                };
-              }
-            });
-          }
+              };
+            }
+          });
           /** @type {Promise<Set<string>>} */
 
           this.promisedSsgManifest = new Promise(resolve => {
@@ -1225,21 +1364,24 @@
               };
             }
           });
+        }
+
+        getPageList() {
+          if (true) {
+            return this.promisedBuildManifest.then(
+              buildManifest => buildManifest.sortedPages
+            );
+          } else {
+          }
         } // Returns a promise for the dependencies for a particular route
 
         getDependencies(route) {
           return this.promisedBuildManifest.then(m => {
-            var _this$pageRegisterEve;
-
             return m[route]
               ? m[route].map(url =>
                   "".concat(this.assetPrefix, "/_next/").concat(encodeURI(url))
                 )
-              : (_this$pageRegisterEve = this.pageRegisterEvents.emit(route, {
-                  error: pageLoadError(route)
-                })) != null
-              ? _this$pageRegisterEve
-              : [];
+              : Promise.reject(pageLoadError(route));
           });
         }
         /**
@@ -1255,20 +1397,15 @@
           _parseRelativeUrl.parseRelativeUrl)(asPath);
           var route = normalizeRoute(hrefPathname);
 
-          var getHrefForSlug =
-            /** @type string */
-            path => {
-              var dataRoute = (0, _getAssetPathFromRoute.default)(
-                path,
-                ".json"
-              );
-              return (0, _router.addBasePath)(
-                "/_next/data/"
-                  .concat(this.buildId)
-                  .concat(dataRoute)
-                  .concat(ssg ? "" : search)
-              );
-            };
+          var getHrefForSlug = path => {
+            var dataRoute = (0, _getAssetPathFromRoute.default)(path, ".json");
+            return (0, _router.addBasePath)(
+              "/_next/data/"
+                .concat(this.buildId)
+                .concat(dataRoute)
+                .concat(ssg ? "" : search)
+            );
+          };
 
           var isDynamic = (0, _isDynamic.isDynamicRoute)(route),
             interpolatedRoute;
@@ -1330,9 +1467,11 @@
           var { pathname: hrefPathname } = (0,
           _parseRelativeUrl.parseRelativeUrl)(href);
           var route = normalizeRoute(hrefPathname);
-          return this.promisedSsgManifest.then((s, _dataHref) => {
-            requestIdleCallback(() => {
-              // Check if the route requires a data file
+          return this.promisedSsgManifest.then(
+            (
+              s,
+              _dataHref // Check if the route requires a data file
+            ) =>
               s.has(route) && // Try to generate data href, noop when falsy
               (_dataHref = this.getDataHref(href, asPath, true)) && // noop when data has already been prefetched (dedupe)
               !document.querySelector(
@@ -1340,9 +1479,10 @@
                   .concat(relPrefetch, '"][href^="')
                   .concat(_dataHref, '"]')
               ) && // Inject the `<link rel=prefetch>` tag for above computed `href`.
-                appendLink(_dataHref, relPrefetch, "fetch");
-            });
-          });
+              appendLink(_dataHref, relPrefetch, "fetch").catch(() => {
+                /* ignore prefetch error */
+              })
+          );
         }
 
         loadPage(route) {
@@ -1352,28 +1492,23 @@
             var cachedPage = this.pageCache[route];
 
             if (cachedPage) {
-              var { error, page, mod } = cachedPage;
-              error
-                ? reject(error)
-                : resolve({
-                    page,
-                    mod
-                  });
+              if ("error" in cachedPage) {
+                reject(cachedPage.error);
+              } else {
+                resolve(cachedPage);
+              }
+
               return;
             }
 
-            var fire = _ref => {
-              var { error, page, mod } = _ref;
+            var fire = pageToCache => {
               this.pageRegisterEvents.off(route, fire);
               delete this.loadingRoutes[route];
 
-              if (error) {
-                reject(error);
+              if ("error" in pageToCache) {
+                reject(pageToCache.error);
               } else {
-                resolve({
-                  page,
-                  mod
-                });
+                resolve(pageToCache);
               }
             }; // Register a listener to get the page
 
@@ -1383,61 +1518,65 @@
               this.loadingRoutes[route] = true;
 
               if (true) {
-                this.getDependencies(route).then(deps => {
-                  deps.forEach(d => {
-                    if (
-                      d.endsWith(".js") &&
-                      !document.querySelector('script[src^="'.concat(d, '"]'))
-                    ) {
-                      this.loadScript(d, route);
-                    }
-
-                    if (
-                      d.endsWith(".css") &&
-                      !document.querySelector(
-                        'link[rel=stylesheet][href^="'.concat(d, '"]')
-                      )
-                    ) {
-                      appendLink(d, "stylesheet").catch(() => {
-                        // FIXME: handle failure
-                        // Right now, this is needed to prevent an unhandled rejection.
-                      });
-                    }
+                this.getDependencies(route)
+                  .then(deps => {
+                    var pending = [];
+                    deps.forEach(d => {
+                      if (
+                        d.endsWith(".js") &&
+                        !document.querySelector('script[src^="'.concat(d, '"]'))
+                      ) {
+                        pending.push(loadScript(d));
+                      } // Prefetch CSS as it'll be needed when the page JavaScript
+                      // evaluates. This will only trigger if explicit prefetching is
+                      // disabled for a <Link>... prefetching in this case is desirable
+                      // because we *know* it's going to be used very soon (page was
+                      // loaded).
+
+                      if (
+                        d.endsWith(".css") &&
+                        !document.querySelector(
+                          'link[rel="'
+                            .concat(relPreload, '"][href^="')
+                            .concat(d, '"]')
+                        )
+                      ) {
+                        // This is not pushed into `pending` because we don't need to
+                        // wait for these to resolve. To prevent an unhandled
+                        // rejection, we swallow the error which is handled later in
+                        // the rendering cycle (this is just a preload optimization).
+                        appendLink(d, relPreload, relPreloadStyle).catch(() => {
+                          /* ignore preload error */
+                        });
+                      }
+                    });
+                    return Promise.all(pending);
+                  })
+                  .catch(err => {
+                    // Mark the page as failed to load if any of its required scripts
+                    // fail to load:
+                    this.pageCache[route] = {
+                      error: err
+                    };
+                    fire({
+                      error: err
+                    });
                   });
-                });
               } else {
                 var url, scriptRoute;
               }
             }
           });
-        }
-
-        loadScript(url, route) {
-          var script = document.createElement("script");
-
-          if (true && hasNoModule) {
-            script.type = "module";
-          }
-
-          script.crossOrigin = "anonymous";
-          script.src = url;
-
-          script.onerror = () => {
-            this.pageRegisterEvents.emit(route, {
-              error: pageLoadError(url)
-            });
-          };
-
-          document.body.appendChild(script);
         } // This method if called by the route code.
 
         registerPage(route, regFn) {
-          var register = () => {
+          var register = styleSheets => {
             try {
               var mod = regFn();
               var pageData = {
                 page: mod.default || mod,
-                mod
+                mod,
+                styleSheets
               };
               this.pageCache[route] = pageData;
               this.pageRegisterEvents.emit(route, pageData);
@@ -1455,7 +1594,52 @@
             var check;
           }
 
-          register();
+          function fetchStyleSheet(href) {
+            return fetch(href).then(res => {
+              if (!res.ok) throw pageLoadError(href);
+              return res.text().then(text => ({
+                href,
+                text
+              }));
+            });
+          }
+
+          var isInitialLoad = route === this.initialPage;
+          var promisedDeps = // Shared styles will already be on the page:
+            route === "/_app" || false // We use `style-loader` in development:
+              ? Promise.resolve([]) // Tests that this does not block hydration:
+              : // test/integration/css-fixtures/hydrate-without-deps/
+                (isInitialLoad
+                  ? Promise.resolve(
+                      looseToArray(
+                        document.querySelectorAll("link[data-n-p]")
+                      ).map(e => e.getAttribute("href"))
+                    )
+                  : this.getDependencies(route).then(deps =>
+                      deps.filter(d => d.endsWith(".css"))
+                    )
+                ).then((
+                  cssFiles // These files should've already been fetched by now, so this
+                ) =>
+                  // should resolve instantly.
+                  Promise.all(cssFiles.map(d => fetchStyleSheet(d))).catch(
+                    err => {
+                      if (isInitialLoad) return getInitialStylesheets();
+                      throw err;
+                    }
+                  )
+                );
+          promisedDeps.then(
+            deps => register(deps),
+            error => {
+              this.pageCache[route] = {
+                error
+              };
+              this.pageRegisterEvents.emit(route, {
+                error
+              });
+            }
+          );
         }
         /**
          * @param {string} route
@@ -1494,7 +1678,7 @@
                     appendLink(
                       url,
                       relPrefetch,
-                      url.endsWith(".css") ? "style" : "script"
+                      url.endsWith(".css") ? relPreloadStyle : "script"
                     ),
                   true &&
                     !isDependency &&
Diff for main-d3421a9..998ca3c86.js

Diff too large to display

Diff for index.html
@@ -4,9 +4,10 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width" />
     <meta name="next-head-count" content="2" />
+    <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      href="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-d3421a9581b998ca3c86.js"
+      src="/_next/static/chunks/main-58fe85dd211fac23ae4b.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      src="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.abb28f9c6d97000fca82.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -4,9 +4,10 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width" />
     <meta name="next-head-count" content="2" />
+    <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      href="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -36,7 +37,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/pages/link-6fa73e7e8736497268e2.module.js"
+      href="/_next/static/chunks/pages/link-e2f1e0e7ed02569239da.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -86,13 +87,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-d3421a9581b998ca3c86.js"
+      src="/_next/static/chunks/main-58fe85dd211fac23ae4b.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      src="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -122,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.abb28f9c6d97000fca82.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -146,13 +147,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-3e536e855e7143324b04.js"
+      src="/_next/static/chunks/pages/link-46fd48c0b73b2f2d75a4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-6fa73e7e8736497268e2.module.js"
+      src="/_next/static/chunks/pages/link-e2f1e0e7ed02569239da.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -4,9 +4,10 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width" />
     <meta name="next-head-count" content="2" />
+    <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      href="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-d3421a9581b998ca3c86.js"
+      src="/_next/static/chunks/main-58fe85dd211fac23ae4b.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-b2c679a983254aeb7617.module.js"
+      src="/_next/static/chunks/main-0d318286e5f7c6910b94.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.abb28f9c6d97000fca82.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f48d291f6d1033f6c087.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
buildDuration 14.2s 14s -206ms
nodeModulesSize 56.7 MB 55.9 MB -779 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
677f882d2ed8..6aa6.js gzip 10 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39 kB -180 B
main-9a7a5f4..661e.js gzip 6.71 kB N/A N/A
webpack-ccf5..276a.js gzip 751 B N/A N/A
677f882d2ed8..9ff9.js gzip N/A 10.3 kB N/A
main-b338f5a..3500.js gzip N/A 7.31 kB N/A
webpack-e067..f178.js gzip N/A 751 B N/A
Overall change 56.6 kB 57.3 kB ⚠️ +672 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
677f882d2ed8..dule.js gzip 5.92 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39 kB -180 B
main-d0ac695..dule.js gzip 5.79 kB N/A N/A
webpack-10c7..dule.js gzip 751 B N/A N/A
677f882d2ed8..dule.js gzip N/A 6.13 kB N/A
main-830c506..dule.js gzip N/A 6.37 kB N/A
webpack-07c5..dule.js gzip N/A 751 B N/A
Overall change 51.6 kB 52.2 kB ⚠️ +610 B
Legacy Client Bundles (polyfills) Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
polyfills-75..1629.js gzip 31 kB N/A N/A
polyfills-4b..e242.js gzip N/A 31 kB N/A
Overall change 31 kB 31 kB -31 B
Client Pages Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_app-874bd8a..0103.js gzip 1.28 kB N/A N/A
_error-fa39c..ec40.js gzip 3.45 kB N/A N/A
hooks-585f07..95a3.js gzip 887 B N/A N/A
index-c7b63f..fc02.js gzip 227 B N/A N/A
link-4c2bd9b..eadd.js gzip 1.29 kB N/A N/A
routerDirect..ebc7.js gzip 284 B N/A N/A
withRouter-2..db68.js gzip 284 B N/A N/A
_app-9a0b9e1..b37e.js gzip N/A 1.28 kB N/A
_error-ed1b0..8fbd.js gzip N/A 3.44 kB N/A
hooks-89731c..c609.js gzip N/A 887 B N/A
index-17468f..5d83.js gzip N/A 227 B N/A
link-ae98065..267e.js gzip N/A 1.29 kB N/A
routerDirect..924c.js gzip N/A 284 B N/A
withRouter-7..c13d.js gzip N/A 284 B N/A
Overall change 7.71 kB 7.69 kB -23 B
Client Pages Modern Overall decrease ✓
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_app-97e743e..dule.js gzip 626 B N/A N/A
_error-b4004..dule.js gzip 2.3 kB N/A N/A
hooks-696209..dule.js gzip 387 B N/A N/A
index-a4dd74..dule.js gzip 226 B N/A N/A
link-236a801..dule.js gzip 1.26 kB N/A N/A
routerDirect..dule.js gzip 284 B N/A N/A
withRouter-1..dule.js gzip 282 B N/A N/A
_app-75d3a82..dule.js gzip N/A 625 B N/A
_error-4469a..dule.js gzip N/A 2.29 kB N/A
hooks-cbf13f..dule.js gzip N/A 387 B N/A
index-b9a643..dule.js gzip N/A 226 B N/A
link-cb244c4..dule.js gzip N/A 1.26 kB N/A
routerDirect..dule.js gzip N/A 284 B N/A
withRouter-f..dule.js gzip N/A 282 B N/A
Overall change 5.37 kB 5.35 kB -22 B
Client Build Manifests Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_buildManifest.js gzip 273 B 323 B ⚠️ +50 B
_buildManife..dule.js gzip 279 B 329 B ⚠️ +50 B
Overall change 552 B 652 B ⚠️ +100 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary v9.5.2 vercel/next.js refs/tags/v9.5.3 Change
_error.js 1.03 MB 1.03 MB ⚠️ +4.09 kB
404.html 4.18 kB 4.22 kB ⚠️ +39 B
hooks.html 3.82 kB 3.86 kB ⚠️ +39 B
index.js 1.03 MB 1.03 MB ⚠️ +4.09 kB
link.js 1.07 MB 1.07 MB ⚠️ +4.57 kB
routerDirect.js 1.06 MB 1.07 MB ⚠️ +4.61 kB
withRouter.js 1.06 MB 1.07 MB ⚠️ +4.61 kB
Overall change 5.26 MB 5.28 MB ⚠️ +22.1 kB

Please sign in to comment.