Skip to content

Commit

Permalink
Remove Dead Code from Next Server (#10772)
Browse files Browse the repository at this point in the history
* Remove Dead Code from Next Server

* remove options

* trigger
  • Loading branch information
Timer committed Mar 1, 2020
1 parent 302b55b commit 8999ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
20 changes: 4 additions & 16 deletions packages/next/next-server/server/next-server.ts
Expand Up @@ -780,7 +780,7 @@ export default class Server {
return this.render404(req, res, parsedUrl)
}

const html = await this.renderToHTML(req, res, pathname, query, {})
const html = await this.renderToHTML(req, res, pathname, query)
// Request was ended by the user
if (html === null) {
return
Expand Down Expand Up @@ -1127,14 +1127,7 @@ export default class Server {
req: IncomingMessage,
res: ServerResponse,
pathname: string,
query: ParsedUrlQuery = {},
{
amphtml,
hasAmp,
}: {
amphtml?: boolean
hasAmp?: boolean
} = {}
query: ParsedUrlQuery = {}
): Promise<string | null> {
try {
const result = await this.findPageComponents(pathname, query)
Expand All @@ -1144,7 +1137,7 @@ export default class Server {
res,
pathname,
result,
{ ...this.renderOpts, amphtml, hasAmp }
{ ...this.renderOpts }
)
if (result2 !== false) {
return result2
Expand All @@ -1169,12 +1162,7 @@ export default class Server {
res,
dynamicRoute.page,
result,
{
...this.renderOpts,
params,
amphtml,
hasAmp,
}
{ ...this.renderOpts, params }
)
if (result2 !== false) {
return result2
Expand Down
5 changes: 2 additions & 3 deletions packages/next/server/next-dev-server.ts
Expand Up @@ -448,8 +448,7 @@ export default class DevServer extends Server {
req: IncomingMessage,
res: ServerResponse,
pathname: string,
query: { [key: string]: string },
options = {}
query: { [key: string]: string }
) {
const compilationErr = await this.getCompilationError(pathname)
if (compilationErr) {
Expand Down Expand Up @@ -489,7 +488,7 @@ export default class DevServer extends Server {
}
if (!this.quiet) console.error(err)
}
const html = await super.renderToHTML(req, res, pathname, query, options)
const html = await super.renderToHTML(req, res, pathname, query)
return html
}

Expand Down

0 comments on commit 8999ef2

Please sign in to comment.