Extract metadata resolution primitives (#97388)
## Summary The existing metadata resolver combines two responsibilities: walking the loader tree to collect and schedule route exports, and interpreting the metadata or viewport value produced by an individual route layer. Move the route-layer operations into metadata-resolution-primitives.ts. This includes wrapping generateMetadata and generateViewport, loading file-based metadata, merging values with their resolved parents, post-processing metadata, and producing SelectedMetadata for rendering. Keep resolve-metadata.ts responsible for the existing traversal and scheduling flow, importing the extracted operations back into the same call sites and preserving its existing exports. This creates a reusable boundary for other traversal strategies without introducing another resolution path. This is intended to be behavior preserving: traversal order, eager generator invocation, parent promise behavior, warnings, and rendered metadata and viewport tags are unchanged. ## Verification - pnpm build-all <!-- NEXT_JS_LLM -->
Showing
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment