Skip to content

Commit

Permalink
remove un-used vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Apr 13, 2020
1 parent 07309ff commit 474ed85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 1 addition & 4 deletions packages/next/next-server/lib/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
}
Expand Down
16 changes: 11 additions & 5 deletions packages/next/next-server/server/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -312,7 +312,7 @@ export async function renderToHTML(
isDataReq,
params,
previewProps,
basePath
basePath,
} = renderOpts

const callMiddleware = async (method: string, args: any[], props = false) => {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 474ed85

Please sign in to comment.