Modularize the devtools client packages#17
Merged
Merged
Conversation
Split @player-devtools/client into two packages so headless consumers (the MCP server) never load React: - core → @player-devtools/client: headless createExtensionClient + state reducer. No React deps. - react → @player-devtools/client-react: the React Panel + hooks. Consumers repointed: flipper-plugin uses client-react; MCP uses the headless client core, decoupling it from the UI barrel. Also: - Fix MCP transport for Node < 22: provide a `ws` WebSocket to reconnecting-websocket via a guarded globalThis polyfill (it has no global WebSocket, so npx-run MCP failed to connect). ws deps live in the BUILD only, per repo convention. - Keep INITIAL_FLOW (a UI placeholder) in the Panel, not exported from core; move @player-ui/player to core test_deps since only the reducer test uses it now.
Move FlipperServerTransport out of the MCP module so it can be reused by other client contexts (e.g. an Electron app): - New package @player-devtools/client-flipper (devtools/client/flipper) holds FlipperServerTransport (moved from devtools/mcp/src/transport.ts), including the Node <22 `ws` WebSocket polyfill. - The Transport interface (CommunicationLayerMethods + connect/close) moves to @player-devtools/types as the shared contract. MCPServer now depends only on that interface, not on the concrete transport. - client-flipper is imported solely by devtools/mcp/bin/run, which composes it with MCPServer. Nothing in mcp/src references it. - mcp barrel exports only MCPServer; mcp sheds flipper-server, flipper-server-client, ws, and @types/ws (now client-flipper's).
Member
Author
|
/canary |
1 similar comment
Member
Author
|
/canary |
Canary pipeline #166 failed with the Bazel server killed mid-build (error code 14, 'Socket closed') — memory pressure on the runner while building the Android/toolchain targets. Bump the base executor from large to xlarge to give Bazel more headroom, and drop the pinned bazel-docker:9 tag to track the latest image.
Member
Author
|
/canary |
KetanReddy
approved these changes
Jul 21, 2026
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's changing
Restructures the devtools client into focused, single-purpose packages so consumers only pull in what they need — headless consumers no longer drag in React, and the MCP server no longer drags in the Flipper transport.
@player-devtools/clientis now headless:createExtensionClient+ state reducer, no React.@player-devtools/client-react(new) holds the ReactPanel+ hooks.@player-devtools/client-flipper(new) holdsFlipperServerTransport, reusable by any client context (e.g. an Electron app). TheTransportinterface moves to@player-devtools/types; the MCP server depends only on that interface and composes the concrete transport at its entry point.flipper-plugin→client-react; the MCP server → the headlessclientcore +client-flipper.Also fixes the MCP transport under Node < 22 (provides a
wsWebSocket, whichreconnecting-websocketotherwise resolves from a missing global), and bumps the CIbaseexecutor toxlargeto stop the Bazel server being OOM-killed during release.Change Type (required)
patchminormajorTests
bazel build/ typecheck / eslint / vitest pass acrossclient/core,client/react,client/flipper,mcp,types.bazel run //devtools/mcp:startboots end-to-end (transport fromclient-flipper, flipper-server ready, clients connect, plugins load).npx player-devtools-mcpboots and connects.Release Notes
The devtools client is now split into focused packages so you only install what you use:
@player-devtools/client— headless client (createExtensionClient, state reducer). No React dependency.@player-devtools/client-react— the ReactPaneland hooks. If you were importingPanelfrom@player-devtools/client, import it from@player-devtools/client-reactinstead:@player-devtools/client-flipper— the headlessFlipperServerTransport, for connecting to a Player over a runningflipper-serverfrom any Node client.