Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Include additional query values when interpolating href #16878

Merged
merged 5 commits into from
Sep 7, 2020

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Sep 5, 2020

This makes sure to include additional query values when interpolating a dynamic-route href instead of dropping them.

Fixes: #16851

@ijjk
Copy link
Member Author

ijjk commented Sep 5, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 11.7s 11.9s ⚠️ +184ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.14 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js update/href-interpolation Change
/ failed reqs 0 0
/ total time (seconds) 2.228 2.302 ⚠️ +0.07
/ avg req/sec 1122.05 1085.98 ⚠️ -36.07
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.37 1.334 -0.04
/error-in-render avg req/sec 1824.72 1874.46 +49.74
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..cf8c.js gzip 10.5 kB 10.8 kB ⚠️ +262 B
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB 7.08 kB ⚠️ +5 B
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.6 kB ⚠️ +267 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.4 kB 6.66 kB ⚠️ +259 B
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB 6.14 kB ⚠️ +5 B
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.5 kB ⚠️ +264 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js update/href-interpolation Change
index.html gzip 969 B 970 B ⚠️ +1 B
link.html gzip 977 B 976 B -1 B
withRouter.html gzip 963 B 963 B
Overall change 2.91 kB 2.91 kB

Diffs

Diff for 677f882d2ed8..45.module.js
@@ -319,6 +319,55 @@
       /***/
     },
 
