docs/modern-inspector-details.md
The modern inspector is the Chrome DevTools–based debugging experience that ships with the latest versions of React Native. This experience now works end-to-end for React Native for Windows (RNW) applications, enabling parity with Android and iOS. The integration provides a unified way to inspect JavaScript execution, evaluate console expressions, profile CPU and memory usage, and visualize the component hierarchy for both the Paper and Composition UI stacks.
ReactHost; surfaces metadata, reload requests, pause overlays, and
implements the CDP-facing delegate (ReactInspectorHostTargetDelegate).ReactInspectorThread ensures CDP work is serialized away from
the UI and JS queues. (iOS and Andrtoid use UI thread.)DebuggerNotifications.h broadcasts pause/resume events so view
hosts can react (e.g., showing overlays or resuming when the debugger continues).ReactHost creates the HostTarget, exposes it through
ReactOptions::InspectorHostTarget, and implements reload/pause hooks. This is the jump-off point
for all inspector traffic. The inspector supported only if the UseDirectDebugger is true.DevSupportManager now spins up
ReactInspectorPackagerConnectionDelegate, allowing Metro to broker modern inspector connections
and reuse the existing websocket infrastructure.J shortcut launches the inspector for Windows apps, matching
upstream behavior.DebuggerUIIsland renders pause overlays, focus chrome, and selection adorners
whenever the runtime is paused.ReactRootView updates provide the same pause/selection affordances.HermesRuntimeTargetDelegate and HermesRuntimeAgentDelegate wrap the hermes-windows C debug API
so we can re-use upstream modern inspector code.RuntimeHolder/HermesRuntimeHolder surface a createRuntimeTargetDelegate hook that instantiates
delegates only when the inspector is enabled, and safely tears them down during reloads.ReactInspectorPackagerConnectionDelegate maps the Metro websocket APIs to the modern inspector
handshake.npx react-native start or yarn start).J to open the modern inspector URL in a browser.NetworkIOAgent is not wired up yet for Windows. The integration point
is the ReactInspectorHostTargetDelegate in
vnext/Microsoft.ReactNative/ReactHost/ReactHost.cpp; override loadNetworkResource there to
forward requests through a Windows HTTP helper (similar to GetJavaScriptFromServerAsync) and
stream results back via the provided NetworkRequestListener. Until this happens, the Network tab
in DevTools stays empty.