react-native icon indicating copy to clipboard operation
react-native copied to clipboard

dev-middleware: Scaffold standalone Fusebox shell experiment

Open motiz88 opened this issue 6 months ago • 1 comments

Summary: Changelog: [Internal]

Context

This is the first of several commits that aim to implement a standalone shell for React Native DevTools. This will be a lightweight desktop app designed to host the debugger frontend, in much the same way as we currently use Chrome or Edge. The launch flow will otherwise remain very similar to the one that exists today.

What's changing for users?

  1. With this commit, nothing; we're merely setting up an experiment flag (for stage 1 - Meta-internal testing) and will make separate plans for open source rollout, coordinated with our framework maintainer partners.
  2. If the experiment is successful, we aim to eventually phase out the use of Chrome/Edge in React Native DevTools and ship the standalone shell as standard to all React Native developers. This is to enable further improvements that will rely on the standalone shell to work.
  3. The first iteration of the standalone shell aims to solve some concrete pain points such as the "dead window problem" - the fact that opening DevTools multiple times for the same target will leave behind a now-dead window (that would ideally have been reused).

This diff

We amend the unstable_experiments and unstable_browserLauncher APIs in dev-middleware to add basic support for launching a standalone shell based on a frontend URL and a window key - the latter being an opaque string that the shell process can match against previous launches in order to reuse and foreground existing windows.

We leave it up to BrowserLauncher implementers ( = frameworks) to provide a working implementation of unstable_showFuseboxShell, and do not provide one with DefaultBrowserLauncher. This will effectively allow us to dependency-inject the actual shell implementation at stage 1 so we don't increase the download size of React Native unnecessarily.

Reviewed By: rickhanlonii, robhogan

Differential Revision: D74904547

motiz88 avatar May 29 '25 18:05 motiz88

This pull request was exported from Phabricator. Differential Revision: D74904547

facebook-github-bot avatar May 29 '25 18:05 facebook-github-bot

This pull request has been merged in facebook/react-native@55ff50fba50d969520fbc793d2f463f184e03daa.

facebook-github-bot avatar May 30 '25 09:05 facebook-github-bot

This pull request was successfully merged by @motiz88 in 55ff50fba50d969520fbc793d2f463f184e03daa

When will my fix make it into a release? | How to file a pick request?

react-native-bot avatar May 30 '25 09:05 react-native-bot