-
Notifications
You must be signed in to change notification settings - Fork 49.5k
[Flight] Ensure blocked debug info is handled properly #34524
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
Merged
unstubbable
merged 18 commits into
facebook:main
from
unstubbable:blocked-debug-info-dev-tools
Sep 25, 2025
Merged
[Flight] Ensure blocked debug info is handled properly #34524
unstubbable
merged 18 commits into
facebook:main
from
unstubbable:blocked-debug-info-dev-tools
Sep 25, 2025
Conversation
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
22694f0
to
2d54b9a
Compare
2d54b9a
to
253a081
Compare
sebmarkbage
reviewed
Sep 18, 2025
I think what you should do to unblock is go back to the strategy where you transfer debug info onto the referenced Lazy node. That is wrong but it's also wrong when we do that on elements since it mutates an element that might be used elsewhere too, so we should fix that independently. Perhaps by cloning but I have some other ideas for lazy too. |
d976077
to
b448f15
Compare
- We must not unset the debug chunk before all entries are resolved. - We must ensure that the "RSC Stream" IO debug info entry is pushed last, after all other entries were resolved.
This reverts commit dcff98c.
8c1deb8
to
a355a27
Compare
a355a27
to
74e3721
Compare
c22c38f
to
5ef8452
Compare
sebmarkbage
reviewed
Sep 24, 2025
sebmarkbage
reviewed
Sep 24, 2025
sebmarkbage
approved these changes
Sep 25, 2025
unstubbable
pushed a commit
to vercel/next.js
that referenced
this pull request
Sep 25, 2025
[diff facebook/react@e2332183...b0c1dc01](facebook/react@e233218...b0c1dc0) <details> <summary>React upstream changes</summary> - facebook/react#34601 - facebook/react#34552 - facebook/react#34524 - facebook/react#34587 - facebook/react#34589 - facebook/react#34585 - facebook/react#34586 </details>
EugeneChoi4
pushed a commit
to EugeneChoi4/react
that referenced
this pull request
Sep 29, 2025
This PR ensures that server components are reliably included in the DevTools component tree, even if debug info is received delayed, e.g. when using a debug channel. The fix consists of three parts: - We must not unset the debug chunk before all debug info entries are resolved. - We must ensure that the "RSC Stream" IO debug info entry is pushed last, after all other entries were resolved. - We need to transfer the debug info from blocked element chunks onto the lazy node and the element. Ideally, we wouldn't even create a lazy node for blocked elements that are at the root of the JSON payload, because that would basically wrap a lazy in a lazy. This optimization that ensures that everything around the blocked element can proceed is only needed for nested elements. However, we also need it for resolving deduped references in blocked root elements, unless we adapt that logic, which would be a bigger lift. When reloading the Flight fixture, the component tree is now displayed deterministically. Previously, it would sometimes omit synchronous server components. <img width="306" height="565" alt="complete" src="https://github.com/user-attachments/assets/db61aa10-1816-43e6-9903-0e585190cdf1" /> --------- Co-authored-by: Sebastian Markbage <sebastian@calyptus.eu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR ensures that server components are reliably included in the DevTools component tree, even if debug info is received delayed, e.g. when using a debug channel. The fix consists of three parts:
Ideally, we wouldn't even create a lazy node for blocked elements that are at the root of the JSON payload, because that would basically wrap a lazy in a lazy. This optimization that ensures that everything around the blocked element can proceed is only needed for nested elements. However, we also need it for resolving deduped references in blocked root elements, unless we adapt that logic, which would be a bigger lift.
When reloading the Flight fixture, the component tree is now displayed deterministically. Previously, it would sometimes omit synchronous server components.