Skip to content

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Sep 10, 2025

Stacked on #34661

The Screen (displayed as "Initial Paint") is the union of all Roots known to React DevTools.

When inspecting the Screen only the Roots of a single renderer implementation can be merged. We only merge "suspended by" for the Screen. Since only the Fiber renderer implements "suspended by", we only implement inspecting roots for that renderer.

Merging roots from different renderers implementations would require forking of the Frontend so that hydrating inspected data uses the right renderer implementation.

Highlighting a host instance uses the same shortcut: highlighting a Root highlights the Screen.

We could also introduce special methods if we want to allow inspection of Roots or Screens. Right now equating the two seems to make sense since you only inspect Roots in the Suspense tab.

The red pill on the bottom left is a separate React Root from a different bundle.

CleanShot.2025-09-29.at.16.08.20.mp4

@meta-cla meta-cla bot added the CLA Signed label Sep 10, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 10, 2025
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch 2 times, most recently from 93b4e45 to 13aec7d Compare September 10, 2025 10:12
@eps1lon eps1lon requested a review from sebmarkbage September 10, 2025 10:29
@eps1lon eps1lon marked this pull request as ready for review September 10, 2025 10:29
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch 2 times, most recently from 50b7026 to 4cd5bab Compare September 17, 2025 13:50
@eps1lon
Copy link
Collaborator Author

eps1lon commented Sep 18, 2025

We'll instead merge all roots into a virtual one for inspection and select that when clicking the background of the rects

@eps1lon eps1lon marked this pull request as draft September 18, 2025 16:18
@eps1lon eps1lon removed the request for review from sebmarkbage September 18, 2025 16:18
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch from 4cd5bab to 2b9fd99 Compare September 25, 2025 22:10
@eps1lon eps1lon changed the title [DevTools] Draw rect for React Root in Suspense tab [DevTools] Inspect the Screen when inspecting a Root Sep 25, 2025
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch 4 times, most recently from 43497d9 to 934f87b Compare September 30, 2025 18:19
@eps1lon eps1lon changed the title [DevTools] Inspect the Screen when inspecting a Root [DevTools] Inspect the Initial Pain when inspecting a Root Sep 30, 2025
@eps1lon eps1lon changed the title [DevTools] Inspect the Initial Pain when inspecting a Root [DevTools] Inspect the Initial Paint when inspecting a Root Sep 30, 2025
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch 2 times, most recently from e078537 to 504c5cd Compare September 30, 2025 21:05
@eps1lon eps1lon marked this pull request as ready for review September 30, 2025 21:05
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch from 504c5cd to 0d36a72 Compare September 30, 2025 21:08
@eps1lon eps1lon force-pushed the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch from cdf8df6 to 6aab95d Compare October 2, 2025 16:59
@eps1lon eps1lon merged commit 4a28227 into facebook:main Oct 2, 2025
240 of 241 checks passed
@eps1lon eps1lon deleted the sebbie/09-10-_devtools_draw_rect_for_react_root_in_suspense_tab branch October 2, 2025 17:18
sebmarkbage added a commit that referenced this pull request Oct 2, 2025
…efault (#34654)

Rebased on #34454.

Always include the root in the timeline even if it has no unique
suspenders, since even if it won't suspend, we have to be able to see
that and step to one step before the next boundary to see the first
boundary that does suspend in its fallback state.

Also, if there's no current selection on initial mount, select the last
entry in the timeline. We usually do this with `selectedSuspenseID` but
that doesn't happen on initial load. So this does it on initial load if
nothing else is selected by then. That way when you reload you get the
initial root selected.

There's a problem here because we should really use one source of truth
and `selectedSuspenseID` doesn't really do anything now. Either it
should be its separate source of truth and you can't show components in
the side-panel or it should be derived from the other state.

If it's derived, once there's a selection, e.g. in the root, then even
if new timelines load it will never change but that's probably a good
thing.
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