@react-native/dev-middleware 0.85.0-nightly-20260123-355b1cb30 → 0.85.0-nightly-20260125-490c5e8dc

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.
@@ -101,20 +101,20 @@ interface Message {
101
101
 
102
102
  #### Proxy → Device Messages
103
103
 
104
- | Event | Payload | Description |
105
- | -------------- | ------------------------------------------ | --------------------------------------------- |
106
- | `getPages` | _(none)_ | Request current page list. Sent periodically. |
107
- | `connect` | `{ pageId: string }` | Prepare for debugger connection to page. |
108
- | `disconnect` | `{ pageId: string }` | Terminate debugger session for page. |
109
- | `wrappedEvent` | `{ pageId: string, wrappedEvent: string }` | Forward CDP message (JSON string) to page. |
104
+ | Event | Payload | Description |
105
+ | -------------- | ------------------------------------------------------------- | --------------------------------------------- |
106
+ | `getPages` | _(none)_ | Request current page list. Sent periodically. |
107
+ | `connect` | `{ pageId: string, sessionId: string }` | Prepare for debugger connection to page. |
108
+ | `disconnect` | `{ pageId: string, sessionId: string }` | Terminate debugger session for page. |
109
+ | `wrappedEvent` | `{ pageId: string, sessionId: string, wrappedEvent: string }` | Forward CDP message (JSON string) to page. |
110
110
 
111
111
  #### Device → Proxy Messages
112
112
 
113
- | Event | Payload | Description |
114
- | -------------- | ------------------------------------------ | ----------------------------------------------------- |
115
- | `getPages` | `Page[]` | Current list of inspectable pages. |
116
- | `disconnect` | `{ pageId: string }` | Notify that page disconnected or rejected connection. |
117
- | `wrappedEvent` | `{ pageId: string, wrappedEvent: string }` | Forward CDP message (JSON string) from page. |
113
+ | Event | Payload | Description |
114
+ | -------------- | -------------------------------------------------------------- | ----------------------------------------------------- |
115
+ | `getPages` | `Page[]` | Current list of inspectable pages. |
116
+ | `disconnect` | `{ pageId: string, sessionId?: string }` | Notify that page disconnected or rejected connection. |
117
+ | `wrappedEvent` | `{ pageId: string, sessionId?: string, wrappedEvent: string }` | Forward CDP message (JSON string) from page. |
118
118
 
119
119
  #### Page Object
120
120
 
@@ -128,10 +128,14 @@ interface Page {
128
128
  nativePageReloads?: boolean; // Target keeps the socket open across reloads
129
129
  nativeSourceCodeFetching?: boolean; // Target supports Network.loadNetworkResource
130
130
  prefersFuseboxFrontend?: boolean; // Target is designed for React Native DevTools
131
+ supportsMultipleDebuggers?: boolean; // Supports concurrent debugger sessions
131
132
  };
132
133
  }
133
134
  ```
134
135
 
136
+ **Note**: The value of `supportsMultipleDebuggers` SHOULD be consistent across
137
+ all pages for a given device.
138
+
135
139
  ### Connection Lifecycle
136
140
 
137
141
  **Device Registration:**
@@ -155,16 +159,18 @@ Debugger Proxy Device
155
159
  │ │ │
156
160
  │── WS Connect ───▶│ │
157
161
  │ ?device&page │── connect ────────────────▶│
158
- │ │ {pageId} │
162
+ │ │ {pageId, sessionId} │
159
163
  │ │ │
160
164
  │── CDP Request ──▶│── wrappedEvent ───────────▶│
161
- │ │ {pageId, wrappedEvent} │
165
+ │ │ {pageId, sessionId, │
166
+ │ │ wrappedEvent} │
162
167
  │ │ │
163
168
  │ │◀── wrappedEvent ───────────│
164
- │◀── CDP Response ─│ {pageId, wrappedEvent} │
169
+ │◀── CDP Response ─│ {pageId, sessionId, │
170
+ │ │ wrappedEvent} │
165
171
  │ │ │
166
172
  │── WS Close ─────▶│── disconnect ─────────────▶│
167
- │ │ {pageId} │
173
+ │ │ {pageId, sessionId} │
168
174
  ```
169
175
 
170
176
  **Connection Rejection:**
@@ -174,12 +180,34 @@ a `disconnect` back to the proxy for that `pageId`.
174
180
 
175
181
  ### Connection Semantics
176
182
 
177
- 1. **One Debugger Per Page**: New debugger connections to an already-connected
178
- page disconnect the existing debugger.
183
+ #### Multi-Debugger Support
184
+
185
+ Multiple debuggers can connect simultaneously to the same page when **both** the
186
+ proxy and device support session multiplexing:
187
+
188
+ 1. **Session IDs**: The proxy assigns a unique, non-empty `sessionId` to each
189
+ debugger connection. All messages include this `sessionId` for routing. This
190
+ SHOULD be a UUID or other suitably unique and ephemeral identifier.
191
+
192
+ 2. **Capability Detection**: Devices report `supportsMultipleDebuggers: true` in
193
+ their page capabilities to indicate session support.
194
+
195
+ 3. **Backwards Compatibility**: Legacy devices ignore `sessionId` fields in
196
+ incoming messages and don't include them in responses.
197
+
198
+ #### Connection Rules
199
+
200
+ 1. **Session-Capable Device**: Multiple debuggers can connect to the same page
201
+ simultaneously. Each connection has an independent session.
202
+
203
+ 2. **Legacy Device (no `supportsMultipleDebuggers`)**: New debugger connections
204
+ to an already-connected page disconnect the existing debugger. The proxy MUST
205
+ NOT allow multiple debuggers to connect to the same page.
179
206
 
180
- 2. **Device Reconnection**: If a device reconnects with the same `device` ID,
207
+ 3. **Device Reconnection**: If a device reconnects with the same `device` ID
208
+ while debugger connections to the same logical device are open in the proxy,
181
209
  the proxy may attempt to preserve active debugger sessions by forwarding them
182
- to the new device connection.
210
+ to the new device.
183
211
 
184
212
  ### WebSocket Close Reasons
185
213
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/dev-middleware",
3
- "version": "0.85.0-nightly-20260123-355b1cb30",
3
+ "version": "0.85.0-nightly-20260125-490c5e8dc",
4
4
  "description": "Dev server middleware for React Native",
5
5
  "keywords": [
6
6
  "react-native",
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@isaacs/ttlcache": "^1.4.1",
29
- "@react-native/debugger-frontend": "0.85.0-nightly-20260123-355b1cb30",
30
- "@react-native/debugger-shell": "0.85.0-nightly-20260123-355b1cb30",
29
+ "@react-native/debugger-frontend": "0.85.0-nightly-20260125-490c5e8dc",
30
+ "@react-native/debugger-shell": "0.85.0-nightly-20260125-490c5e8dc",
31
31
  "chrome-launcher": "^0.15.2",
32
32
  "chromium-edge-launcher": "^0.3.0",
33
33
  "connect": "^3.6.5",
@@ -39,7 +39,7 @@
39
39
  "ws": "^7.5.10"
40
40
  },
41
41
  "devDependencies": {
42
- "@react-native/debugger-shell": "0.85.0-nightly-20260123-355b1cb30",
42
+ "@react-native/debugger-shell": "0.85.0-nightly-20260125-490c5e8dc",
43
43
  "selfsigned": "^4.0.0",
44
44
  "undici": "^5.29.0",
45
45
  "wait-for-expect": "^3.0.2"