Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Dead Code from Next Server #10772

Merged
merged 4 commits into from Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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