Skip to content

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Aug 15, 2025

Stacked on #34196

mountFiberRecursively bails out of hydrating dehydrated roots nowadays.
This makes the check in handleCommitFiberRoot redundant.

Mostly doing this because the check in handleCommitFiberRoot wasn't mirrored in the initial mount path.
handleCommitFiberRoot always attempted to mount dehydrated roots when it first encountered a HostRoot. But on updates, it treated a previously dehydrated HostRoot as newly mounted. This resulted in recording mounts twice which is not supported.

@meta-cla meta-cla bot added the CLA Signed label Aug 15, 2025
@eps1lon eps1lon changed the title [DevTools] Handle dehydrated Suspense boundaries [DevTools] Always attempt to mount dehydrated roots Aug 15, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Aug 15, 2025
case TREE_OPERATION_SET_SUBTREE_MODE: {
const id = operations[i + 1];
const mode = operations[i + 1];
const mode = operations[i + 2];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally thought I messed up operations parsing. Noticed this small mistakes in our debugging tools

@eps1lon eps1lon marked this pull request as ready for review August 15, 2025 17:55
@eps1lon eps1lon requested a review from sebmarkbage August 15, 2025 17:56
@eps1lon eps1lon force-pushed the sebbie/08-15-_devtools_always_attempt_to_mount_dehydrated_roots branch from c6df6bf to 14e4a54 Compare August 16, 2025 08:28
`mountFiberRecursively` bails out of hydrating dehydrated roots nowadays.
This makes the check in `handleCommitFiberRoot` redundant.

Mostly doing this because the check in `handleCommitFiberRoot`
wasn't mirrored in the initial mount path.
`handleCommitFiberRoot` always attempted to mount dehydrated
roots when it first encountered a HostRoot.
But on updates, it treated a previously dehydrated HostRoot
as newly mounted.
This resulted in recording mounts twice which is not supported.
@eps1lon eps1lon force-pushed the sebbie/08-15-_devtools_always_attempt_to_mount_dehydrated_roots branch from 14e4a54 to e41609d Compare August 16, 2025 08:38
@eps1lon eps1lon merged commit 546bac7 into facebook:main Aug 16, 2025
241 checks passed
@eps1lon eps1lon deleted the sebbie/08-15-_devtools_always_attempt_to_mount_dehydrated_roots branch August 16, 2025 09:25
github-actions bot pushed a commit to code/lib-react that referenced this pull request Aug 17, 2025
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