Skip to content

Increase type coverage for ReactComponentInfo #5

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

Closed

Conversation

eps1lon
Copy link

@eps1lon eps1lon commented Jun 11, 2024

Targeting facebook#29823

sebmarkbage and others added 12 commits June 9, 2024 20:50
This lets us rethrow it in the conceptual place of the child.
Notably with DON'T use try/finally because if something throws we want
to observe what it was at the time we threw.

Now we can use this when we create the Throw Fiber to associate the
Server Components that were part of the parent stack before this error
threw.
If this is happening on the server where the FlightClient generates objects
that will then be consumed again by the Flight server, we need to strip the
task out before serializing it since it's not serializable but it can be
restored from stack + owner.
Whether that nearest parent is a Server Component or the nearest Fiber.
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.
It's just a blocked chunk that eagerly calls its listeners.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants