Unverified Commit 8999ef26 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Remove Dead Code from Next Server (#10772)

* Remove Dead Code from Next Server

* remove options

* trigger
parent 302b55b4
...@@ -780,7 +780,7 @@ export default class Server { ...@@ -780,7 +780,7 @@ export default class Server {
return this.render404(req, res, parsedUrl) 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 // Request was ended by the user
if (html === null) { if (html === null) {
return return
...@@ -1127,14 +1127,7 @@ export default class Server { ...@@ -1127,14 +1127,7 @@ export default class Server {
req: IncomingMessage, req: IncomingMessage,
res: ServerResponse, res: ServerResponse,
pathname: string, pathname: string,
query: ParsedUrlQuery = {}, query: ParsedUrlQuery = {}
{
amphtml,
hasAmp,
}: {
amphtml?: boolean
hasAmp?: boolean
} = {}
): Promise<string | null> { ): Promise<string | null> {
try { try {
const result = await this.findPageComponents(pathname, query) const result = await this.findPageComponents(pathname, query)
...@@ -1144,7 +1137,7 @@ export default class Server { ...@@ -1144,7 +1137,7 @@ export default class Server {
res, res,
pathname, pathname,
result, result,
{ ...this.renderOpts, amphtml, hasAmp } { ...this.renderOpts }
) )
if (result2 !== false) { if (result2 !== false) {
return result2 return result2
...@@ -1169,12 +1162,7 @@ export default class Server { ...@@ -1169,12 +1162,7 @@ export default class Server {
res, res,
dynamicRoute.page, dynamicRoute.page,
result, result,
{ { ...this.renderOpts, params }
...this.renderOpts,
params,
amphtml,
hasAmp,
}
) )
if (result2 !== false) { if (result2 !== false) {
return result2 return result2
......
...@@ -448,8 +448,7 @@ export default class DevServer extends Server { ...@@ -448,8 +448,7 @@ export default class DevServer extends Server {
req: IncomingMessage, req: IncomingMessage,
res: ServerResponse, res: ServerResponse,
pathname: string, pathname: string,
query: { [key: string]: string }, query: { [key: string]: string }
options = {}
) { ) {
const compilationErr = await this.getCompilationError(pathname) const compilationErr = await this.getCompilationError(pathname)
if (compilationErr) { if (compilationErr) {
...@@ -489,7 +488,7 @@ export default class DevServer extends Server { ...@@ -489,7 +488,7 @@ export default class DevServer extends Server {
} }
if (!this.quiet) console.error(err) 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 return html
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment