Skip to content

Commit

Permalink
Convert custom-server-hapi Example to Typescript (#34507)
Browse files Browse the repository at this point in the history
In the contributing doc, it mentions "Examples should be TypeScript first, if possible" so I thought about converting some examples to be typescript along with updating a couple in my free time. Let me know if that would be an issue.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [X] Make sure the linting passes by running `yarn lint`
  • Loading branch information
mitchell-abbott committed Feb 18, 2022
1 parent 9e77ef4 commit 670eb03
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 34 deletions.
5 changes: 5 additions & 0 deletions examples/custom-server-hapi/next-env.d.ts
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
26 changes: 0 additions & 26 deletions examples/custom-server-hapi/next-wrapper.js

This file was deleted.

5 changes: 5 additions & 0 deletions examples/custom-server-hapi/nodemon.json
@@ -0,0 +1,5 @@
{
"watch": ["server"],
"exec": "ts-node --project tsconfig.server.json server/server.ts",
"ext": "js ts"
}
19 changes: 14 additions & 5 deletions examples/custom-server-hapi/package.json
@@ -1,15 +1,24 @@
{
"private": true,
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "cross-env NODE_ENV=production node server.js"
"dev": "nodemon",
"build": "next build && tsc --project tsconfig.server.json",
"start": "cross-env NODE_ENV=production node dist/server.js"
},
"dependencies": {
"@hapi/hapi": "^18.3.1",
"cross-env": "^5.2.0",
"@hapi/hapi": "^20.2.1",
"cross-env": "^7.0.3",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/hapi__hapi": "^20.0.10",
"@types/node": "^16.11.25",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"nodemon": "^2.0.15",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions examples/custom-server-hapi/server/next-wrapper.ts
@@ -0,0 +1,16 @@
import type { NextServer } from 'next/dist/server/next'
import type { Lifecycle } from '@hapi/hapi'
import type { NextUrlWithParsedQuery } from 'next/dist/server/request-meta'

const nextHandlerWrapper = (app: NextServer): Lifecycle.Method => {
const handler = app.getRequestHandler()

return async ({ raw, url, query }, h) => {
const nextUrl = url as unknown as NextUrlWithParsedQuery
nextUrl.query = query
await handler(raw.req, raw.res, nextUrl)
return h.close
}
}

export { nextHandlerWrapper }
@@ -1,6 +1,6 @@
const next = require('next')
const Hapi = require('@hapi/hapi')
const { /* pathWrapper, */ nextHandlerWrapper } = require('./next-wrapper')
import next from 'next'
import Hapi from '@hapi/hapi'
import { nextHandlerWrapper } from './next-wrapper'

const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
Expand Down
21 changes: 21 additions & 0 deletions examples/custom-server-hapi/tsconfig.json
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
12 changes: 12 additions & 0 deletions examples/custom-server-hapi/tsconfig.server.json
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"lib": ["es2019"],
"target": "es2019",
"isolatedModules": false,
"noEmit": false
},
"include": ["server/**/*.ts"]
}

1 comment on commit 670eb03

@ijjk
Copy link
Member

@ijjk ijjk commented on 670eb03 Feb 18, 2022

Choose a reason for hiding this comment

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

Stats from current release

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
buildDuration 15.9s 15.7s -190ms
buildDurationCached 6.2s 6.1s -132ms
nodeModulesSize 359 MB 359 MB ⚠️ +10.1 kB
Page Load Tests Overall increase ✓
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 3.152 3.011 -0.14
/ avg req/sec 793.17 830.25 +37.08
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.349 1.361 ⚠️ +0.01
/error-in-render avg req/sec 1853.4 1837.55 ⚠️ -15.85
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 27.9 kB 27.9 kB -26 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.6 kB 71.6 kB -26 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 326 B 326 B
dynamic-HASH.js gzip 2.57 kB 2.57 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 919 B 919 B
image-HASH.js gzip 5.05 kB 5.05 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.26 kB 2.26 kB
routerDirect..HASH.js gzip 321 B 321 B
script-HASH.js gzip 383 B 383 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.7 kB 14.7 kB
Client Build Manifests
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 460 B 460 B
Overall change 460 B 460 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
index.html gzip 531 B 532 B ⚠️ +1 B
link.html gzip 544 B 544 B
withRouter.html gzip 525 B 526 B ⚠️ +1 B
Overall change 1.6 kB 1.6 kB ⚠️ +2 B

