feat: restore React Native DevTools connections#58
Open
V3RON wants to merge 8 commits into
Open
Conversation
Restore the legacy DevTools socket connection removed in React Native 0.87 while preserving older runtimes' built-in connection.
Compose the native bootstrap after Metro's existing pre-main modules and publish both CommonJS and ESM entry points for React Native projects.
Explain the manual Metro and entry setup required for React Native 0.87+, and cover the built conditional exports with a lightweight package smoke test.
Document the required Metro wrapper and entry import, align the Expo example, and add a minor release note.
Pin React Native setup guidance and the Expo fixture to the DevTools core range used by React Native 0.87.
Rely on React Native's bundled react-devtools-core instead of asking users to install and version it separately.
Present the Metro integration as the standard React Native setup and keep version history in one compatibility note.
Configure supported React Native and Expo projects with reversible Metro and entry-graph edits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This PR restores
agent-react-devtoolsconnectivity for React Native after React Native removed the legacy standalone React DevTools auto-connect path. It adds an explicit Metro/client integration, updatesinitguidance, and documents the current setup for bare React Native and Expo projects.How does it work?
Projects install
agent-react-devtools, wrap their final Metro config withwithAgentReactDevTools, and importagent-react-devtools/react-nativefrom the application entry graph. Metro schedules the bootstrap after React Native initialization and before the app entry. On the client, the bootstrap runs only in development on supported native React Native versions, uses React Native's existingreact-devtools-coredependency, derives the Metro host, tracksAppState, and connects to the daemon. Conditional exports keep web and non-React-Native consumers on a no-op module.Why is this useful?
React Native users can keep using the agent CLI for component inspection and profiling without relying on the removed auto-connect implementation or installing React Native's internal DevTools dependency separately. The explicit setup avoids production and web connections, composes with existing Metro wrappers, and provides concise migration and troubleshooting guidance.