Configure Flipper server open URL, plugin install, and activation - #24
Draft
sugarmanz wants to merge 1 commit into
Draft
Configure Flipper server open URL, plugin install, and activation#24sugarmanz wants to merge 1 commit into
sugarmanz wants to merge 1 commit into
Conversation
Give FlipperServerTransport control over three things that previously required a manual Flipper desktop app: a configurable browser-open URL (instead of always opening http://localhost:52342), installing the devtools plugin via Flipper's documented plugins-install-from-npm RPC (instead of requiring the repo's local justfile/Bazel tooling), and explicit enablePlugin/disablePlugin methods that send the init/deinit handshake Flipper's device SDK requires before it will relay plugin messages — something flipper-server never does on its own for a non-background plugin without a desktop UI attached.
Member
Author
|
/canary |
|
Canary version successfully sends the init message and works with dynex studio. |
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
Gives
FlipperServerTransportcontrol over three things that previously required a manual Flipper desktop app:open/urlconstructor options (env varsPLAYER_DEVTOOLS_FLIPPER_OPEN/PLAYER_DEVTOOLS_FLIPPER_URLin the CLI). Off by default; when enabled, opens a caller-supplied URL instead of always openinghttp://localhost:52342.flipper-serveritself is always launched with--open=falseand browser-opening is now driven by the transport.ensurePluginInstalled()uses Flipper's own documented plugin-management RPCs (plugins-get-installed-plugins,plugins-install-from-npm) — the same commands the desktop UI's "Install Plugin" button calls — instead of reaching into~/.flipper/installed-pluginsor shelling out to this repo's localjust install-flipper-clientrecipe.flipper-plugin-player-ui-devtoolsis already published to npm, so this works for any consumer of@player-devtools/mcp, not just repo checkouts.enablePlugin(clientId?)/disablePlugin(clientId?)send theinit/deinithandshake Flipper's device SDK requires before it will open a live plugin connection and relay messages. Nothing inflipper-serversends this automatically for a non-background, foreground-only plugin like ours without a full desktop Flipper app attached with the plugin's tab selected — these methods let a caller trigger the same handshake directly. An opt-inautoEnablePluginconstructor flag (used bybin/run) activates every connecting client automatically.The CLI (
player-devtools-mcp/bin/run) now callsensurePluginInstalled()and enables the plugin for connected/connecting clients on startup, so no manual Flipper UI interaction is required end-to-end.Test plan
bazel test //devtools/client/flipper:flipper_eslint //devtools/client/flipper:flipper_vitest //devtools/mcp:mcp_eslint //devtools/mcp:mcp_vitest— all passbazel build //devtools/mcp:mcp_ts_types_transitive_typecheck_test— passes across both packagesplayer-devtools-mcpwith a Player app instance connected as a device and no Flipper desktop UI running; confirmlist_players/get_player_statussucceed without any manual Flipper UI interactionPLAYER_DEVTOOLS_FLIPPER_OPEN=true PLAYER_DEVTOOLS_FLIPPER_URL=https://player-ui.tools:52342opens the custom URL instead oflocalhost:52342Release Notes
@player-devtools/mcpno longer requires any manual Flipper desktop app interaction to install or activate the Player UI Devtools plugin — the MCP server now installs the plugin (via Flipper's own plugin-management API) and activates it for connecting devices automatically on startup.FlipperServerTransportgainsopen/urloptions for controlling whether/where a browser UI opens (env varsPLAYER_DEVTOOLS_FLIPPER_OPEN/PLAYER_DEVTOOLS_FLIPPER_URLfor the CLI), and newensurePluginInstalled()/enablePlugin()/disablePlugin()methods for consumers embedding the transport directly.📦 Published PR as canary version:
0.14.3--canary.24.1132Try this version out locally by upgrading relevant packages to 0.14.3--canary.24.1132