Skip to content

Commit a7a7b19

Browse files
authored
[dynamicIO] detect metadata boundaries in dev using server component stacks (#71666)
Component stacks in dev are sourcemapped and currently there is a bug that prevents the right function name from showing up which interrupts our ability to detect incomplete metadata in dev
1 parent cfa003c commit a7a7b19

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/next/src/lib/metadata/metadata.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import type {
3333
import { isNotFoundError } from '../../client/components/not-found'
3434
import type { MetadataContext } from './types/resolvers'
3535
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
36+
import {
37+
METADATA_BOUNDARY_NAME,
38+
VIEWPORT_BOUNDARY_NAME,
39+
} from './metadata-constants'
3640

3741
// Use a promise to share the status of the metadata resolving,
3842
// returning two components `MetadataTree` and `MetadataOutlet`
@@ -110,6 +114,7 @@ export function createMetadataComponents({
110114
return null
111115
}
112116
}
117+
Viewport.displayName = VIEWPORT_BOUNDARY_NAME
113118

114119
async function metadata() {
115120
return getResolvedMetadata(
@@ -146,6 +151,7 @@ export function createMetadataComponents({
146151
return null
147152
}
148153
}
154+
Metadata.displayName = METADATA_BOUNDARY_NAME
149155

150156
async function getMetadataAndViewportReady(): Promise<void> {
151157
await viewport()

packages/next/src/server/app-render/create-component-tree.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { StaticGenBailoutError } from '../../client/components/static-generation
2121
import type { LoadingModuleData } from '../../shared/lib/app-router-context.shared-runtime'
2222
import type { Params } from '../request/params'
2323
import { workUnitAsyncStorage } from './work-unit-async-storage.external'
24+
import { OUTLET_BOUNDARY_NAME } from '../../lib/metadata/metadata-constants'
2425

2526
/**
2627
* Use the provided loader tree to create the React Component tree.
@@ -736,3 +737,4 @@ async function MetadataOutlet({
736737
}
737738
return null
738739
}
740+
MetadataOutlet.displayName = OUTLET_BOUNDARY_NAME

0 commit comments

Comments
 (0)