Skip to content

Support Fusebox shell experiment in OSS without a custom BrowserLauncher#53435

Closed
motiz88 wants to merge 5 commits into
facebook:mainfrom
motiz88:export-D78351937
Closed

Support Fusebox shell experiment in OSS without a custom BrowserLauncher#53435
motiz88 wants to merge 5 commits into
facebook:mainfrom
motiz88:export-D78351937

Conversation

@motiz88
Copy link
Copy Markdown
Contributor

@motiz88 motiz88 commented Aug 22, 2025

Summary:
Changelog: [Internal] Support setting enableStandaloneFuseboxShell: true in OSS with no custom BrowserLauncher

Makes it possible for frameworks to enable the React Native DevTools standalone shell in open source by passing unstable_experiments: {enableStandaloneFuseboxShell: true} to createDevMiddleware().

When this experiment is enabled:

  • The RNDT shell binary will be prefetched in the background as soon as the dev server starts (into a local cache managed by DotSlash).
  • If prefetching is successful, then "Open DevTools" actions will be handled by launching the RNDT frontend in the standalone shell, instead of in Chrome/Edge.
  • If prefetching is not successful, then we'll notify the user about the error, and "Open DevTools" will continue to be handled by Chrome/Edge, as before.
  • If the user attempts to open DevTools more than once for the same app, the standalone shell will reuse the existing window (as opposed to the current behaviour of always creating a new Chrome/Edge window).
  • The appropriate DevTools window will automatically foreground itself upon pausing on a breakpoint.

Differential Revision: D78351937

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 22, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…ebook#53436)

Summary:
Pull Request resolved: facebook#53436

Changelog: [Internal]

Adds a `flavor` option to `unstable_spawnDebuggerShellWithArgs` to select between two modes:

1. `flavor: 'dev'` (current behaviour) - launching a stock Electron binary (from the `electron` package) and pointing it directly at the shell code from the `src/electron` directory.
2. `flavor: 'prebuilt'` (new in this diff) - launching the prebuilt React Native DevTools binary included in the package (built continuously at Meta and committed as a DotSlash file in automated diffs e.g. D79836825). Note that this binary includes Electron *and* a frozen version of the shell code from `src/electron`.

Going forward, `'dev'` will only be used when developing the package (e.g. in D78351934 we will move `electron` to `devDependencies`). The published version of the package is only intended to work with `flavor: 'prebuilt'`.

Differential Revision: D78351931

Reviewed By: huntie
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

motiz88 and others added 3 commits August 26, 2025 08:24
…k#53434)

Summary:
Pull Request resolved: facebook#53434

Changelog: [Internal]

The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff gives integrations a mechanism for kicking off the download early (but without slowing down `npm install react-native`). This will be integrated into dev-middleware in an upcoming diff.

Differential Revision: D78413091

Reviewed By: huntie
…3437)

Summary:
Pull Request resolved: facebook#53437

Changelog: [Internal]

The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff adds support in dev-middleware for a new `BrowserLauncher.unstable_prepareFuseboxShell` method that integrations can use to kick off the download early. Integrations are expected to implement this by calling the `unstable_prepareDebuggerShell` function (added to the `debugger-shell` package in D78413091).

If `BrowserLauncher.unstable_prepareFuseboxShell` returns an error, dev-middleware will fall back to the browser-based launch flow, even for users opted into the `enableStandaloneFuseboxShell` experiment.

Differential Revision: D78413092

Reviewed By: huntie
Summary:
Pull Request resolved: facebook#53438

Changelog: [Internal]

Makes `flavor: 'prebuilt'` the default mode of launching the RNDT standalone shell, and the *only* mode supported in the published version of the package. See D78351931 for more context.

With this, we can demote `electron` from `dependencies` to `devDependencies`. This makes it possible to make `debugger-shell` a dependency of `dev-middleware` (and thus of all major frameworks) without significantly impacting `npm install` times. We'll add this dependency on `debugger-shell` in an upcoming diff (D78351937).

We also stop publishing the `dist/electron` subdirectory (and `src/electron` for good measure) since the corresponding code will always be bundled into the prebuilt binary instead.

Differential Revision: D78351934

Reviewed By: huntie
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…her (facebook#53435)

Summary:
Pull Request resolved: facebook#53435

Changelog: [Internal] Support setting `enableStandaloneFuseboxShell: true` in OSS with no custom `BrowserLauncher`

Makes it possible for frameworks to enable the React Native DevTools standalone shell in open source by passing `unstable_experiments: {enableStandaloneFuseboxShell: true}` to `createDevMiddleware()`.

When this experiment is enabled:

* The RNDT shell binary will be prefetched in the background as soon as the dev server starts (into a local cache managed by [DotSlash](https://dotslash-cli.com/)).
* If prefetching is successful, then "Open DevTools" actions will be handled by launching the RNDT frontend in the standalone shell, instead of in Chrome/Edge.
* If prefetching is not successful, then we'll notify the user about the error, and "Open DevTools" will continue to be handled by Chrome/Edge, as before.
* If the user attempts to open DevTools more than once for the same app, the standalone shell will reuse the existing window (as opposed to the current behaviour of always creating a new Chrome/Edge window).
* The appropriate DevTools window will automatically foreground itself upon pausing on a breakpoint.

Reviewed By: huntie

Differential Revision: D78351937
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

motiz88 added a commit to motiz88/react-native that referenced this pull request Aug 27, 2025
…her (facebook#53435)

Summary:
Pull Request resolved: facebook#53435

Changelog: [Internal] Support setting `enableStandaloneFuseboxShell: true` in OSS with no custom `BrowserLauncher`

Makes it possible for frameworks to enable the React Native DevTools standalone shell in open source by passing `unstable_experiments: {enableStandaloneFuseboxShell: true}` to `createDevMiddleware()`.

When this experiment is enabled:

* The RNDT shell binary will be prefetched in the background as soon as the dev server starts (into a local cache managed by [DotSlash](https://dotslash-cli.com/)).
* If prefetching is successful, then "Open DevTools" actions will be handled by launching the RNDT frontend in the standalone shell, instead of in Chrome/Edge.
* If prefetching is not successful, then we'll notify the user about the error, and "Open DevTools" will continue to be handled by Chrome/Edge, as before.
* If the user attempts to open DevTools more than once for the same app, the standalone shell will reuse the existing window (as opposed to the current behaviour of always creating a new Chrome/Edge window).
* The appropriate DevTools window will automatically foreground itself upon pausing on a breakpoint.

Differential Revision: D78351937

Reviewed By: huntie
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 27, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in ab1af28.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @motiz88 in ab1af28

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

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants