Skip to content
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

[dynamicIO] detect metadata boundaries in dev using server component stacks #71666

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions packages/next/src/lib/metadata/metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import type {
import { isNotFoundError } from '../../client/components/not-found'
import type { MetadataContext } from './types/resolvers'
import type { WorkStore } from '../../server/app-render/work-async-storage.external'
import {
METADATA_BOUNDARY_NAME,
VIEWPORT_BOUNDARY_NAME,
} from './metadata-constants'

// Use a promise to share the status of the metadata resolving,
// returning two components `MetadataTree` and `MetadataOutlet`
Expand Down Expand Up @@ -110,6 +114,7 @@ export function createMetadataComponents({
return null
}
}
Viewport.displayName = VIEWPORT_BOUNDARY_NAME

async function metadata() {
return getResolvedMetadata(
Expand Down Expand Up @@ -146,6 +151,7 @@ export function createMetadataComponents({
return null
}
}
Metadata.displayName = METADATA_BOUNDARY_NAME

async function getMetadataAndViewportReady(): Promise<void> {
await viewport()
Expand Down
2 changes: 2 additions & 0 deletions packages/next/src/server/app-render/create-component-tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { StaticGenBailoutError } from '../../client/components/static-generation
import type { LoadingModuleData } from '../../shared/lib/app-router-context.shared-runtime'
import type { Params } from '../request/params'
import { workUnitAsyncStorage } from './work-unit-async-storage.external'
import { OUTLET_BOUNDARY_NAME } from '../../lib/metadata/metadata-constants'

/**
* Use the provided loader tree to create the React Component tree.
Expand Down Expand Up @@ -736,3 +737,4 @@ async function MetadataOutlet({
}
return null
}
MetadataOutlet.displayName = OUTLET_BOUNDARY_NAME
Loading