Skip to content

Move /message, /events and /reload into community-cli-plugin - #59663

Open
huntie wants to merge 1 commit into
pr59662from
pr59663
Open

huntie wants to merge 1 commit into
pr59662from
pr59663

Conversation

@huntie

@huntie huntie commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Context

Migration of the remaining core dev server endpoints from @react-native-community/cli-server-api into core (community-cli-plugin).

Core motivation: These endpoints are critical infra! Most notably the WS /message endpoint, which carries reload and Dev Menu commands from the terminal and other tools.

The intent is to later move most of these again into dev-middleware (shared by CLI and Expo). For now, this stack focuses on decoupling CLI as an initial migration. (I note also that fb-metro-cli probably can't accept moving all of these into dev-middleware just yet.)

This diff

Migrate the /message and /events WebSockets (used by apps, tools and the r and d keyboard commands) and the /reload route to core, and switch start to them.

Paired with react-native-community/cli#2877, which removes the CLI's copies.

Net changes

This is a non-breaking change when CLI and react-native are shipped in lockstep.

  • Relay a client reload or devMenu broadcast only when the client connects from this machine with the dev server's origin or none. The CLI relays any broadcast from any client.
  • Answer getpeers with each client's connection query.
  • Drop the socket stubs and the FIXME from loadCommunityMiddleware.

Changelog: [Internal]

Test Plan

yarn jest packages/community-cli-plugin/src/dev-server

✅ 51 tests pass. Flow and ESLint clean.

✅ RNTester's Metro with this stack: curl /reload answers OK and a client on /message receives the reload broadcast; /events accepts a connection.

✅ On RNTester on iPhone 18 Pro (iOS 27.0), a devMenu broadcast on /message (as the d key sends) opens the Dev Menu.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant