Skip to content

Commit

Permalink
update todos
Browse files Browse the repository at this point in the history
  • Loading branch information
lubieowoce committed Oct 14, 2024
1 parent 4b5ed19 commit 5464098
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/next/src/export/routes/app-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export async function exportAppPage(
isDynamicError: boolean,
fileWriter: FileWriter
): Promise<ExportRouteResult> {
// TODO(after): should we use the onClose from MockedResponse?
const afterRunner = new AfterRunner()

const renderOpts: RenderOpts = {
Expand Down Expand Up @@ -84,7 +83,9 @@ export async function exportAppPage(

const html = result.toUnchunkedString()

await afterRunner.executeAfter() // TODO(after): thrown errors?
// TODO(after): if we abort a prerender because of an error in an after-callback
// we should probably communicate that better (and not log the error twice)
await afterRunner.executeAfter()

const { metadata } = result
const {
Expand Down
5 changes: 3 additions & 2 deletions packages/next/src/export/routes/app-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export async function exportAppRoute(
signalFromNodeResponse(res)
)

// TODO(after): should we use the onClose from MockedResponse?
const afterRunner = new AfterRunner()

// Create the context for the handler. This contains the params from
Expand Down Expand Up @@ -116,7 +115,9 @@ export async function exportAppRoute(

const blob = await response.blob()

await afterRunner.executeAfter() // TODO(after): thrown errors?
// TODO(after): if we abort a prerender because of an error in an after-callback
// we should probably communicate that better (and not log the error twice)
await afterRunner.executeAfter()

const revalidate =
typeof (context.renderOpts as any).collectedRevalidate === 'undefined' ||
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/after/after-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class AfterContext {
await callback()
} catch (err) {
// TODO(after): this is fine for now, but will need better intergration with our error reporting.
// TODO: should we log this if we have a onTaskError callback?
// TODO(after): should we log this if we have a onTaskError callback?
console.error(
'An error occurred in a function passed to `unstable_after()`:',
err
Expand Down

0 comments on commit 5464098

Please sign in to comment.