-
Notifications
You must be signed in to change notification settings - Fork 29.6k
fix(84750): await metadata promises to ensure proper head placement #84976
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
Open
robbchar
wants to merge
9
commits into
vercel:canary
Choose a base branch
from
robbchar:fix/metadata-head-placement-issue-84750
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−97
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
56f09a2
fix(metadata): await metadata promises to ensure proper head placement
robbchar 1e900de
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar 778ed7d
test: update metadata-streaming tests to expect tags in head
robbchar e5a17db
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar e26a2b5
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar e96e637
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar 61c2e25
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar cb105c3
for this change I made further changes in metadata.tsx to await the m…
robbchar 705aef6
Merge branch 'canary' into fix/metadata-head-placement-issue-84750
robbchar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
serveStreamingMetadata
parameter is declared in the type signature but not destructured in the function parameters, causing an incomplete refactoring. This should be removed from the type signature since it's no longer used.View Details
📝 Patch Details
Analysis
Incomplete refactoring: unused serveStreamingMetadata parameter in createMetadataComponents
What fails: The
createMetadataComponents()
function hasserveStreamingMetadata: boolean
in its type signature but never destructures or uses it in the function body. This creates an inconsistency where callers must provide the parameter even though it's ignored at runtime.How to reproduce: Look at the function definition in
packages/next/src/lib/metadata/metadata.tsx
(lines 53-68):tree
,pathname
,parsedQuery
,metadataContext
,getDynamicParamFromSegment
,errorType
,workStore
serveStreamingMetadata: boolean
(NOT destructured)serveStreamingMetadata
app-render.tsx
(lines 498, 1257, 1378) provideserveStreamingMetadata
but it's silently ignoredResult: Parameter is silently ignored at runtime; incomplete refactoring where the parameter should have been removed from the type signature.
Expected: The type signature should only include parameters that are actually used. The
serveStreamingMetadata
parameter has been removed from the destructuring but was left in the type signature during a refactoring.Fix applied:
serveStreamingMetadata: boolean
from the type signature inpackages/next/src/lib/metadata/metadata.tsx
line 68serveStreamingMetadata
parameter from all three call sites inpackages/next/src/server/app-render/app-render.tsx
(lines 498, 1257, 1378)