Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

This is modeling Offscreen boundaries as the thing that unmounts a tree in the frontend. This will let us model this as a "hide" that preserves state instead in a follow up but not yet.

By doing it this way, we don't have to special case suspended Suspense boundaries, at least not for the modern versions that use Offscreen as the internal node. It's still special cased for the old React versions. Instead, this is handled by the Offscreen fiber getting hidden.

By giving this fiber an FilteredFiberInstance, we also have somewhere to store the children on (separately from the parent children set which can include other siblings too like the loading state).

One consequence is that Activity boundary content now disappears when they're hidden which is probably a good thing since otherwise it would be confusing and noisy when it's used to render multiple pages at once.

@sebmarkbage sebmarkbage requested review from eps1lon and hoxyq July 31, 2025 02:49
@meta-cla meta-cla bot added the CLA Signed label Jul 31, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jul 31, 2025
It'll fail the name check below anyway.
It's not skipped in other paths which leads to updates mismatching later.

This also keeps it as FilteredFiberInstance so that we can use it store state.
For the modern case we'll add special handling of Offscreen instead.
They're no longer just a single level of direct children of a virtual.
This includes filtered instances too.
This ensures that the dependency always gets added to something above if
it's filtered.
@sebmarkbage sebmarkbage force-pushed the devtoolsretainhidden branch from 0ccbcf0 to 0600976 Compare July 31, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants