@react-native/dev-middleware 0.84.0-rc.0 → 0.85.0-nightly-20260108-1236b6be4
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/dist/createDevMiddleware.js +0 -11
- package/dist/createDevMiddleware.js.flow +2 -2
- package/dist/inspector-proxy/CustomMessageHandler.js.flow +3 -3
- package/dist/inspector-proxy/Device.js +0 -9
- package/dist/inspector-proxy/Device.js.flow +2 -2
- package/dist/inspector-proxy/DeviceEventReporter.d.ts +0 -1
- package/dist/inspector-proxy/DeviceEventReporter.js +0 -5
- package/dist/inspector-proxy/DeviceEventReporter.js.flow +5 -6
- package/dist/inspector-proxy/types.js.flow +12 -12
- package/dist/middleware/openDebuggerMiddleware.js.flow +1 -1
- package/dist/types/EventReporter.d.ts +6 -7
- package/dist/types/EventReporter.js.flow +0 -3
- package/dist/types/Experiments.js.flow +1 -1
- package/dist/types/Logger.js.flow +1 -1
- package/dist/utils/getDevToolsFrontendUrl.js.flow +1 -1
- package/package.json +5 -5
|
@@ -93,17 +93,6 @@ function createWrappedEventReporter(reporter, logger, experiments) {
|
|
|
93
93
|
event.appId ?? "unknown",
|
|
94
94
|
);
|
|
95
95
|
break;
|
|
96
|
-
case "fusebox_console_notice":
|
|
97
|
-
logger?.info(
|
|
98
|
-
"\u001B[1m\u001B[7m💡 JavaScript logs have moved!\u001B[22m They can now be " +
|
|
99
|
-
"viewed in React Native DevTools. Tip: Type \u001B[1mj\u001B[22m in " +
|
|
100
|
-
"the terminal to open" +
|
|
101
|
-
(experiments.enableStandaloneFuseboxShell
|
|
102
|
-
? ""
|
|
103
|
-
: " (requires Google Chrome or Microsoft Edge)") +
|
|
104
|
-
".\u001B[27m",
|
|
105
|
-
);
|
|
106
|
-
break;
|
|
107
96
|
case "fusebox_shell_preparation_attempt":
|
|
108
97
|
switch (event.result.code) {
|
|
109
98
|
case "success":
|
|
@@ -15,7 +15,7 @@ import type { ExperimentsConfig } from "./types/Experiments";
|
|
|
15
15
|
import type { Logger } from "./types/Logger";
|
|
16
16
|
import type { NextHandleFunction } from "connect";
|
|
17
17
|
|
|
18
|
-
type Options =
|
|
18
|
+
type Options = Readonly<{
|
|
19
19
|
/**
|
|
20
20
|
* The base URL to the dev server, as reachable from the machine on which
|
|
21
21
|
* dev-middleware is hosted. Typically `http://localhost:${metroPort}`.
|
|
@@ -62,7 +62,7 @@ type Options = $ReadOnly<{
|
|
|
62
62
|
unstable_trackInspectorProxyEventLoopPerf?: boolean,
|
|
63
63
|
}>;
|
|
64
64
|
|
|
65
|
-
type DevMiddlewareAPI =
|
|
65
|
+
type DevMiddlewareAPI = Readonly<{
|
|
66
66
|
middleware: NextHandleFunction,
|
|
67
67
|
websocketEndpoints: { [path: string]: ws$WebSocketServer },
|
|
68
68
|
}>;
|
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
import type { JSONSerializable, Page } from "./types";
|
|
12
12
|
|
|
13
|
-
type ExposedDevice =
|
|
13
|
+
type ExposedDevice = Readonly<{
|
|
14
14
|
appId: string,
|
|
15
15
|
id: string,
|
|
16
16
|
name: string,
|
|
17
17
|
sendMessage: (message: JSONSerializable) => void,
|
|
18
18
|
}>;
|
|
19
19
|
|
|
20
|
-
type ExposedDebugger =
|
|
20
|
+
type ExposedDebugger = Readonly<{
|
|
21
21
|
userAgent: string | null,
|
|
22
22
|
sendMessage: (message: JSONSerializable) => void,
|
|
23
23
|
}>;
|
|
24
24
|
|
|
25
|
-
export type CustomMessageHandlerConnection =
|
|
25
|
+
export type CustomMessageHandlerConnection = Readonly<{
|
|
26
26
|
page: Page,
|
|
27
27
|
device: ExposedDevice,
|
|
28
28
|
debugger: ExposedDebugger,
|
|
@@ -27,7 +27,6 @@ const WS_CLOSE_REASON = (exports.WS_CLOSE_REASON = {
|
|
|
27
27
|
"[NEW_DEBUGGER_OPENED] New debugger opened for the same app instance",
|
|
28
28
|
});
|
|
29
29
|
const FILE_PREFIX = "file://";
|
|
30
|
-
let fuseboxConsoleNoticeLogged = false;
|
|
31
30
|
const REACT_NATIVE_RELOADABLE_PAGE_ID = "-1";
|
|
32
31
|
class Device {
|
|
33
32
|
#id;
|
|
@@ -375,7 +374,6 @@ class Device {
|
|
|
375
374
|
}
|
|
376
375
|
for (const page of this.#pages.values()) {
|
|
377
376
|
if (this.#pageHasCapability(page, "nativePageReloads")) {
|
|
378
|
-
this.#logFuseboxConsoleNotice();
|
|
379
377
|
continue;
|
|
380
378
|
}
|
|
381
379
|
if (page.title.includes("React")) {
|
|
@@ -799,12 +797,5 @@ class Device {
|
|
|
799
797
|
dangerouslyGetSocket() {
|
|
800
798
|
return this.#deviceSocket;
|
|
801
799
|
}
|
|
802
|
-
#logFuseboxConsoleNotice() {
|
|
803
|
-
if (fuseboxConsoleNoticeLogged) {
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
this.#deviceEventReporter?.logFuseboxConsoleNotice();
|
|
807
|
-
fuseboxConsoleNoticeLogged = true;
|
|
808
|
-
}
|
|
809
800
|
}
|
|
810
801
|
exports.default = Device;
|
|
@@ -23,7 +23,7 @@ declare export const WS_CLOSE_REASON: {
|
|
|
23
23
|
NEW_DEBUGGER_OPENED: "[NEW_DEBUGGER_OPENED] New debugger opened for the same app instance",
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export type DeviceOptions =
|
|
26
|
+
export type DeviceOptions = Readonly<{
|
|
27
27
|
id: string,
|
|
28
28
|
name: string,
|
|
29
29
|
app: string,
|
|
@@ -61,7 +61,7 @@ declare export default class Device {
|
|
|
61
61
|
handleDebuggerConnection(
|
|
62
62
|
socket: WS,
|
|
63
63
|
pageId: string,
|
|
64
|
-
$$PARAM_2$$:
|
|
64
|
+
$$PARAM_2$$: Readonly<{
|
|
65
65
|
debuggerRelativeBaseUrl: URL,
|
|
66
66
|
userAgent: string | null,
|
|
67
67
|
}>,
|
|
@@ -166,11 +166,6 @@ class DeviceEventReporter {
|
|
|
166
166
|
connectionUptime: this.#deviceConnectedTimestamp - Date.now(),
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
logFuseboxConsoleNotice() {
|
|
170
|
-
this.#eventReporter.logEvent({
|
|
171
|
-
type: "fusebox_console_notice",
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
169
|
#logExpiredCommand(pendingCommand) {
|
|
175
170
|
this.#eventReporter.logEvent({
|
|
176
171
|
type: "debugger_command",
|
|
@@ -12,19 +12,19 @@ import type { EventReporter } from "../types/EventReporter";
|
|
|
12
12
|
import type { CDPResponse } from "./cdp-types/messages";
|
|
13
13
|
import type { DeepReadOnly } from "./types";
|
|
14
14
|
|
|
15
|
-
type DeviceMetadata =
|
|
15
|
+
type DeviceMetadata = Readonly<{
|
|
16
16
|
appId: string,
|
|
17
17
|
deviceId: string,
|
|
18
18
|
deviceName: string,
|
|
19
19
|
}>;
|
|
20
20
|
|
|
21
|
-
type RequestMetadata =
|
|
21
|
+
type RequestMetadata = Readonly<{
|
|
22
22
|
pageId: string | null,
|
|
23
23
|
frontendUserAgent: string | null,
|
|
24
24
|
prefersFuseboxFrontend: boolean | null,
|
|
25
25
|
}>;
|
|
26
26
|
|
|
27
|
-
type ResponseMetadata =
|
|
27
|
+
type ResponseMetadata = Readonly<{
|
|
28
28
|
pageId: string | null,
|
|
29
29
|
frontendUserAgent: string | null,
|
|
30
30
|
prefersFuseboxFrontend: boolean | null,
|
|
@@ -33,7 +33,7 @@ type ResponseMetadata = $ReadOnly<{
|
|
|
33
33
|
declare class DeviceEventReporter {
|
|
34
34
|
constructor(eventReporter: EventReporter, metadata: DeviceMetadata): void;
|
|
35
35
|
logRequest(
|
|
36
|
-
req:
|
|
36
|
+
req: Readonly<{ id: number, method: string, ... }>,
|
|
37
37
|
origin: "debugger" | "proxy",
|
|
38
38
|
metadata: RequestMetadata,
|
|
39
39
|
): void;
|
|
@@ -45,7 +45,7 @@ declare class DeviceEventReporter {
|
|
|
45
45
|
logProfilingTargetRegistered(): void;
|
|
46
46
|
logConnection(
|
|
47
47
|
connectedEntity: "debugger",
|
|
48
|
-
metadata:
|
|
48
|
+
metadata: Readonly<{
|
|
49
49
|
pageId: string,
|
|
50
50
|
frontendUserAgent: string | null,
|
|
51
51
|
}>,
|
|
@@ -56,7 +56,6 @@ declare class DeviceEventReporter {
|
|
|
56
56
|
error: Error,
|
|
57
57
|
message: string,
|
|
58
58
|
): void;
|
|
59
|
-
logFuseboxConsoleNotice(): void;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
declare export default typeof DeviceEventReporter;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* A capability flag disables a specific feature/hack in the InspectorProxy
|
|
13
13
|
* layer by indicating that the target supports one or more modern CDP features.
|
|
14
14
|
*/
|
|
15
|
-
export type TargetCapabilityFlags =
|
|
15
|
+
export type TargetCapabilityFlags = Readonly<{
|
|
16
16
|
/**
|
|
17
17
|
* The target supports a stable page representation across reloads.
|
|
18
18
|
*
|
|
@@ -43,7 +43,7 @@ export type TargetCapabilityFlags = $ReadOnly<{
|
|
|
43
43
|
// each new instance of VM and can appear when user reloads React Native
|
|
44
44
|
// application.
|
|
45
45
|
|
|
46
|
-
export type PageFromDevice =
|
|
46
|
+
export type PageFromDevice = Readonly<{
|
|
47
47
|
id: string,
|
|
48
48
|
title: string,
|
|
49
49
|
/** Sent from modern targets only */
|
|
@@ -54,15 +54,15 @@ export type PageFromDevice = $ReadOnly<{
|
|
|
54
54
|
capabilities?: TargetCapabilityFlags,
|
|
55
55
|
}>;
|
|
56
56
|
|
|
57
|
-
export type Page =
|
|
57
|
+
export type Page = Readonly<{
|
|
58
58
|
...PageFromDevice,
|
|
59
59
|
capabilities: NonNullable<PageFromDevice["capabilities"]>,
|
|
60
60
|
}>;
|
|
61
61
|
|
|
62
62
|
// Chrome Debugger Protocol message/event passed between device and debugger.
|
|
63
|
-
export type WrappedEvent =
|
|
63
|
+
export type WrappedEvent = Readonly<{
|
|
64
64
|
event: "wrappedEvent",
|
|
65
|
-
payload:
|
|
65
|
+
payload: Readonly<{
|
|
66
66
|
pageId: string,
|
|
67
67
|
wrappedEvent: string,
|
|
68
68
|
}>,
|
|
@@ -70,16 +70,16 @@ export type WrappedEvent = $ReadOnly<{
|
|
|
70
70
|
|
|
71
71
|
// Request sent from Inspector Proxy to Device when new debugger is connected
|
|
72
72
|
// to particular page.
|
|
73
|
-
export type ConnectRequest =
|
|
73
|
+
export type ConnectRequest = Readonly<{
|
|
74
74
|
event: "connect",
|
|
75
|
-
payload:
|
|
75
|
+
payload: Readonly<{ pageId: string }>,
|
|
76
76
|
}>;
|
|
77
77
|
|
|
78
78
|
// Request sent from Inspector Proxy to Device to notify that debugger is
|
|
79
79
|
// disconnected.
|
|
80
|
-
export type DisconnectRequest =
|
|
80
|
+
export type DisconnectRequest = Readonly<{
|
|
81
81
|
event: "disconnect",
|
|
82
|
-
payload:
|
|
82
|
+
payload: Readonly<{ pageId: string }>,
|
|
83
83
|
}>;
|
|
84
84
|
|
|
85
85
|
// Request sent from Inspector Proxy to Device to get a list of pages.
|
|
@@ -105,7 +105,7 @@ export type MessageToDevice =
|
|
|
105
105
|
| DisconnectRequest;
|
|
106
106
|
|
|
107
107
|
// Page description object that is sent in response to /json HTTP request from debugger.
|
|
108
|
-
export type PageDescription =
|
|
108
|
+
export type PageDescription = Readonly<{
|
|
109
109
|
id: string,
|
|
110
110
|
title: string,
|
|
111
111
|
appId: string,
|
|
@@ -121,7 +121,7 @@ export type PageDescription = $ReadOnly<{
|
|
|
121
121
|
vm?: string,
|
|
122
122
|
|
|
123
123
|
// React Native specific metadata
|
|
124
|
-
reactNative:
|
|
124
|
+
reactNative: Readonly<{
|
|
125
125
|
logicalDeviceId: string,
|
|
126
126
|
capabilities: Page["capabilities"],
|
|
127
127
|
}>,
|
|
@@ -131,7 +131,7 @@ export type JsonPagesListResponse = Array<PageDescription>;
|
|
|
131
131
|
|
|
132
132
|
// Response to /json/version HTTP request from the debugger specifying browser type and
|
|
133
133
|
// Chrome protocol version.
|
|
134
|
-
export type JsonVersionResponse =
|
|
134
|
+
export type JsonVersionResponse = Readonly<{
|
|
135
135
|
Browser: string,
|
|
136
136
|
"Protocol-Version": string,
|
|
137
137
|
}>;
|
|
@@ -14,7 +14,7 @@ import type { EventReporter } from "../types/EventReporter";
|
|
|
14
14
|
import type { Experiments } from "../types/Experiments";
|
|
15
15
|
import type { Logger } from "../types/Logger";
|
|
16
16
|
import type { NextHandleFunction } from "connect";
|
|
17
|
-
type Options =
|
|
17
|
+
type Options = Readonly<{
|
|
18
18
|
serverBaseUrl: string,
|
|
19
19
|
logger?: Logger,
|
|
20
20
|
browserLauncher: BrowserLauncher,
|
|
@@ -78,34 +78,33 @@ export type ReportableEvent =
|
|
|
78
78
|
* | ^^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
79
79
|
**/
|
|
80
80
|
any
|
|
81
|
-
| { type: "fusebox_console_notice" }
|
|
82
81
|
| /**
|
|
83
|
-
* >
|
|
82
|
+
* > 93 | ...DebuggerSessionIDs,
|
|
84
83
|
* | ^^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
85
84
|
**/
|
|
86
85
|
any
|
|
87
86
|
| /**
|
|
88
|
-
* >
|
|
87
|
+
* > 102 | ...ConnectionUptime,
|
|
89
88
|
* | ^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
90
89
|
**/
|
|
91
90
|
any
|
|
92
91
|
| /**
|
|
93
|
-
* >
|
|
92
|
+
* > 109 | ...ConnectionUptime,
|
|
94
93
|
* | ^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
95
94
|
**/
|
|
96
95
|
any
|
|
97
96
|
| /**
|
|
98
|
-
* >
|
|
97
|
+
* > 116 | ...ConnectionUptime,
|
|
99
98
|
* | ^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
100
99
|
**/
|
|
101
100
|
any
|
|
102
101
|
| /**
|
|
103
|
-
* >
|
|
102
|
+
* > 124 | ...ConnectionUptime,
|
|
104
103
|
* | ^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
105
104
|
**/
|
|
106
105
|
any
|
|
107
106
|
| /**
|
|
108
|
-
* >
|
|
107
|
+
* > 132 | ...ConnectionUptime,
|
|
109
108
|
* | ^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
110
109
|
**/
|
|
111
110
|
any
|
|
@@ -17,7 +17,7 @@ declare export default function getDevToolsFrontendUrl(
|
|
|
17
17
|
experiments: Experiments,
|
|
18
18
|
webSocketDebuggerUrl: string,
|
|
19
19
|
devServerUrl: string,
|
|
20
|
-
options?:
|
|
20
|
+
options?: Readonly<{
|
|
21
21
|
relative?: boolean,
|
|
22
22
|
launchId?: string,
|
|
23
23
|
telemetryInfo?: string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/dev-middleware",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0-nightly-20260108-1236b6be4",
|
|
4
4
|
"description": "Dev server middleware for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@isaacs/ttlcache": "^1.4.1",
|
|
29
|
-
"@react-native/debugger-frontend": "0.
|
|
30
|
-
"@react-native/debugger-shell": "0.
|
|
29
|
+
"@react-native/debugger-frontend": "0.85.0-nightly-20260108-1236b6be4",
|
|
30
|
+
"@react-native/debugger-shell": "0.85.0-nightly-20260108-1236b6be4",
|
|
31
31
|
"chrome-launcher": "^0.15.2",
|
|
32
|
-
"chromium-edge-launcher": "^0.
|
|
32
|
+
"chromium-edge-launcher": "^0.3.0",
|
|
33
33
|
"connect": "^3.6.5",
|
|
34
34
|
"debug": "^4.4.0",
|
|
35
35
|
"invariant": "^2.2.4",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ws": "^7.5.10"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@react-native/debugger-shell": "0.
|
|
42
|
+
"@react-native/debugger-shell": "0.85.0-nightly-20260108-1236b6be4",
|
|
43
43
|
"selfsigned": "^4.0.0",
|
|
44
44
|
"undici": "^5.29.0",
|
|
45
45
|
"wait-for-expect": "^3.0.2"
|