Skip to content

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

Merged
huntie merged 1 commit into
mainfrom
pr59663
Nov 11, 2026
Merged

huntie merged 1 commit into
mainfrom
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.

Base automatically changed from pr59662 to main November 11, 2026 18:26
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 11, 2026
@huntie
huntie merged commit 4ff1019 into main Nov 11, 2026
87 of 88 checks passed
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 Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants