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

refactor: remove unnecessary condition #57835

Merged
merged 2 commits into from
Oct 31, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/next/src/server/dev/hot-reloader-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,6 @@ export default class HotReloader implements NextJsHotReloaderInterface {

return this.onDemandEntries?.ensurePage({
page,
clientOnly,
appPaths,
definition,
isApp,
Expand Down
26 changes: 9 additions & 17 deletions packages/next/src/server/dev/on-demand-entry-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,11 @@ export function onDemandEntryHandler({

async function ensurePageImpl({
page,
clientOnly,
appPaths,
definition,
isApp,
}: {
page: string
clientOnly: boolean
appPaths: ReadonlyArray<string> | null
definition: RouteDefinition | undefined
isApp: boolean | undefined
Expand Down Expand Up @@ -834,7 +832,7 @@ export function onDemandEntryHandler({
const hasNewEntry = addedValues.some((entry) => entry.newEntry)

if (hasNewEntry) {
reportTrigger(!clientOnly && hasNewEntry ? `${route.page}` : route.page)
reportTrigger(route.page)
}

if (entriesThatShouldBeInvalidated.length > 0) {
Expand Down Expand Up @@ -874,7 +872,6 @@ export function onDemandEntryHandler({

type EnsurePageOptions = {
page: string
clientOnly: boolean
appPaths?: ReadonlyArray<string> | null
definition?: RouteDefinition
isApp?: boolean
Expand All @@ -898,7 +895,6 @@ export function onDemandEntryHandler({
return {
async ensurePage({
page,
clientOnly,
appPaths = null,
definition,
isApp,
Expand All @@ -912,18 +908,14 @@ export function onDemandEntryHandler({
// Wrap the invocation of the ensurePageImpl function in the pending
// wrapper, which will ensure that we don't have multiple compilations
// for the same page happening concurrently.
return batcher.batch(
{ page, clientOnly, appPaths, definition, isApp },
async () => {
await ensurePageImpl({
page,
clientOnly,
appPaths,
definition,
isApp,
})
}
)
return batcher.batch({ page, appPaths, definition, isApp }, async () => {
await ensurePageImpl({
page,
appPaths,
definition,
isApp,
})
})
},
onHMR(client: ws, getHmrServerError: () => Error | null) {
let bufferedHmrServerError: Error | null = null
Expand Down
Loading