Diffs

Diff for main-HASH.js
@@ -627,7 +627,7 @@
         document.getElementById("__NEXT_DATA__").textContent
       );
       window.__NEXT_DATA__ = data;
-      var version = "12.1.0";
+      var version = "12.1.1-canary.0";
       exports.version = version;
       var looseToArray = function(input) {
         return [].slice.call(input);
@@ -4264,6 +4264,7 @@
       var _routeMatcher = __webpack_require__(3888);
       var _routeRegex = __webpack_require__(4095);
       var _getMiddlewareRegex = __webpack_require__(9820);
+      var _formatUrl = __webpack_require__(4611);
       function _interopRequireDefault1(obj) {
         return obj && obj.__esModule
           ? obj
@@ -4440,7 +4441,7 @@
         var urlAsString =
           typeof href === "string"
             ? href
-            : (0, _utils).formatWithValidation(href);
+            : (0, _formatUrl).formatWithValidation(href);
         // repeated slashes and backslashes in the URL are considered
         // invalid and will never match a Next.js page/file
         var urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
@@ -4496,7 +4497,7 @@
               result = ref.result,
               params = ref.params;
             if (result) {
-              interpolatedAs = (0, _utils).formatWithValidation({
+              interpolatedAs = (0, _formatUrl).formatWithValidation({
                 pathname: result,
                 hash: finalUrl.hash,
                 query: omitParmsFromQuery(query, params)
@@ -4680,7 +4681,7 @@
                 query = _this.query;
               _this.changeState(
                 "replaceState",
-                (0, _utils).formatWithValidation({
+                (0, _formatUrl).formatWithValidation({
                   pathname: addBasePath(pathname),
                   query: query
                 }),
@@ -4800,7 +4801,7 @@
               options1._shouldResolveHref = as1 !== pathname2;
               this.changeState(
                 "replaceState",
-                (0, _utils).formatWithValidation({
+                (0, _formatUrl).formatWithValidation({
                   pathname: addBasePath(pathname2),
                   query: query1
                 }),
@@ -4977,7 +4978,9 @@
                               parsedAs.pathname = addBasePath(
                                 parsedAs.pathname
                               );
-                              as = (0, _utils).formatWithValidation(parsedAs);
+                              as = (0, _formatUrl).formatWithValidation(
+                                parsedAs
+                              );
                               url = addBasePath(
                                 (0, _normalizeLocalePath).normalizeLocalePath(
                                   hasBasePath(url) ? delBasePath(url) : url,
@@ -5170,7 +5173,9 @@
                               // allow the correct page chunk to be loaded
                               pathname = rewritesResult.resolvedHref;
                               parsed.pathname = addBasePath(pathname);
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                             _ctx.next = 70;
                             break;
@@ -5182,7 +5187,9 @@
                             if (parsed.pathname !== pathname) {
                               pathname = parsed.pathname;
                               parsed.pathname = addBasePath(pathname);
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                           }
                           case 70:
@@ -5250,7 +5257,9 @@
                               resolvedAs = effect.asPath;
                               pathname = effect.resolvedHref;
                               parsed.pathname = effect.resolvedHref;
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                             _ctx.next = 96;
                             break;
@@ -5366,7 +5375,7 @@
                             break;
                           case 111:
                             if (shouldInterpolate) {
-                              as = (0, _utils).formatWithValidation(
+                              as = (0, _formatUrl).formatWithValidation(
                                 Object.assign({}, parsedAs1, {
                                   pathname: interpolatedAs.result,
                                   query: omitParmsFromQuery(
@@ -5857,7 +5866,7 @@
                           case 17:
                             if (__N_SSG || __N_SSP || __N_RSC) {
                               dataHref = _this.pageLoader.getDataHref({
-                                href: (0, _utils).formatWithValidation({
+                                href: (0, _formatUrl).formatWithValidation({
                                   pathname: pathname,
                                   query: query
                                 }),
@@ -6097,7 +6106,7 @@
                             // allow the correct page chunk to be loaded
                             pathname = rewritesResult.resolvedHref;
                             parsed.pathname = pathname;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                           _ctx.next = 23;
                           break;
@@ -6109,7 +6118,7 @@
                           if (parsed.pathname !== pathname) {
                             pathname = parsed.pathname;
                             parsed.pathname = pathname;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                         }
                         case 23:
@@ -6140,7 +6149,7 @@
                               effects.parsedAs.query
                             );
                             resolvedAs = effects.asPath;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                           route = (0,
                           _normalizeTrailingSlash).removePathTrailingSlash(
@@ -6572,6 +6581,8 @@
         value: true
       });
       exports.formatUrl = formatUrl;
+      exports.formatWithValidation = formatWithValidation;
+      exports.urlObjectKeys = void 0;
       var querystring = _interopRequireWildcard(__webpack_require__(466));
       function _interopRequireWildcard(obj) {
         if (obj && obj.__esModule) {
@@ -6641,6 +6652,26 @@
           .concat(pathname)
           .concat(search)
           .concat(hash);
+      }
+      var urlObjectKeys = [
+        "auth",
+        "hash",
+        "host",
+        "hostname",
+        "href",
+        "path",
+        "pathname",
+        "port",
+        "protocol",
+        "query",
+        "search",
+        "slashes"
+      ];
+      exports.urlObjectKeys = urlObjectKeys;
+      function formatWithValidation(url) {
+        if (false) {
+        }
+        return formatUrl(url);
       } //# sourceMappingURL=format-url.js.map
 
       /***/
@@ -7977,10 +8008,7 @@
       exports.isResSent = isResSent;
       exports.normalizeRepeatedSlashes = normalizeRepeatedSlashes;
       exports.loadGetInitialProps = loadGetInitialProps;
-      exports.formatWithValidation = formatWithValidation;
-      exports.HtmlContext = exports.ST = exports.SP = exports.urlObjectKeys = void 0;
-      var _react = __webpack_require__(7294);
-      var _formatUrl = __webpack_require__(4611);
+      exports.ST = exports.SP = void 0;
       function execOnce(fn) {
         var used = false;
         var result;
@@ -8115,26 +8143,6 @@
         );
         return _loadGetInitialProps.apply(this, arguments);
       }
-      var urlObjectKeys = [
-        "auth",
-        "hash",
-        "host",
-        "hostname",
-        "href",
-        "path",
-        "pathname",
-        "port",
-        "protocol",
-        "query",
-        "search",
-        "slashes"
-      ];
-      exports.urlObjectKeys = urlObjectKeys;
-      function formatWithValidation(url) {
-        if (false) {
-        }
-        return (0, _formatUrl).formatUrl(url);
-      }
       var SP = typeof performance !== "undefined";
       exports.SP = SP;
       var ST =
@@ -8151,11 +8159,7 @@
         }
         return DecodeError;
       })(_wrapNativeSuper(Error));
-      exports.DecodeError = DecodeError;
-      var HtmlContext = (0, _react).createContext(null);
-      exports.HtmlContext = HtmlContext;
-      if (false) {
-      } //# sourceMappingURL=utils.js.map
+      exports.DecodeError = DecodeError; //# sourceMappingURL=utils.js.map
 
       /***/
     },
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
buildDuration 18.9s 19s ⚠️ +27ms
buildDurationCached 6.2s 6.1s -99ms
nodeModulesSize 359 MB 359 MB ⚠️ +10.1 kB
Page Load Tests Overall increase ✓
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 3.17 2.995 -0.17
/ avg req/sec 788.54 834.6 +46.06
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.34 1.337 0
/error-in-render avg req/sec 1865.17 1870.02 +4.85
Client Bundles (main, webpack, commons) Overall decrease ✓
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.1 kB 42.1 kB
main-HASH.js gzip 27.9 kB 27.9 kB -37 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.7 kB 71.7 kB -37 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 305 B 305 B
css-HASH.js gzip 321 B 321 B
dynamic-HASH.js gzip 2.56 kB 2.56 kB
head-HASH.js gzip 342 B 342 B
hooks-HASH.js gzip 911 B 911 B
image-HASH.js gzip 5.08 kB 5.08 kB
index-HASH.js gzip 256 B 256 B
link-HASH.js gzip 2.28 kB 2.28 kB
routerDirect..HASH.js gzip 314 B 314 B
script-HASH.js gzip 375 B 375 B
withRouter-HASH.js gzip 309 B 309 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.7 kB 14.7 kB
Client Build Manifests
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary v12.1.0 vercel/next.js refs/heads/canary Change
index.html gzip 533 B 533 B
link.html gzip 548 B 547 B -1 B
withRouter.html gzip 528 B 527 B -1 B
Overall change 1.61 kB 1.61 kB -2 B

Diffs

Diff for main-HASH.js
@@ -627,7 +627,7 @@
         document.getElementById("__NEXT_DATA__").textContent
       );
       window.__NEXT_DATA__ = data;
-      var version = "12.1.0";
+      var version = "12.1.1-canary.0";
       exports.version = version;
       var looseToArray = function(input) {
         return [].slice.call(input);
@@ -4264,6 +4264,7 @@
       var _routeMatcher = __webpack_require__(3888);
       var _routeRegex = __webpack_require__(4095);
       var _getMiddlewareRegex = __webpack_require__(9820);
+      var _formatUrl = __webpack_require__(4611);
       function _interopRequireDefault1(obj) {
         return obj && obj.__esModule
           ? obj
@@ -4440,7 +4441,7 @@
         var urlAsString =
           typeof href === "string"
             ? href
-            : (0, _utils).formatWithValidation(href);
+            : (0, _formatUrl).formatWithValidation(href);
         // repeated slashes and backslashes in the URL are considered
         // invalid and will never match a Next.js page/file
         var urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
@@ -4496,7 +4497,7 @@
               result = ref.result,
               params = ref.params;
             if (result) {
-              interpolatedAs = (0, _utils).formatWithValidation({
+              interpolatedAs = (0, _formatUrl).formatWithValidation({
                 pathname: result,
                 hash: finalUrl.hash,
                 query: omitParmsFromQuery(query, params)
@@ -4680,7 +4681,7 @@
                 query = _this.query;
               _this.changeState(
                 "replaceState",
-                (0, _utils).formatWithValidation({
+                (0, _formatUrl).formatWithValidation({
                   pathname: addBasePath(pathname),
                   query: query
                 }),
@@ -4800,7 +4801,7 @@
               options1._shouldResolveHref = as1 !== pathname2;
               this.changeState(
                 "replaceState",
-                (0, _utils).formatWithValidation({
+                (0, _formatUrl).formatWithValidation({
                   pathname: addBasePath(pathname2),
                   query: query1
                 }),
@@ -4977,7 +4978,9 @@
                               parsedAs.pathname = addBasePath(
                                 parsedAs.pathname
                               );
-                              as = (0, _utils).formatWithValidation(parsedAs);
+                              as = (0, _formatUrl).formatWithValidation(
+                                parsedAs
+                              );
                               url = addBasePath(
                                 (0, _normalizeLocalePath).normalizeLocalePath(
                                   hasBasePath(url) ? delBasePath(url) : url,
@@ -5170,7 +5173,9 @@
                               // allow the correct page chunk to be loaded
                               pathname = rewritesResult.resolvedHref;
                               parsed.pathname = addBasePath(pathname);
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                             _ctx.next = 70;
                             break;
@@ -5182,7 +5187,9 @@
                             if (parsed.pathname !== pathname) {
                               pathname = parsed.pathname;
                               parsed.pathname = addBasePath(pathname);
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                           }
                           case 70:
@@ -5250,7 +5257,9 @@
                               resolvedAs = effect.asPath;
                               pathname = effect.resolvedHref;
                               parsed.pathname = effect.resolvedHref;
-                              url = (0, _utils).formatWithValidation(parsed);
+                              url = (0, _formatUrl).formatWithValidation(
+                                parsed
+                              );
                             }
                             _ctx.next = 96;
                             break;
@@ -5366,7 +5375,7 @@
                             break;
                           case 111:
                             if (shouldInterpolate) {
-                              as = (0, _utils).formatWithValidation(
+                              as = (0, _formatUrl).formatWithValidation(
                                 Object.assign({}, parsedAs1, {
                                   pathname: interpolatedAs.result,
                                   query: omitParmsFromQuery(
@@ -5857,7 +5866,7 @@
                           case 17:
                             if (__N_SSG || __N_SSP || __N_RSC) {
                               dataHref = _this.pageLoader.getDataHref({
-                                href: (0, _utils).formatWithValidation({
+                                href: (0, _formatUrl).formatWithValidation({
                                   pathname: pathname,
                                   query: query
                                 }),
@@ -6097,7 +6106,7 @@
                             // allow the correct page chunk to be loaded
                             pathname = rewritesResult.resolvedHref;
                             parsed.pathname = pathname;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                           _ctx.next = 23;
                           break;
@@ -6109,7 +6118,7 @@
                           if (parsed.pathname !== pathname) {
                             pathname = parsed.pathname;
                             parsed.pathname = pathname;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                         }
                         case 23:
@@ -6140,7 +6149,7 @@
                               effects.parsedAs.query
                             );
                             resolvedAs = effects.asPath;
-                            url = (0, _utils).formatWithValidation(parsed);
+                            url = (0, _formatUrl).formatWithValidation(parsed);
                           }
                           route = (0,
                           _normalizeTrailingSlash).removePathTrailingSlash(
@@ -6572,6 +6581,8 @@
         value: true
       });
       exports.formatUrl = formatUrl;
+      exports.formatWithValidation = formatWithValidation;
+      exports.urlObjectKeys = void 0;
       var querystring = _interopRequireWildcard(__webpack_require__(466));
       function _interopRequireWildcard(obj) {
         if (obj && obj.__esModule) {
@@ -6641,6 +6652,26 @@
           .concat(pathname)
           .concat(search)
           .concat(hash);
+      }
+      var urlObjectKeys = [
+        "auth",
+        "hash",
+        "host",
+        "hostname",
+        "href",
+        "path",
+        "pathname",
+        "port",
+        "protocol",
+        "query",
+        "search",
+        "slashes"
+      ];
+      exports.urlObjectKeys = urlObjectKeys;
+      function formatWithValidation(url) {
+        if (false) {
+        }
+        return formatUrl(url);
       } //# sourceMappingURL=format-url.js.map
 
       /***/
@@ -7977,10 +8008,7 @@
       exports.isResSent = isResSent;
       exports.normalizeRepeatedSlashes = normalizeRepeatedSlashes;
       exports.loadGetInitialProps = loadGetInitialProps;
-      exports.formatWithValidation = formatWithValidation;
-      exports.HtmlContext = exports.ST = exports.SP = exports.urlObjectKeys = void 0;
-      var _react = __webpack_require__(7294);
-      var _formatUrl = __webpack_require__(4611);
+      exports.ST = exports.SP = void 0;
       function execOnce(fn) {
         var used = false;
         var result;
@@ -8115,26 +8143,6 @@
         );
         return _loadGetInitialProps.apply(this, arguments);
       }
-      var urlObjectKeys = [
-        "auth",
-        "hash",
-        "host",
-        "hostname",
-        "href",
-        "path",
-        "pathname",
-        "port",
-        "protocol",
-        "query",
-        "search",
-        "slashes"
-      ];
-      exports.urlObjectKeys = urlObjectKeys;
-      function formatWithValidation(url) {
-        if (false) {
-        }
-        return (0, _formatUrl).formatUrl(url);
-      }
       var SP = typeof performance !== "undefined";
       exports.SP = SP;
       var ST =
@@ -8151,11 +8159,7 @@
         }
         return DecodeError;
       })(_wrapNativeSuper(Error));
-      exports.DecodeError = DecodeError;
-      var HtmlContext = (0, _react).createContext(null);
-      exports.HtmlContext = HtmlContext;
-      if (false) {
-      } //# sourceMappingURL=utils.js.map
+      exports.DecodeError = DecodeError; //# sourceMappingURL=utils.js.map
 
       /***/
     },
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-c5581a7a22133abc.js"
+      src="/_next/static/chunks/main-5c20bcddfb068ef3.js"
       defer=""
     ></script>
     <script

Please sign in to comment.