From 474ed85827555e36d2acc94f3facda7ffaa2fb00 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 13 Apr 2020 10:28:41 -0500 Subject: [PATCH] remove un-used vars --- packages/next/next-server/lib/router/router.ts | 5 +---- packages/next/next-server/server/render.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/next/next-server/lib/router/router.ts b/packages/next/next-server/lib/router/router.ts index c11a4e2ff7dc2c..b6cf42f7201f24 100644 --- a/packages/next/next-server/lib/router/router.ts +++ b/packages/next/next-server/lib/router/router.ts @@ -472,7 +472,6 @@ export default class Router implements BaseRouter { Router.events.emit('beforeHistoryChange', as) this.changeState(method, url, as, options) - const hash = window.location.hash.substring(1) if (process.env.NODE_ENV !== 'production') { const appComp: any = this.components['/_app'].Component @@ -754,9 +753,7 @@ export default class Router implements BaseRouter { const route = delBasePath(toRoute(pathname)) Promise.all([ this.pageLoader.prefetchData(route, delBasePath(asPath)), - this.pageLoader[options.priority ? 'loadPage' : 'prefetch']( - route - ), + this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route), ]).then(() => resolve(), reject) }) } diff --git a/packages/next/next-server/server/render.tsx b/packages/next/next-server/server/render.tsx index 5cfe17510f42db..0d63f8157c6de2 100644 --- a/packages/next/next-server/server/render.tsx +++ b/packages/next/next-server/server/render.tsx @@ -23,7 +23,7 @@ import Loadable from '../lib/loadable' import { LoadableContext } from '../lib/loadable-context' import mitt, { MittEmitter } from '../lib/mitt' import { RouterContext } from '../lib/router-context' -import { NextRouter, addBasePath } from '../lib/router/router' +import { NextRouter } from '../lib/router/router' import { isDynamicRoute } from '../lib/router/utils/is-dynamic' import { AppType, @@ -312,7 +312,7 @@ export async function renderToHTML( isDataReq, params, previewProps, - basePath + basePath, } = renderOpts const callMiddleware = async (method: string, args: any[], props = false) => { @@ -457,9 +457,15 @@ export async function renderToHTML( // @ts-ignore url will always be set const asPath: string = req.url - const router = new ServerRouter(pathname, query, asPath, { - isFallback: isFallback, - }, basePath) + const router = new ServerRouter( + pathname, + query, + asPath, + { + isFallback: isFallback, + }, + basePath + ) const ctx = { err, req: isAutoExport ? undefined : req,