+    /***/ "8OQS": /***/ function(module, exports) {
+      function _objectWithoutPropertiesLoose(source, excluded) {
+        if (source == null) return {};
+        var target = {};
+        var sourceKeys = Object.keys(source);
+        var key, i;
+
+        for (i = 0; i < sourceKeys.length; i++) {
+          key = sourceKeys[i];
+          if (excluded.indexOf(key) >= 0) continue;
+          target[key] = source[key];
+        }
+
+        return target;
+      }
+
+      module.exports = _objectWithoutPropertiesLoose;
+
+      /***/
+    },
+
+    /***/ QILm: /***/ function(module, exports, __webpack_require__) {
+      var objectWithoutPropertiesLoose = __webpack_require__("8OQS");
+
+      function _objectWithoutProperties(source, excluded) {
+        if (source == null) return {};
+        var target = objectWithoutPropertiesLoose(source, excluded);
+        var key, i;
+
+        if (Object.getOwnPropertySymbols) {
+          var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+          for (i = 0; i < sourceSymbolKeys.length; i++) {
+            key = sourceSymbolKeys[i];
+            if (excluded.indexOf(key) >= 0) continue;
+            if (!Object.prototype.propertyIsEnumerable.call(source, key))
+              continue;
+            target[key] = source[key];
+          }
+        }
+
+        return target;
+      }
+
+      module.exports = _objectWithoutProperties;
+
+      /***/
+    },
+
     /***/ Qetd: /***/ function(module, exports, __webpack_require__) {
       "use strict";
       var assign = Object.assign.bind(Object);
@@ -537,6 +586,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
     /***/ elyg: /***/ function(module, exports, __webpack_require__) {
       "use strict";
 
+      var _objectWithoutProperties = __webpack_require__("QILm");
+
       exports.__esModule = true;
       exports.hasBasePath = hasBasePath;
       exports.addBasePath = addBasePath;
@@ -637,9 +688,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(param => {
+          !params.every(param => {
             var value = dynamicMatches[param] || "";
             var { repeat, optional } = dynamicGroups[param]; // support single-level catch-all
             // TODO: more robust handling for user-error (passing `/`)
@@ -670,7 +722,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(key => {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -701,11 +766,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
+            var { result, params } = interpolateAs(
               finalUrl.pathname,
               finalUrl.pathname,
               query
             );
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1067,8 +1137,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           resolvedAs = delBasePath(resolvedAs);
 
           if ((0, _isDynamic.isDynamicRoute)(route)) {
-            var { pathname: asPathname } = (0,
-            _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var _ref2 = (0, _parseRelativeUrl.parseRelativeUrl)(resolvedAs),
+              { pathname: asPathname } = _ref2,
+              parsedAs = _objectWithoutProperties(_ref2, ["pathname"]);
+
             var routeRegex = (0, _routeRegex.getRouteRegex)(route);
             var routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(
               asPathname
@@ -1094,7 +1166,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 );
               }
             } else if (route === asPathname) {
-              as = interpolateAs(route, asPathname, query);
+              var { result, params } = interpolateAs(route, asPathname, query);
+              as = (0, _utils.formatWithValidation)(
+                Object.assign({}, parsedAs, {
+                  pathname: result,
+                  query: omitParmsFromQuery(query, params)
+                })
+              );
             } else {
               // Merge params into `query`, overwriting any specified in search
               Object.assign(query, routeMatch);
Diff for 677f882d2ed8..74ae628f6.js
@@ -330,6 +330,27 @@
       /***/
     },
 
+    /***/ "8OQS": /***/ function(module, exports) {
+      function _objectWithoutPropertiesLoose(source, excluded) {
+        if (source == null) return {};
+        var target = {};
+        var sourceKeys = Object.keys(source);
+        var key, i;
+
+        for (i = 0; i < sourceKeys.length; i++) {
+          key = sourceKeys[i];
+          if (excluded.indexOf(key) >= 0) continue;
+          target[key] = source[key];
+        }
+
+        return target;
+      }
+
+      module.exports = _objectWithoutPropertiesLoose;
+
+      /***/
+    },
+
     /***/ J4zp: /***/ function(module, exports, __webpack_require__) {
       var arrayWithHoles = __webpack_require__("wTVA");
 
@@ -353,6 +374,34 @@
       /***/
     },
 
+    /***/ QILm: /***/ function(module, exports, __webpack_require__) {
+      var objectWithoutPropertiesLoose = __webpack_require__("8OQS");
+
+      function _objectWithoutProperties(source, excluded) {
+        if (source == null) return {};
+        var target = objectWithoutPropertiesLoose(source, excluded);
+        var key, i;
+
+        if (Object.getOwnPropertySymbols) {
+          var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+
+          for (i = 0; i < sourceSymbolKeys.length; i++) {
+            key = sourceSymbolKeys[i];
+            if (excluded.indexOf(key) >= 0) continue;
+            if (!Object.prototype.propertyIsEnumerable.call(source, key))
+              continue;
+            target[key] = source[key];
+          }
+        }
+
+        return target;
+      }
+
+      module.exports = _objectWithoutProperties;
+
+      /***/
+    },
+
     /***/ Qetd: /***/ function(module, exports, __webpack_require__) {
       "use strict";
       var assign = Object.assign.bind(Object);
@@ -672,6 +721,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
       var _regeneratorRuntime = __webpack_require__("o0o1");
 
+      var _objectWithoutProperties = __webpack_require__("QILm");
+
       var _asyncToGenerator = __webpack_require__("yXPU");
 
       var _classCallCheck = __webpack_require__("lwsE");
@@ -778,9 +829,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(function(param) {
+          !params.every(function(param) {
             var value = dynamicMatches[param] || "";
             var _dynamicGroups$param = dynamicGroups[param],
               repeat = _dynamicGroups$param.repeat,
@@ -813,7 +865,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params: params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(function(key) {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -844,11 +909,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
-              finalUrl.pathname,
-              finalUrl.pathname,
-              query
-            );
+
+            var _interpolateAs = interpolateAs(
+                finalUrl.pathname,
+                finalUrl.pathname,
+                query
+              ),
+              result = _interpolateAs.result,
+              params = _interpolateAs.params;
+
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1183,9 +1257,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     resolvedAs,
                     _ref3,
                     asPathname,
+                    parsedAs,
                     routeRegex,
                     routeMatch,
                     missingParams,
+                    _interpolateAs2,
+                    result,
+                    params,
                     routeInfo,
                     error,
                     appComp;
@@ -1307,7 +1385,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             (_ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(
                               resolvedAs
                             )),
-                              (asPathname = _ref3.pathname);
+                              (asPathname = _ref3.pathname),
+                              (parsedAs = _objectWithoutProperties(_ref3, [
+                                "pathname"
+                              ]));
                             routeRegex = (0, _routeRegex.getRouteRegex)(route);
                             routeMatch = (0, _routeMatcher.getRouteMatcher)(
                               routeRegex
@@ -1348,7 +1429,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 
                           case 45:
                             if (route === asPathname) {
-                              as = interpolateAs(route, asPathname, query);
+                              (_interpolateAs2 = interpolateAs(
+                                route,
+                                asPathname,
+                                query
+                              )),
+                                (result = _interpolateAs2.result),
+                                (params = _interpolateAs2.params);
+                              as = (0, _utils.formatWithValidation)(
+                                Object.assign({}, parsedAs, {
+                                  pathname: result,
+                                  query: omitParmsFromQuery(query, params)
+                                })
+                              );
                             } else {
                               // Merge params into `query`, overwriting any specified in search
                               Object.assign(query, routeMatch);
Diff for main-cdbac89..a3.module.js
@@ -1385,7 +1385,7 @@
 
           var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
           var interpolatedRoute = isDynamic
-            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query).result
             : "";
           return isDynamic
             ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for main-ffe281b..a7333921f.js
@@ -1751,6 +1751,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
               var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
               var interpolatedRoute = isDynamic
                 ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+                    .result
                 : "";
               return isDynamic
                 ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f6dd2369fcb53d538257.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -87,13 +87,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f6dd2369fcb53d538257.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.f6dd2369fcb53d538257.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0b00d1d0e0c624dce779.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 13.3s 13.3s ⚠️ +31ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.14 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..cf8c.js gzip 10.5 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..95ff.js gzip N/A 10.8 kB N/A
main-aa5a068..ce3c.js gzip N/A 7.08 kB N/A
Overall change 57.3 kB 57.6 kB ⚠️ +267 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.4 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB N/A N/A
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.66 kB N/A
main-6f1730e..dule.js gzip N/A 6.14 kB N/A
Overall change 52.3 kB 52.5 kB ⚠️ +264 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.08 MB 1.08 MB ⚠️ +1.6 kB
routerDirect.js 1.07 MB 1.07 MB ⚠️ +1.6 kB
withRouter.js 1.07 MB 1.07 MB ⚠️ +1.6 kB
Overall change 5.29 MB 5.3 MB ⚠️ +4.79 kB
Commit: f656dd8

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Sep 5, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 13s 13.2s ⚠️ +227ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js update/href-interpolation Change
/ failed reqs 0 0
/ total time (seconds) 2.416 2.388 -0.03
/ avg req/sec 1034.72 1047.03 +12.31
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.56 1.451 -0.11
/error-in-render avg req/sec 1602.58 1722.86 +120.28
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..cf8c.js gzip 10.5 kB 10.6 kB ⚠️ +117 B
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB 7.08 kB ⚠️ +5 B
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.4 kB ⚠️ +122 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.4 kB 6.5 kB ⚠️ +104 B
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB 6.14 kB ⚠️ +5 B
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.4 kB ⚠️ +109 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js update/href-interpolation Change
index.html gzip 969 B 970 B ⚠️ +1 B
link.html gzip 977 B 977 B
withRouter.html gzip 963 B 962 B -1 B
Overall change 2.91 kB 2.91 kB

Diffs

Diff for 677f882d2ed8..45.module.js
@@ -637,9 +637,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(param => {
+          !params.every(param => {
             var value = dynamicMatches[param] || "";
             var { repeat, optional } = dynamicGroups[param]; // support single-level catch-all
             // TODO: more robust handling for user-error (passing `/`)
@@ -670,7 +671,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(key => {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -701,11 +715,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
+            var { result, params } = interpolateAs(
               finalUrl.pathname,
               finalUrl.pathname,
               query
             );
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1067,8 +1086,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           resolvedAs = delBasePath(resolvedAs);
 
           if ((0, _isDynamic.isDynamicRoute)(route)) {
-            var { pathname: asPathname } = (0,
-            _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var asPathname = parsedAs.pathname;
             var routeRegex = (0, _routeRegex.getRouteRegex)(route);
             var routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(
               asPathname
@@ -1094,7 +1113,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 );
               }
             } else if (route === asPathname) {
-              as = interpolateAs(route, asPathname, query);
+              var { result, params } = interpolateAs(route, asPathname, query);
+              as = (0, _utils.formatWithValidation)(
+                Object.assign({}, parsedAs, {
+                  pathname: result,
+                  query: omitParmsFromQuery(query, params)
+                })
+              );
             } else {
               // Merge params into `query`, overwriting any specified in search
               Object.assign(query, routeMatch);
Diff for 677f882d2ed8..74ae628f6.js
@@ -778,9 +778,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(function(param) {
+          !params.every(function(param) {
             var value = dynamicMatches[param] || "";
             var _dynamicGroups$param = dynamicGroups[param],
               repeat = _dynamicGroups$param.repeat,
@@ -813,7 +814,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params: params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(function(key) {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -844,11 +858,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
-              finalUrl.pathname,
-              finalUrl.pathname,
-              query
-            );
+
+            var _interpolateAs = interpolateAs(
+                finalUrl.pathname,
+                finalUrl.pathname,
+                query
+              ),
+              result = _interpolateAs.result,
+              params = _interpolateAs.params;
+
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1181,11 +1204,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _options$shallow,
                     shallow,
                     resolvedAs,
-                    _ref3,
+                    parsedAs,
                     asPathname,
                     routeRegex,
                     routeMatch,
                     missingParams,
+                    _interpolateAs2,
+                    result,
+                    params,
                     routeInfo,
                     error,
                     appComp;
@@ -1300,21 +1326,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             resolvedAs = delBasePath(resolvedAs);
 
                             if (!(0, _isDynamic.isDynamicRoute)(route)) {
-                              _context.next = 46;
+                              _context.next = 47;
                               break;
                             }
 
-                            (_ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(
+                            parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(
                               resolvedAs
-                            )),
-                              (asPathname = _ref3.pathname);
+                            );
+                            asPathname = parsedAs.pathname;
                             routeRegex = (0, _routeRegex.getRouteRegex)(route);
                             routeMatch = (0, _routeMatcher.getRouteMatcher)(
                               routeRegex
                             )(asPathname);
 
                             if (routeMatch) {
-                              _context.next = 45;
+                              _context.next = 46;
                               break;
                             }
 
@@ -1325,7 +1351,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             });
 
                             if (!(missingParams.length > 0)) {
-                              _context.next = 43;
+                              _context.next = 44;
                               break;
                             }
 
@@ -1342,22 +1368,34 @@ 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 43:
-                            _context.next = 46;
+                          case 44:
+                            _context.next = 47;
                             break;
 
-                          case 45:
+                          case 46:
                             if (route === asPathname) {
-                              as = interpolateAs(route, asPathname, query);
+                              (_interpolateAs2 = interpolateAs(
+                                route,
+                                asPathname,
+                                query
+                              )),
+                                (result = _interpolateAs2.result),
+                                (params = _interpolateAs2.params);
+                              as = (0, _utils.formatWithValidation)(
+                                Object.assign({}, parsedAs, {
+                                  pathname: result,
+                                  query: omitParmsFromQuery(query, params)
+                                })
+                              );
                             } else {
                               // Merge params into `query`, overwriting any specified in search
                               Object.assign(query, routeMatch);
                             }
 
-                          case 46:
+                          case 47:
                             Router.events.emit("routeChangeStart", as);
-                            _context.prev = 47;
-                            _context.next = 50;
+                            _context.prev = 48;
+                            _context.next = 51;
                             return this.getRouteInfo(
                               route,
                               pathname,
@@ -1366,7 +1404,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               shallow
                             );
 
-                          case 50:
+                          case 51:
                             routeInfo = _context.sent;
                             error = routeInfo.error;
                             Router.events.emit("beforeHistoryChange", as);
@@ -1375,7 +1413,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 57;
+                            _context.next = 58;
                             return this.set(
                               route,
                               pathname,
@@ -1387,9 +1425,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 57:
+                          case 58:
                             if (!error) {
-                              _context.next = 60;
+                              _context.next = 61;
                               break;
                             }
 
@@ -1400,28 +1438,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 60:
+                          case 61:
                             if (false) {
                             }
 
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 65:
-                            _context.prev = 65;
-                            _context.t0 = _context["catch"](47);
+                          case 66:
+                            _context.prev = 66;
+                            _context.t0 = _context["catch"](48);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 69;
+                              _context.next = 70;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 69:
+                          case 70:
                             throw _context.t0;
 
-                          case 70:
+                          case 71:
                           case "end":
                             return _context.stop();
                         }
@@ -1429,7 +1467,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[47, 65]]
+                    [[48, 66]]
                   );
                 })
               );
Diff for main-cdbac89..a3.module.js
@@ -1385,7 +1385,7 @@
 
           var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
           var interpolatedRoute = isDynamic
-            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query).result
             : "";
           return isDynamic
             ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for main-ffe281b..a7333921f.js
@@ -1751,6 +1751,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
               var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
               var interpolatedRoute = isDynamic
                 ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+                    .result
                 : "";
               return isDynamic
                 ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7e029f66cd343d0cdca4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -87,13 +87,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7e029f66cd343d0cdca4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.ecb1099d47a74ae628f6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7e029f66cd343d0cdca4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.a69c2af1b9467350a845.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4046eb9d7e6363751ffb.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 14.9s 14.8s -156ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..cf8c.js gzip 10.5 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..de6e.js gzip N/A 10.6 kB N/A
main-aa5a068..ce3c.js gzip N/A 7.08 kB N/A
Overall change 57.3 kB 57.4 kB ⚠️ +122 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.4 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB N/A N/A
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.5 kB N/A
main-6f1730e..dule.js gzip N/A 6.14 kB N/A
Overall change 52.3 kB 52.4 kB ⚠️ +109 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.08 MB 1.08 MB ⚠️ +713 B
routerDirect.js 1.07 MB 1.07 MB ⚠️ +713 B
withRouter.js 1.07 MB 1.07 MB ⚠️ +713 B
Overall change 5.29 MB 5.29 MB ⚠️ +2.14 kB
Commit: 0631da6

@ijjk
Copy link
Member Author

ijjk commented Sep 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 13.2s 13.6s ⚠️ +346ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
/ failed reqs 0 0
/ total time (seconds) 2.385 2.363 -0.02
/ avg req/sec 1048.4 1057.99 +9.59
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.381 1.411 ⚠️ +0.03
/error-in-render avg req/sec 1810.62 1772.4 ⚠️ -38.22
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..bdc4.js gzip 10.5 kB 10.6 kB ⚠️ +118 B
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB 7.08 kB ⚠️ +5 B
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.4 kB ⚠️ +123 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.41 kB 6.51 kB ⚠️ +106 B
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB 6.14 kB ⚠️ +5 B
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.4 kB ⚠️ +111 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
index.html gzip 972 B 971 B -1 B
link.html gzip 977 B 978 B ⚠️ +1 B
withRouter.html gzip 961 B 964 B ⚠️ +3 B
Overall change 2.91 kB 2.91 kB ⚠️ +3 B

Diffs

Diff for 677f882d2ed8..25.module.js
@@ -637,9 +637,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(param => {
+          !params.every(param => {
             var value = dynamicMatches[param] || "";
             var { repeat, optional } = dynamicGroups[param]; // support single-level catch-all
             // TODO: more robust handling for user-error (passing `/`)
@@ -670,7 +671,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(key => {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -701,11 +715,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
+            var { result, params } = interpolateAs(
               finalUrl.pathname,
               finalUrl.pathname,
               query
             );
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1067,8 +1086,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           resolvedAs = delBasePath(resolvedAs);
 
           if ((0, _isDynamic.isDynamicRoute)(route)) {
-            var { pathname: asPathname } = (0,
-            _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var asPathname = parsedAs.pathname;
             var routeRegex = (0, _routeRegex.getRouteRegex)(route);
             var routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(
               asPathname
@@ -1094,7 +1113,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 );
               }
             } else if (route === asPathname) {
-              as = interpolateAs(route, asPathname, query);
+              var { result, params } = interpolateAs(route, asPathname, query);
+              as = (0, _utils.formatWithValidation)(
+                Object.assign({}, parsedAs, {
+                  pathname: result,
+                  query: omitParmsFromQuery(query, params)
+                })
+              );
             } else {
               // Merge params into `query`, overwriting any specified in search
               Object.assign(query, routeMatch);
Diff for 677f882d2ed8..3d8656d6f.js
@@ -778,9 +778,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(function(param) {
+          !params.every(function(param) {
             var value = dynamicMatches[param] || "";
             var _dynamicGroups$param = dynamicGroups[param],
               repeat = _dynamicGroups$param.repeat,
@@ -813,7 +814,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params: params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(function(key) {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -844,11 +858,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
-              finalUrl.pathname,
-              finalUrl.pathname,
-              query
-            );
+
+            var _interpolateAs = interpolateAs(
+                finalUrl.pathname,
+                finalUrl.pathname,
+                query
+              ),
+              result = _interpolateAs.result,
+              params = _interpolateAs.params;
+
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1181,11 +1204,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _options$shallow,
                     shallow,
                     resolvedAs,
-                    _ref3,
+                    parsedAs,
                     asPathname,
                     routeRegex,
                     routeMatch,
                     missingParams,
+                    _interpolateAs2,
+                    result,
+                    params,
                     routeInfo,
                     error,
                     appComp;
@@ -1300,21 +1326,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             resolvedAs = delBasePath(resolvedAs);
 
                             if (!(0, _isDynamic.isDynamicRoute)(route)) {
-                              _context.next = 46;
+                              _context.next = 47;
                               break;
                             }
 
-                            (_ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(
+                            parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(
                               resolvedAs
-                            )),
-                              (asPathname = _ref3.pathname);
+                            );
+                            asPathname = parsedAs.pathname;
                             routeRegex = (0, _routeRegex.getRouteRegex)(route);
                             routeMatch = (0, _routeMatcher.getRouteMatcher)(
                               routeRegex
                             )(asPathname);
 
                             if (routeMatch) {
-                              _context.next = 45;
+                              _context.next = 46;
                               break;
                             }
 
@@ -1325,7 +1351,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             });
 
                             if (!(missingParams.length > 0)) {
-                              _context.next = 43;
+                              _context.next = 44;
                               break;
                             }
 
@@ -1342,22 +1368,34 @@ 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 43:
-                            _context.next = 46;
+                          case 44:
+                            _context.next = 47;
                             break;
 
-                          case 45:
+                          case 46:
                             if (route === asPathname) {
-                              as = interpolateAs(route, asPathname, query);
+                              (_interpolateAs2 = interpolateAs(
+                                route,
+                                asPathname,
+                                query
+                              )),
+                                (result = _interpolateAs2.result),
+                                (params = _interpolateAs2.params);
+                              as = (0, _utils.formatWithValidation)(
+                                Object.assign({}, parsedAs, {
+                                  pathname: result,
+                                  query: omitParmsFromQuery(query, params)
+                                })
+                              );
                             } else {
                               // Merge params into `query`, overwriting any specified in search
                               Object.assign(query, routeMatch);
                             }
 
-                          case 46:
+                          case 47:
                             Router.events.emit("routeChangeStart", as);
-                            _context.prev = 47;
-                            _context.next = 50;
+                            _context.prev = 48;
+                            _context.next = 51;
                             return this.getRouteInfo(
                               route,
                               pathname,
@@ -1366,7 +1404,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               shallow
                             );
 
-                          case 50:
+                          case 51:
                             routeInfo = _context.sent;
                             error = routeInfo.error;
                             Router.events.emit("beforeHistoryChange", as);
@@ -1375,7 +1413,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 57;
+                            _context.next = 58;
                             return this.set(
                               route,
                               pathname,
@@ -1387,9 +1425,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 57:
+                          case 58:
                             if (!error) {
-                              _context.next = 60;
+                              _context.next = 61;
                               break;
                             }
 
@@ -1400,28 +1438,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 60:
+                          case 61:
                             if (false) {
                             }
 
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 65:
-                            _context.prev = 65;
-                            _context.t0 = _context["catch"](47);
+                          case 66:
+                            _context.prev = 66;
+                            _context.t0 = _context["catch"](48);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 69;
+                              _context.next = 70;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 69:
+                          case 70:
                             throw _context.t0;
 
-                          case 70:
+                          case 71:
                           case "end":
                             return _context.stop();
                         }
@@ -1429,7 +1467,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[47, 65]]
+                    [[48, 66]]
                   );
                 })
               );
Diff for main-cdbac89..a3.module.js
@@ -1385,7 +1385,7 @@
 
           var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
           var interpolatedRoute = isDynamic
-            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query).result
             : "";
           return isDynamic
             ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for main-ffe281b..a7333921f.js
@@ -1751,6 +1751,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
               var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
               var interpolatedRoute = isDynamic
                 ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+                    .result
                 : "";
               return isDynamic
                 ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -87,13 +87,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      href="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-ffe281befa3a7333921f.js"
+      src="/_next/static/chunks/main-67ab0b831895ff1bacf4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-cdbac89446f9e4ede0a3.module.js"
+      src="/_next/static/chunks/main-ec5be280c3f6d5e59a4a.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 15.3s 15.4s ⚠️ +156ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..bdc4.js gzip 10.5 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-0109a22..a8e8.js gzip 7.08 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..7362.js gzip N/A 10.6 kB N/A
main-aa5a068..ce3c.js gzip N/A 7.08 kB N/A
Overall change 57.3 kB 57.4 kB ⚠️ +123 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.41 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-8b2bf21..dule.js gzip 6.14 kB N/A N/A
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.51 kB N/A
main-6f1730e..dule.js gzip N/A 6.14 kB N/A
Overall change 52.3 kB 52.4 kB ⚠️ +111 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.08 MB 1.08 MB ⚠️ +713 B
routerDirect.js 1.07 MB 1.07 MB ⚠️ +713 B
withRouter.js 1.07 MB 1.07 MB ⚠️ +713 B
Overall change 5.29 MB 5.29 MB ⚠️ +2.14 kB
Commit: b24b45c

@ijjk
Copy link
Member Author

ijjk commented Sep 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 12.3s 13s ⚠️ +714ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js update/href-interpolation Change
/ failed reqs 0 0
/ total time (seconds) 2.368 2.431 ⚠️ +0.06
/ avg req/sec 1055.67 1028.35 ⚠️ -27.32
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.457 1.43 -0.03
/error-in-render avg req/sec 1715.39 1748.35 +32.96
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..bdc4.js gzip 10.5 kB 10.6 kB ⚠️ +118 B
framework.HASH.js gzip 39 kB 39 kB
main-23b280d..81de.js gzip 7.08 kB 7.08 kB ⚠️ +5 B
webpack-e067..f178.js gzip 751 B 751 B
Overall change 57.3 kB 57.4 kB ⚠️ +123 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.41 kB 6.51 kB ⚠️ +106 B
framework.HA..dule.js gzip 39 kB 39 kB
main-6bda92f..dule.js gzip 6.14 kB 6.14 kB ⚠️ +4 B
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 52.3 kB 52.4 kB ⚠️ +110 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
index.html gzip 971 B 971 B
link.html gzip 977 B 977 B
withRouter.html gzip 963 B 964 B ⚠️ +1 B
Overall change 2.91 kB 2.91 kB ⚠️ +1 B

Diffs

Diff for 677f882d2ed8..25.module.js
@@ -637,9 +637,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(param => {
+          !params.every(param => {
             var value = dynamicMatches[param] || "";
             var { repeat, optional } = dynamicGroups[param]; // support single-level catch-all
             // TODO: more robust handling for user-error (passing `/`)
@@ -670,7 +671,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(key => {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -701,11 +715,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
+            var { result, params } = interpolateAs(
               finalUrl.pathname,
               finalUrl.pathname,
               query
             );
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1067,8 +1086,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           resolvedAs = delBasePath(resolvedAs);
 
           if ((0, _isDynamic.isDynamicRoute)(route)) {
-            var { pathname: asPathname } = (0,
-            _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(resolvedAs);
+            var asPathname = parsedAs.pathname;
             var routeRegex = (0, _routeRegex.getRouteRegex)(route);
             var routeMatch = (0, _routeMatcher.getRouteMatcher)(routeRegex)(
               asPathname
@@ -1094,7 +1113,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 );
               }
             } else if (route === asPathname) {
-              as = interpolateAs(route, asPathname, query);
+              var { result, params } = interpolateAs(route, asPathname, query);
+              as = (0, _utils.formatWithValidation)(
+                Object.assign({}, parsedAs, {
+                  pathname: result,
+                  query: omitParmsFromQuery(query, params)
+                })
+              );
             } else {
               // Merge params into `query`, overwriting any specified in search
               Object.assign(query, routeMatch);
Diff for 677f882d2ed8..3d8656d6f.js
@@ -778,9 +778,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // TODO: should this take priority; also need to change in the router.
           query;
         interpolatedRoute = route;
+        var params = Object.keys(dynamicGroups);
 
         if (
-          !Object.keys(dynamicGroups).every(function(param) {
+          !params.every(function(param) {
             var value = dynamicMatches[param] || "";
             var _dynamicGroups$param = dynamicGroups[param],
               repeat = _dynamicGroups$param.repeat,
@@ -813,7 +814,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // development in the `<Link>` component directly.
         }
 
-        return interpolatedRoute;
+        return {
+          params: params,
+          result: interpolatedRoute
+        };
+      }
+
+      function omitParmsFromQuery(query, params) {
+        var filteredQuery = {};
+        Object.keys(query).forEach(function(key) {
+          if (!params.includes(key)) {
+            filteredQuery[key] = query[key];
+          }
+        });
+        return filteredQuery;
       }
       /**
        * Resolves a given hyperlink with a certain router state (basePath not included).
@@ -844,11 +858,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             var query = (0, _querystring.searchParamsToUrlQuery)(
               finalUrl.searchParams
             );
-            interpolatedAs = interpolateAs(
-              finalUrl.pathname,
-              finalUrl.pathname,
-              query
-            );
+
+            var _interpolateAs = interpolateAs(
+                finalUrl.pathname,
+                finalUrl.pathname,
+                query
+              ),
+              result = _interpolateAs.result,
+              params = _interpolateAs.params;
+
+            interpolatedAs = (0, _utils.formatWithValidation)({
+              pathname: result,
+              hash: finalUrl.hash,
+              query: omitParmsFromQuery(query, params)
+            });
           } // if the origin didn't change, it means we received a relative href
 
           var resolvedHref =
@@ -1181,11 +1204,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _options$shallow,
                     shallow,
                     resolvedAs,
-                    _ref3,
+                    parsedAs,
                     asPathname,
                     routeRegex,
                     routeMatch,
                     missingParams,
+                    _interpolateAs2,
+                    result,
+                    params,
                     routeInfo,
                     error,
                     appComp;
@@ -1300,21 +1326,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             resolvedAs = delBasePath(resolvedAs);
 
                             if (!(0, _isDynamic.isDynamicRoute)(route)) {
-                              _context.next = 46;
+                              _context.next = 47;
                               break;
                             }
 
-                            (_ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(
+                            parsedAs = (0, _parseRelativeUrl.parseRelativeUrl)(
                               resolvedAs
-                            )),
-                              (asPathname = _ref3.pathname);
+                            );
+                            asPathname = parsedAs.pathname;
                             routeRegex = (0, _routeRegex.getRouteRegex)(route);
                             routeMatch = (0, _routeMatcher.getRouteMatcher)(
                               routeRegex
                             )(asPathname);
 
                             if (routeMatch) {
-                              _context.next = 45;
+                              _context.next = 46;
                               break;
                             }
 
@@ -1325,7 +1351,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             });
 
                             if (!(missingParams.length > 0)) {
-                              _context.next = 43;
+                              _context.next = 44;
                               break;
                             }
 
@@ -1342,22 +1368,34 @@ 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 43:
-                            _context.next = 46;
+                          case 44:
+                            _context.next = 47;
                             break;
 
-                          case 45:
+                          case 46:
                             if (route === asPathname) {
-                              as = interpolateAs(route, asPathname, query);
+                              (_interpolateAs2 = interpolateAs(
+                                route,
+                                asPathname,
+                                query
+                              )),
+                                (result = _interpolateAs2.result),
+                                (params = _interpolateAs2.params);
+                              as = (0, _utils.formatWithValidation)(
+                                Object.assign({}, parsedAs, {
+                                  pathname: result,
+                                  query: omitParmsFromQuery(query, params)
+                                })
+                              );
                             } else {
                               // Merge params into `query`, overwriting any specified in search
                               Object.assign(query, routeMatch);
                             }
 
-                          case 46:
+                          case 47:
                             Router.events.emit("routeChangeStart", as);
-                            _context.prev = 47;
-                            _context.next = 50;
+                            _context.prev = 48;
+                            _context.next = 51;
                             return this.getRouteInfo(
                               route,
                               pathname,
@@ -1366,7 +1404,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               shallow
                             );
 
-                          case 50:
+                          case 51:
                             routeInfo = _context.sent;
                             error = routeInfo.error;
                             Router.events.emit("beforeHistoryChange", as);
@@ -1375,7 +1413,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             if (false) {
                             }
 
-                            _context.next = 57;
+                            _context.next = 58;
                             return this.set(
                               route,
                               pathname,
@@ -1387,9 +1425,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               else throw e;
                             });
 
-                          case 57:
+                          case 58:
                             if (!error) {
-                              _context.next = 60;
+                              _context.next = 61;
                               break;
                             }
 
@@ -1400,28 +1438,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             );
                             throw error;
 
-                          case 60:
+                          case 61:
                             if (false) {
                             }
 
                             Router.events.emit("routeChangeComplete", as);
                             return _context.abrupt("return", true);
 
-                          case 65:
-                            _context.prev = 65;
-                            _context.t0 = _context["catch"](47);
+                          case 66:
+                            _context.prev = 66;
+                            _context.t0 = _context["catch"](48);
 
                             if (!_context.t0.cancelled) {
-                              _context.next = 69;
+                              _context.next = 70;
                               break;
                             }
 
                             return _context.abrupt("return", false);
 
-                          case 69:
+                          case 70:
                             throw _context.t0;
 
-                          case 70:
+                          case 71:
                           case "end":
                             return _context.stop();
                         }
@@ -1429,7 +1467,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     },
                     _callee,
                     this,
-                    [[47, 65]]
+                    [[48, 66]]
                   );
                 })
               );
Diff for main-5f7517d..81b929b31.js
@@ -1751,6 +1751,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
               var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
               var interpolatedRoute = isDynamic
                 ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+                    .result
                 : "";
               return isDynamic
                 ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for main-bd1ad01..73.module.js
@@ -1385,7 +1385,7 @@
 
           var isDynamic = (0, _isDynamic.isDynamicRoute)(route);
           var interpolatedRoute = isDynamic
-            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query)
+            ? (0, _router.interpolateAs)(hrefPathname, asPathname, query).result
             : "";
           return isDynamic
             ? interpolatedRoute && getHrefForSlug(interpolatedRoute)
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      href="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-5f7517d7cd081b929b31.js"
+      src="/_next/static/chunks/main-1a3435e4a6c09ebaf30a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      src="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      href="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -87,13 +87,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-5f7517d7cd081b929b31.js"
+      src="/_next/static/chunks/main-1a3435e4a6c09ebaf30a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      src="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -123,13 +123,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css="true"></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      href="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -25,7 +25,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -82,13 +82,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-5f7517d7cd081b929b31.js"
+      src="/_next/static/chunks/main-1a3435e4a6c09ebaf30a.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-bd1ad013b88d09a03073.module.js"
+      src="/_next/static/chunks/main-2b62984cd7bbd37b947d.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -118,13 +118,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.5403aaa2f8e3d8656d6f.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.48509355e812db076a1e.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.4714742e9d000126f125.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.e1be7d91975a4e7aea7e.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
buildDuration 13.9s 13.9s ⚠️ +43ms
nodeModulesSize 56.7 MB 56.7 MB ⚠️ +2.19 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..bdc4.js gzip 10.5 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-23b280d..81de.js gzip 7.08 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..7362.js gzip N/A 10.6 kB N/A
main-e2c140f..b7b5.js gzip N/A 7.08 kB N/A
Overall change 57.3 kB 57.4 kB ⚠️ +123 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
677f882d2ed8..dule.js gzip 6.41 kB N/A N/A
framework.HA..dule.js gzip 39 kB 39 kB
main-6bda92f..dule.js gzip 6.14 kB N/A N/A
webpack-07c5..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 6.51 kB N/A
main-9d3fe5e..dule.js gzip N/A 6.14 kB N/A
Overall change 52.3 kB 52.4 kB ⚠️ +110 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/href-interpolation Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-9a0b9e1..b37e.js gzip 1.28 kB 1.28 kB
_error-ed1b0..8fbd.js gzip 3.44 kB 3.44 kB
hooks-89731c..c609.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-d2344ce..8b36.js gzip 1.3 kB 1.3 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-f8c0daf..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.36 kB 5.36 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_buildManifest.js gzip 322 B 322 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 651 B 651 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/href-interpolation Change
_error.js 1.03 MB 1.03 MB
404.html 4.22 kB 4.22 kB
hooks.html 3.86 kB 3.86 kB
index.js 1.03 MB 1.03 MB
link.js 1.08 MB 1.08 MB ⚠️ +713 B
routerDirect.js 1.07 MB 1.07 MB ⚠️ +713 B
withRouter.js 1.07 MB 1.07 MB ⚠️ +713 B
Overall change 5.29 MB 5.29 MB ⚠️ +2.14 kB
Commit: b5031e4

@timneutkens timneutkens merged commit f942d9e into vercel:canary Sep 7, 2020
@timneutkens timneutkens deleted the update/href-interpolation branch September 7, 2020 11:09
HitoriSensei pushed a commit to HitoriSensei/next.js that referenced this pull request Sep 26, 2020
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interpolating dynamic href values doesn't preserve extra query params
2 participants