Commit Graph

8 Commits

Author SHA1 Message Date
Moti Zilberman 111187f6a4 Document unstable_experiments.enableStandaloneFuseboxShell (#53482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53482

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D81127995

fbshipit-source-id: cad5720b41ce409e9db1972bea3844ff0e0724ce
2025-08-27 08:11:51 -07:00
Alex Hunt 6f421230c1 Drop appId from /open-debugger calls, disable matching for modern targets (#47120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47120

Fixes no-op behaviour of the "Open DevTools" Dev Menu item (bug on `main` introduced with D63329456).

This was caused by a change to the `description` field contents in our CDP `/json/list` response, when under Fusebox. In the `/open-debugger` call from the Dev Menu, we were still using the older `appId` param.

This did not affect `j` to debug, which uses the `target` param.

{F1937186832}

Changes:

In short: Matching against the `description` string is now fully eliminated for modern debugger targets.

- Update native Dev Menu implementation to omit `appId` parameter (`device` param alone is sufficient and fully precise on these platforms).
- Update `/open-debugger` implementation to ignore the `appId` parameter for modern targets, and document this in the `dev-middleware` README.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D64597581

fbshipit-source-id: 46f536e7d0a4ececab0d52f4c0704e8698466cd0
2024-10-18 11:02:51 -07:00
Alex Hunt 4dcd5f1065 Type serve-static and document /debugger-frontend (#40765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40765

Types based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/serve-static/index.d.ts.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D50084591

fbshipit-source-id: 92fd833d90dfc5acbd3be0476f1da34e5742a732
2023-10-10 09:37:41 -07:00
Alex Hunt 850e550422 Add serverBaseUrl option, set client-accessible URL value externally (#39456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39456

**Fixes new debugger launch flow on Android:**

D49158227 aimed to improve proxy-safe behaviour for remote dev servers by auto-detecting the appropriate server URL for clients using the `Host` header (etc) from the HTTP request. However, this approach broke the local case for Android emulators and externally connected devices since they would originate from a device-relative server hostname — e.g. `10.0.2.2` for the stock Android emulator.

https://pxl.cl/3mVmR

This commit reverts to an explicit approach where callers specify the base URL to the dev server that should be addressible from the development machine — now as a single `serverBaseUrl` option.

**Changes**

- Adds new `serverBaseUrl` option to `createDevMiddleware`, designed to be the base URL value for constructing dev server URLs returned in endpoints such as `/json/list`.
    - This changes little for the `localhost` case (now enabling `https://` URLs), but enables remote dev server setups to specify this cleanly.
- Updates call site in `community-cli-plugin`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D49276125

fbshipit-source-id: 2b6a8507073649832993971aa9d0870f54c9bd44
2023-09-15 13:11:04 -07:00
Moti Zilberman 34a7526e79 Remove host/port params, construct WebSocket URL from /json request (#39394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39394

* Constructs DevTools frontend WebSocket URLs with a client-accessible host, port and scheme derived from the initiating HTTP request (`/json` or `/open-debugger`), instead of from the static `host` and `port` parameters provided to `createDevMiddleware`. This results in more proxy-safe behaviour.
* Removes the now-unused `host` and `port` parameters from `createDevMiddleware`.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D49158227

fbshipit-source-id: ec61d98458e5d5afba4eb937b84ff65071495cc9
2023-09-12 04:57:58 -07:00
Alex Hunt 8a21f41782 Add contributing note to dev server packages (#39127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39127

Will be referenced in https://github.com/react-native-community/cli/pull/2055.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48603224

fbshipit-source-id: 0b31d765f912cf8efe4300f7490ccef3ac843a41
2023-08-23 08:10:09 -07:00
Alex Hunt c82cf64a22 Move metro-inspector-proxy into dev-middleware (#39045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39045

## Context

RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641

## Changes

- Relocates `metro-inspector-proxy` source from the Metro repo into the React Native repo as part of the `react-native/dev-middleware` package.
    - Drops the `runInspectorProxy` entry point.
- Attaches the Inspector Proxy to the `createDevMiddleware()` API as the new integration point for this functionality.
- Documents migrated endpoints + usage of `createDevMiddleware()` in README.

Changelog: [Internal]
Metro changelog: None (`metro-inspector-proxy` is now an internal component of `react-native`, covered in the [release notes for 0.78.1](https://github.com/facebook/metro/releases/tag/v0.78.1))

Reviewed By: motiz88, blakef

Differential Revision: D48066213

fbshipit-source-id: 3fbef5d881f6f451cb5955dcbbc362c53347437e
2023-08-18 01:38:10 -07:00
Alex Hunt a991ff3837 Create dev-middleware package (#38194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38194

## Context

RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641

## Changes

Inits the `react-native/dev-middleware` package. Contains an initial implementation of `/open-debugger`, migrated from https://github.com/react-native-community/cli/commit/2535dbe2346a390b2c5034acf0b348347fce0b73.

## Attribution

This implementation is greatly inspired by `expo/dev-server`: https://github.com/expo/expo/blob/1120c716f35cb28d88800e8f5d963d2b2ac94705/packages/%40expo/dev-server/src/JsInspector.ts#L18

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D46283818

fbshipit-source-id: 7b38ad2f6d7346366a7c599d16e289e04b7bd88d
2023-07-07 09:22:09 -07:00