@react-native/dev-middleware 0.77.0-nightly-20241018-398512a4e → 0.77.0-nightly-20241020-e7a3f479f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -64,12 +64,16 @@ Subpaths of this endpoint are reserved to serve the JavaScript debugger frontend
64
64
 
65
65
  #### POST `/open-debugger`
66
66
 
67
- Open the JavaScript debugger for a given CDP target (direct Hermes debugging).
67
+ Open the JavaScript debugger for a given CDP target. Must be provided with one of the following query params:
68
+
69
+ - `device`‌ — An ID unique to a combination of device and app, stable across installs. Implemented by `getInspectorDeviceId` on each native platform.
70
+ - `target` — The target page ID as returned by `/json/list` for the current dev server session.
71
+ - `appId` (deprecated, legacy only) — The application bundle identifier to match (non-unique across multiple connected devices). This param will only match legacy Hermes debugger targets.
68
72
 
69
73
  <details>
70
74
  <summary>Example</summary>
71
75
 
72
- curl -X POST 'http://localhost:8081/open-debugger?appId=com.meta.RNTester'
76
+ curl -X POST 'http://localhost:8081/open-debugger?target=<targetId>'
73
77
  </details>
74
78
 
75
79
  ### WebSocket endpoints
@@ -18,9 +18,10 @@ export type TargetCapabilityFlags = Readonly<{
18
18
  * The target supports a stable page representation across reloads.
19
19
  *
20
20
  * In the proxy, this disables legacy page reload emulation and the
21
- * additional '(Experimental)' target in `/json/list`.
21
+ * additional 'React Native Experimental' target in `/json/list`.
22
22
  *
23
- * In the launch flow, this allows targets to be matched directly by `appId`.
23
+ * In the launch flow, this allows targets to be matched directly by
24
+ * `logicalDeviceId`.
24
25
  */
25
26
  nativePageReloads?: boolean;
26
27
  /**
@@ -18,9 +18,10 @@ export type TargetCapabilityFlags = $ReadOnly<{
18
18
  * The target supports a stable page representation across reloads.
19
19
  *
20
20
  * In the proxy, this disables legacy page reload emulation and the
21
- * additional '(Experimental)' target in `/json/list`.
21
+ * additional 'React Native Experimental' target in `/json/list`.
22
22
  *
23
- * In the launch flow, this allows targets to be matched directly by `appId`.
23
+ * In the launch flow, this allows targets to be matched directly by
24
+ * `logicalDeviceId`.
24
25
  */
25
26
  nativePageReloads?: boolean,
26
27
 
@@ -26,8 +26,8 @@ type Options = Readonly<{
26
26
  /**
27
27
  * Open the debugger frontend for a given CDP target.
28
28
  *
29
- * Currently supports Hermes targets, opening debugger websocket URL in Chrome
30
- * DevTools.
29
+ * Currently supports React Native DevTools (rn_fusebox.html) and legacy Hermes
30
+ * (rn_inspector.html) targets.
31
31
  *
32
32
  * @see https://chromedevtools.github.io/devtools-protocol/
33
33
  */
@@ -11,6 +11,8 @@ var _url = _interopRequireDefault(require("url"));
11
11
  function _interopRequireDefault(e) {
12
12
  return e && e.__esModule ? e : { default: e };
13
13
  }
14
+ const LEGACY_SYNTHETIC_PAGE_TITLE =
15
+ "React Native Experimental (Improved Chrome Reloads)";
14
16
  function openDebuggerMiddleware({
15
17
  serverBaseUrl,
16
18
  logger,
@@ -30,8 +32,7 @@ function openDebuggerMiddleware({
30
32
  .getPageDescriptions()
31
33
  .filter(
32
34
  (app) =>
33
- app.title ===
34
- "React Native Experimental (Improved Chrome Reloads)" ||
35
+ app.title === LEGACY_SYNTHETIC_PAGE_TITLE ||
35
36
  app.reactNative.capabilities?.nativePageReloads === true
36
37
  );
37
38
  let target;
@@ -48,7 +49,9 @@ function openDebuggerMiddleware({
48
49
  target = targets.find(
49
50
  (_target) =>
50
51
  (targetId == null || _target.id === targetId) &&
51
- (appId == null || _target.appId === appId) &&
52
+ (appId == null ||
53
+ (_target.appId === appId &&
54
+ _target.title === LEGACY_SYNTHETIC_PAGE_TITLE)) &&
52
55
  (device == null || _target.reactNative.logicalDeviceId === device)
53
56
  );
54
57
  } else if (targets.length > 0) {
@@ -27,8 +27,8 @@ type Options = $ReadOnly<{
27
27
  /**
28
28
  * Open the debugger frontend for a given CDP target.
29
29
  *
30
- * Currently supports Hermes targets, opening debugger websocket URL in Chrome
31
- * DevTools.
30
+ * Currently supports React Native DevTools (rn_fusebox.html) and legacy Hermes
31
+ * (rn_inspector.html) targets.
32
32
  *
33
33
  * @see https://chromedevtools.github.io/devtools-protocol/
34
34
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/dev-middleware",
3
- "version": "0.77.0-nightly-20241018-398512a4e",
3
+ "version": "0.77.0-nightly-20241020-e7a3f479f",
4
4
  "description": "Dev server middleware for React Native",
5
5
  "keywords": [
6
6
  "react-native",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@isaacs/ttlcache": "^1.4.1",
26
- "@react-native/debugger-frontend": "0.77.0-nightly-20241018-398512a4e",
26
+ "@react-native/debugger-frontend": "0.77.0-nightly-20241020-e7a3f479f",
27
27
  "chrome-launcher": "^0.15.2",
28
28
  "chromium-edge-launcher": "^0.2.0",
29
29
  "connect": "^3.6.5",