feat: Export getDevServer function as public API #55063
Open
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.
Summary
Exports the
getDevServerfunction andDevServerInfotype from React Native's public API, making them available without deep imports.Motivation
Deep imports are deprecated in v0.80 and will be removed in v0.82. Library authors currently rely on internal imports to use
getDevServer:Use Cases
getDevServer()to establish WebSocket connections to the dev server for hot module replacementThe function is already used internally by React Native for:
symbolicateStackTrace.js- Error stack symbolicationloadBundleFromServer.js- Dynamic bundle loadingopenFileInEditor.js- Opening source files in editorChangelog:
[GENERAL] [ADDED] - Export
getDevServerfunction andDevServerInfotype from public APITest Plan
This is a straightforward export addition. The function already exists and is well-tested internally. Consumers can now import it directly: