-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[Flight] Let Errored/Blocked Direct References Turn Nearest Element Lazy #29823
Merged
Commits on Jun 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f75182a - Browse repository at this point
Copy the full SHA f75182aView commit details -
Handle blocked or errored handling at a React Element boundary
While JSON.parse doesn't let us inspect the begin/complete phase to push/po we can rely on the REACT_ELEMENT_TYPE marker being a leaf that's in the beginning of the element as the begin an the element itself is the complete phase. This lets us more deeply handle suspense or errors in case there's an Error or Suspense boundary in the current model. The tricky bit is to keep in mind cycles and deep references that might now be broken apart.
Configuration menu - View commit details
-
Copy full SHA for 63de670 - Browse repository at this point
Copy the full SHA 63de670View commit details -
We don't need the cyclic concept anymore
It's just a blocked chunk that eagerly calls its listeners.
Configuration menu - View commit details
-
Copy full SHA for 73cdb99 - Browse repository at this point
Copy the full SHA 73cdb99View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b24920 - Browse repository at this point
Copy the full SHA 1b24920View commit details -
Encode Errors during serialization as Lazy at the Nearest Element
We feel comfortable turning any Element into Lazy since it serializes as Node. So if any error happens inside of the deserialization such as if a direct reference errored or a client reference failed to load we can scope it to that element. That way if any Error boundaries were on the stack inside the same model, they can handle the error. This also gives us better debug info for things like serialization errors because they now can get a stack trace pointing to the exact JSX.
Configuration menu - View commit details
-
Copy full SHA for 55e76c4 - Browse repository at this point
Copy the full SHA 55e76c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89bf5f9 - Browse repository at this point
Copy the full SHA 89bf5f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for b452d4d - Browse repository at this point
Copy the full SHA b452d4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d3d388 - Browse repository at this point
Copy the full SHA 7d3d388View commit details -
Configuration menu - View commit details
-
Copy full SHA for 977c078 - Browse repository at this point
Copy the full SHA 977c078View commit details
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.