Skip to content

Commit 170f459

Browse files
authored
[metadata] clean up redudant options (#76712)
### What streaming meatdata is fully enabled now, we don't need to pass down an extra flag through render options
1 parent 129368c commit 170f459

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

packages/next/src/export/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ async function exportAppImpl(
387387
strictNextHead: nextConfig.experimental.strictNextHead ?? true,
388388
deploymentId: nextConfig.deploymentId,
389389
htmlLimitedBots: nextConfig.htmlLimitedBots.source,
390-
streamingMetadata: true,
391390
experimental: {
392391
clientTraceMetadata: nextConfig.experimental.clientTraceMetadata,
393392
expireTime: nextConfig.expireTime,

packages/next/src/export/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export interface ExportPageInput {
6262
nextConfigOutput?: NextConfigComplete['output']
6363
enableExperimentalReact?: boolean
6464
sriEnabled: boolean
65-
streamingMetadata: boolean | undefined
6665
}
6766

6867
export type ExportRouteResult =

packages/next/src/export/worker.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ async function exportPageImpl(
256256
// During the export phase in next build, if it's using PPR we can serve streaming metadata
257257
// when it's available. When we're building the PPR rendering result, we don't need to rely
258258
// on the user agent. The result can be determined to serve streaming on infrastructure level.
259-
const serveStreamingMetadata = Boolean(
260-
isRoutePPREnabled && input.streamingMetadata
261-
)
259+
const serveStreamingMetadata = !!isRoutePPREnabled
262260

263261
const renderOpts: WorkerRenderOpts = {
264262
...components,
@@ -425,7 +423,6 @@ export async function exportPages(
425423
enableExperimentalReact: needsExperimentalReact(nextConfig),
426424
sriEnabled: Boolean(nextConfig.experimental.sri?.algorithm),
427425
buildId: input.buildId,
428-
streamingMetadata: true,
429426
}),
430427
// If exporting the page takes longer than the timeout, reject the promise.
431428
new Promise((_, reject) => {

packages/next/src/server/app-render/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ export interface RenderOptsPartial {
204204
params?: ParsedUrlQuery
205205
isPrefetch?: boolean
206206
htmlLimitedBots: string | undefined
207-
streamingMetadata: boolean
208207
experimental: {
209208
/**
210209
* When true, it indicates that the current page supports partial

packages/next/src/server/base-server.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ export default abstract class Server<
600600
isExperimentalCompile: this.nextConfig.experimental.isExperimentalCompile,
601601
// `htmlLimitedBots` is passed to server as serialized config in string format
602602
htmlLimitedBots: this.nextConfig.htmlLimitedBots,
603-
streamingMetadata: true,
604603
experimental: {
605604
expireTime: this.nextConfig.expireTime,
606605
clientTraceMetadata: this.nextConfig.experimental.clientTraceMetadata,
@@ -1761,10 +1760,10 @@ export default abstract class Server<
17611760
...this.renderOpts,
17621761
supportsDynamicResponse: !isBotRequest,
17631762
botType: getBotType(ua),
1764-
serveStreamingMetadata: shouldServeStreamingMetadata(ua, {
1765-
streamingMetadata: !!this.renderOpts.streamingMetadata,
1766-
htmlLimitedBots: this.nextConfig.htmlLimitedBots,
1767-
}),
1763+
serveStreamingMetadata: shouldServeStreamingMetadata(
1764+
ua,
1765+
this.nextConfig.htmlLimitedBots
1766+
),
17681767
},
17691768
}
17701769

packages/next/src/server/lib/streaming-metadata.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,8 @@ import type { BaseNextRequest } from '../base-http'
66

77
export function shouldServeStreamingMetadata(
88
userAgent: string,
9-
{
10-
streamingMetadata,
11-
htmlLimitedBots,
12-
}: {
13-
streamingMetadata: boolean
14-
htmlLimitedBots: string | undefined
15-
}
9+
htmlLimitedBots: string | undefined
1610
): boolean {
17-
if (!streamingMetadata) {
18-
return false
19-
}
20-
2111
const blockingMetadataUARegex = new RegExp(
2212
htmlLimitedBots || HTML_LIMITED_BOT_UA_RE_STRING,
2313
'i'

0 commit comments

Comments
 (0)