-
Notifications
You must be signed in to change notification settings - Fork 49.3k
[DevTools] Allow inspection before streaming has finished in Chrome #34360
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
[DevTools] Allow inspection before streaming has finished in Chrome #34360
Conversation
Comparing: ba6590d...591a55f Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
world: chrome.scripting.ExecutionWorld.ISOLATED, | ||
}, | ||
{ | ||
id: '@react-devtools/file-fetcher', | ||
js: ['build/fileFetcher.js'], | ||
matches: ['<all_urls>'], | ||
persistAcrossSessions: true, | ||
runAt: 'document_end', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file-fetcher
script is probably best to keep initialized at document_end
, no real need for it this early
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that keep symbolication in a suspended state while we're still streaming in content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but only as a last-resort option. The browser extension is using browser extensions API first to get resources from the page and only then falls back to the fetch call. To be fair, I am not even sure this still works, we are just relying that the resource is still cached somewhere in fetch
implementation.
Could you also please test navigation between multiple pages while having DevTools open, incl. bfcache entries? |
older chrome might also be an issue. pagereveal is fairly new so we treat inspecting while streaming as progressive enhancement.
445f6d6
to
591a55f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, thank you!
Apps streaming in server-rendered content will have hydrated content before the document is in an idle state. This means content may be interactive before
document_end
is reached orpageshow
events are fired. However, the React tree may already be interesting to inspect. Especially larger apps in development can easily take multiple seconds before everything has streamed in.React DevTools used to not display a Component tree before streaming had finished.
We need to start executing multiple things earlier to be able to inspect the React app as early as possible:
proxy.js
which sends setup instructions to the backend manager is now executed atdocument_start
(did the same to the file-fetcher for when you start inspecting elements before everything has streamed in)pagereveal
as well aspageshow
.pageshow
only fires when everything has loaded on initial load.pagereveal
is not implemented in Firefox just yet.Once Firefox implements
pagereveal
, you'll be able to inspect the tree before loading has finished.Test plan
soft navs, hard navs and backwards/forwards cache in Chrome and Firefox
Chrome manual testing
CleanShot.2025-09-04.at.11.33.09.mp4
Firefox manual testing
CleanShot.2025-09-04.at.11.27.17.mp4