Unverified Commit a7a7b19a authored by Josh Story's avatar Josh Story Committed by GitHub

[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
parent cfa003c7
...@@ -33,6 +33,10 @@ import type { ...@@ -33,6 +33,10 @@ import type {
import { isNotFoundError } from '../../client/components/not-found' import { isNotFoundError } from '../../client/components/not-found'
import type { MetadataContext } from './types/resolvers' import type { MetadataContext } from './types/resolvers'
import type { WorkStore } from '../../server/app-render/work-async-storage.external' 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, // Use a promise to share the status of the metadata resolving,
// returning two components `MetadataTree` and `MetadataOutlet` // returning two components `MetadataTree` and `MetadataOutlet`
...@@ -110,6 +114,7 @@ export function createMetadataComponents({ ...@@ -110,6 +114,7 @@ export function createMetadataComponents({
return null return null
} }
} }
Viewport.displayName = VIEWPORT_BOUNDARY_NAME
async function metadata() { async function metadata() {
return getResolvedMetadata( return getResolvedMetadata(
...@@ -146,6 +151,7 @@ export function createMetadataComponents({ ...@@ -146,6 +151,7 @@ export function createMetadataComponents({
return null return null
} }
} }
Metadata.displayName = METADATA_BOUNDARY_NAME
async function getMetadataAndViewportReady(): Promise<void> { async function getMetadataAndViewportReady(): Promise<void> {
await viewport() await viewport()
......
...@@ -21,6 +21,7 @@ import { StaticGenBailoutError } from '../../client/components/static-generation ...@@ -21,6 +21,7 @@ import { StaticGenBailoutError } from '../../client/components/static-generation
import type { LoadingModuleData } from '../../shared/lib/app-router-context.shared-runtime' import type { LoadingModuleData } from '../../shared/lib/app-router-context.shared-runtime'
import type { Params } from '../request/params' import type { Params } from '../request/params'
import { workUnitAsyncStorage } from './work-unit-async-storage.external' 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. * Use the provided loader tree to create the React Component tree.
...@@ -736,3 +737,4 @@ async function MetadataOutlet({ ...@@ -736,3 +737,4 @@ async function MetadataOutlet({
} }
return null return null
} }
MetadataOutlet.displayName = OUTLET_BOUNDARY_NAME
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment