feat: Export getDevServer function as public API#55063
Open
natew wants to merge 1 commit intofacebook:mainfrom
Open
feat: Export getDevServer function as public API#55063natew wants to merge 1 commit intofacebook:mainfrom
natew wants to merge 1 commit intofacebook:mainfrom
Conversation
Member
|
Hey @natew! Gut reaction here is I don't think we want to expose these on the public It should be fine for your library to continue to use this subpath export for the forseeable future (note that these warnings will not propagate to consuming apps). We missed the 0.82 target as the community needed more time, and indeed we had extra APIs to solve, like the above plan. Please stay tuned 🙏🏻 |
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.
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: