Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Feb 23, 2025
1 parent e8fc014 commit 14c0c2c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
12 changes: 5 additions & 7 deletions packages/next/src/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,20 +381,18 @@ async function exportAppImpl(
strictNextHead: nextConfig.experimental.strictNextHead ?? true,
deploymentId: nextConfig.deploymentId,
htmlLimitedBots: nextConfig.htmlLimitedBots.source,
streamingMetadata:
// Disable streaming metadata when dynamic IO is enabled.
// FIXME: remove dynamic IO guard once we fixed the dynamic indicator case.
// test/e2e/app-dir/dynamic-io/dynamic-io.test.ts - should not have static indicator on not-found route
!nextConfig.experimental.dynamicIO,
experimental: {
clientTraceMetadata: nextConfig.experimental.clientTraceMetadata,
expireTime: nextConfig.expireTime,
dynamicIO: nextConfig.experimental.dynamicIO ?? false,
clientSegmentCache: nextConfig.experimental.clientSegmentCache ?? false,
inlineCss: nextConfig.experimental.inlineCss ?? false,
authInterrupts: !!nextConfig.experimental.authInterrupts,
streamingMetadata:
// Disable streaming metadata when dynamic IO is enabled.
// FIXME: remove dynamic IO guard once we fixed the dynamic indicator case.
// test/e2e/app-dir/dynamic-io/dynamic-io.test.ts - should not have static indicator on not-found route
!nextConfig.experimental.dynamicIO &&
!!nextConfig.experimental.streamingMetadata,
htmlLimitedBots: nextConfig.experimental.htmlLimitedBots,
},
reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,
}
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/export/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface ExportPageInput {
nextConfigOutput?: NextConfigComplete['output']
enableExperimentalReact?: boolean
sriEnabled: boolean
streamingMetadata: boolean | undefined
}

export type ExportRouteResult =
Expand Down
3 changes: 1 addition & 2 deletions packages/next/src/export/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ export async function exportPages(
// Disable streaming metadata when dynamic IO is enabled.
// FIXME: remove dynamic IO guard once we fixed the dynamic indicator case.
// test/e2e/app-dir/dynamic-io/dynamic-io.test.ts - should not have static indicator on not-found route
!nextConfig.experimental.dynamicIO &&
!!nextConfig.experimental.streamingMetadata,
!nextConfig.experimental.dynamicIO,
}),
// If exporting the page takes longer than the timeout, reject the promise.
new Promise((_, reject) => {
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/server/app-render/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export interface RenderOptsPartial {
params?: ParsedUrlQuery
isPrefetch?: boolean
htmlLimitedBots: string | undefined
streamingMetadata: boolean
experimental: {
/**
* When true, it indicates that the current page supports partial
Expand Down
21 changes: 10 additions & 11 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,11 @@ export default abstract class Server<
isExperimentalCompile: this.nextConfig.experimental.isExperimentalCompile,
// `htmlLimitedBots` is passed to server as serialized config in string format
htmlLimitedBots: this.nextConfig.htmlLimitedBots,
streamingMetadata:
// Disable streaming metadata when dynamic IO is enabled.
// FIXME: remove dynamic IO guard once we fixed the dynamic indicator case.
// test/e2e/app-dir/dynamic-io/dynamic-io.test.ts - should not have static indicator on not-found route
!this.nextConfig.experimental.dynamicIO,
experimental: {
expireTime: this.nextConfig.expireTime,
clientTraceMetadata: this.nextConfig.experimental.clientTraceMetadata,
Expand All @@ -612,13 +617,6 @@ export default abstract class Server<
this.nextConfig.experimental.clientSegmentCache ?? false,
inlineCss: this.nextConfig.experimental.inlineCss ?? false,
authInterrupts: !!this.nextConfig.experimental.authInterrupts,
streamingMetadata:
// Disable streaming metadata when dynamic IO is enabled.
// FIXME: remove dynamic IO guard once we fixed the dynamic indicator case.
// test/e2e/app-dir/dynamic-io/dynamic-io.test.ts - should not have static indicator on not-found route
!this.nextConfig.experimental.dynamicIO &&
!!this.nextConfig.experimental.streamingMetadata,
htmlLimitedBots: this.nextConfig.experimental.htmlLimitedBots,
},
onInstrumentationRequestError:
this.instrumentationOnRequestError.bind(this),
Expand Down Expand Up @@ -1771,10 +1769,11 @@ export default abstract class Server<
...this.renderOpts,
supportsDynamicResponse: !isBotRequest,
botType: getBotType(ua),
serveStreamingMetadata: shouldServeStreamingMetadata(
ua,
this.renderOpts.htmlLimitedBots
),
serveStreamingMetadata: shouldServeStreamingMetadata(ua, {
dynamicIO: !!this.nextConfig.experimental.dynamicIO,
streamingMetadata: !!this.renderOpts.streamingMetadata,
htmlLimitedBots: this.nextConfig.htmlLimitedBots,
}),
},
}

Expand Down

0 comments on commit 14c0c2c

Please sign in to comment.