Skip to content

Expose util internally for debugging #56381

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

Merged
merged 4 commits into from
Oct 3, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
}
const nextFontManifest = maybeJSONParse(self.__NEXT_FONT_MANIFEST)

globalThis.__next_private_global_wait_until__ = []

const render = getRender({
pagesType,
dev: ${dev},
Expand Down Expand Up @@ -255,12 +257,22 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =

export const ComponentMod = pageMod

export default function(opts) {
return adapter({
export default async function(opts, event) {
const res = await adapter({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why await? It doesn't hurt, but also isn't needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using res.waitUntil down below, otherwise it will be a promise here.

...opts,
IncrementalCache,
handler: render
})

if (event && event.waitUntil) {
event.waitUntil(
Promise.all(
[res?.waitUntil, ...globalThis.__next_private_global_wait_until__]
)
)
}

return res
}`

return transformed
Expand Down