@react-native/dev-middleware 0.88.0-nightly-20260721-7bb31ff7b → 0.88.0-nightly-20260722-eb4d3892a
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.d.ts +1 -1
- package/dist/createDevMiddleware.js +7 -4
- package/dist/createDevMiddleware.js.flow +1 -1
- package/dist/inspector-proxy/CdpDebugLogging.js +4 -4
- package/dist/inspector-proxy/Device.js +2 -2
- package/dist/inspector-proxy/EventLoopPerfTracker.js +6 -6
- package/dist/inspector-proxy/InspectorProxy.d.ts +1 -1
- package/dist/inspector-proxy/InspectorProxy.js.flow +1 -1
- package/dist/inspector-proxy/InspectorProxyHeartbeat.js +5 -5
- package/dist/middleware/openDebuggerMiddleware.js +2 -2
- package/dist/utils/DefaultToolLauncher.js +1 -1
- package/package.json +4 -4
|
@@ -15,7 +15,7 @@ import type { ExperimentsConfig } from "./types/Experiments";
|
|
|
15
15
|
import type { Logger } from "./types/Logger";
|
|
16
16
|
import type { ReadonlyURL } from "./types/ReadonlyURL";
|
|
17
17
|
import type { NextHandleFunction } from "connect";
|
|
18
|
-
import path from "path";
|
|
18
|
+
import path from "node:path";
|
|
19
19
|
type Options = Readonly<{
|
|
20
20
|
/**
|
|
21
21
|
* The base URL to the dev server, as reachable from the machine on which
|
|
@@ -17,7 +17,7 @@ var _debuggerFrontend = _interopRequireDefault(
|
|
|
17
17
|
require("@react-native/debugger-frontend"),
|
|
18
18
|
);
|
|
19
19
|
var _connect = _interopRequireDefault(require("connect"));
|
|
20
|
-
var
|
|
20
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
21
21
|
var _serveStatic = _interopRequireDefault(require("serve-static"));
|
|
22
22
|
function _interopRequireDefault(e) {
|
|
23
23
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -67,9 +67,12 @@ function createDevMiddleware({
|
|
|
67
67
|
)
|
|
68
68
|
.use(
|
|
69
69
|
"/debugger-frontend",
|
|
70
|
-
(0, _serveStatic.default)(
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
(0, _serveStatic.default)(
|
|
71
|
+
_nodePath.default.join(_debuggerFrontend.default),
|
|
72
|
+
{
|
|
73
|
+
fallthrough: false,
|
|
74
|
+
},
|
|
75
|
+
),
|
|
73
76
|
)
|
|
74
77
|
.use((...args) => inspectorProxy.processRequest(...args));
|
|
75
78
|
return {
|
|
@@ -16,7 +16,7 @@ import type { Logger } from "./types/Logger";
|
|
|
16
16
|
import type { ReadonlyURL } from "./types/ReadonlyURL";
|
|
17
17
|
import type { NextHandleFunction } from "connect";
|
|
18
18
|
|
|
19
|
-
import path from "path";
|
|
19
|
+
import path from "node:path";
|
|
20
20
|
type Options = Readonly<{
|
|
21
21
|
/**
|
|
22
22
|
* The base URL to the dev server, as reachable from the machine on which
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _nodeTimers = require("node:timers");
|
|
8
|
+
var _nodeUtil = _interopRequireDefault(require("node:util"));
|
|
9
9
|
function _interopRequireDefault(e) {
|
|
10
10
|
return e && e.__esModule ? e : { default: e };
|
|
11
11
|
}
|
|
@@ -13,7 +13,7 @@ const debug = require("debug")("Metro:InspectorProxy");
|
|
|
13
13
|
const debugCDPMessages = require("debug")("Metro:InspectorProxyCDPMessages");
|
|
14
14
|
const CDP_MESSAGES_BATCH_DEBUGGING_THROTTLE_MS = 5000;
|
|
15
15
|
function getCDPLogPrefix(destination) {
|
|
16
|
-
return
|
|
16
|
+
return _nodeUtil.default.format(
|
|
17
17
|
"[(Debugger) %s (Proxy) %s (Device)]",
|
|
18
18
|
destination === "DebuggerToProxy"
|
|
19
19
|
? "->"
|
|
@@ -84,7 +84,7 @@ class CdpDebugLogging {
|
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
if (timeout == null) {
|
|
87
|
-
timeout = (0,
|
|
87
|
+
timeout = (0, _nodeTimers.setTimeout)(() => {
|
|
88
88
|
debug(
|
|
89
89
|
"%s %s CDP messages of size %s MB %s in the last %ss.",
|
|
90
90
|
getCDPLogPrefix(destination),
|
|
@@ -8,8 +8,8 @@ var _CdpDebugLogging = _interopRequireDefault(require("./CdpDebugLogging"));
|
|
|
8
8
|
var _DeviceEventReporter = _interopRequireDefault(
|
|
9
9
|
require("./DeviceEventReporter"),
|
|
10
10
|
);
|
|
11
|
-
var _crypto = _interopRequireDefault(require("crypto"));
|
|
12
11
|
var _invariant = _interopRequireDefault(require("invariant"));
|
|
12
|
+
var _nodeCrypto = _interopRequireDefault(require("node:crypto"));
|
|
13
13
|
var _ws = _interopRequireDefault(require("ws"));
|
|
14
14
|
function _interopRequireDefault(e) {
|
|
15
15
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -226,7 +226,7 @@ class Device {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
const sessionId =
|
|
229
|
+
const sessionId = _nodeCrypto.default.randomUUID();
|
|
230
230
|
this.#deviceEventReporter?.logConnection("debugger", {
|
|
231
231
|
pageId,
|
|
232
232
|
frontendUserAgent: userAgent,
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _nodePerf_hooks = require("node:perf_hooks");
|
|
8
|
+
var _nodeTimers = require("node:timers");
|
|
9
9
|
class EventLoopPerfTracker {
|
|
10
10
|
#perfMeasurementDuration;
|
|
11
11
|
#minDelayPercentToReport;
|
|
@@ -22,13 +22,13 @@ class EventLoopPerfTracker {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
this.#eventLoopPerfMeasurementOngoing = true;
|
|
25
|
-
const eluStart =
|
|
26
|
-
const h = (0,
|
|
25
|
+
const eluStart = _nodePerf_hooks.performance.eventLoopUtilization();
|
|
26
|
+
const h = (0, _nodePerf_hooks.monitorEventLoopDelay)({
|
|
27
27
|
resolution: 20,
|
|
28
28
|
});
|
|
29
29
|
h.enable();
|
|
30
|
-
(0,
|
|
31
|
-
const eluEnd =
|
|
30
|
+
(0, _nodeTimers.setTimeout)(() => {
|
|
31
|
+
const eluEnd = _nodePerf_hooks.performance.eventLoopUtilization(eluStart);
|
|
32
32
|
h.disable();
|
|
33
33
|
const eventLoopUtilization = Math.floor(eluEnd.utilization * 100);
|
|
34
34
|
const maxEventLoopDelayPercent = Math.floor(
|
|
@@ -14,7 +14,7 @@ import type { Logger } from "../types/Logger";
|
|
|
14
14
|
import type { ReadonlyURL } from "../types/ReadonlyURL";
|
|
15
15
|
import type { CreateCustomMessageHandlerFn } from "./CustomMessageHandler";
|
|
16
16
|
import type { PageDescription } from "./types";
|
|
17
|
-
import type { IncomingMessage, ServerResponse } from "http";
|
|
17
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
18
18
|
import WS from "ws";
|
|
19
19
|
export type GetPageDescriptionsConfig = {
|
|
20
20
|
requestorRelativeBaseUrl: ReadonlyURL;
|
|
@@ -14,7 +14,7 @@ import type { Logger } from "../types/Logger";
|
|
|
14
14
|
import type { ReadonlyURL } from "../types/ReadonlyURL";
|
|
15
15
|
import type { CreateCustomMessageHandlerFn } from "./CustomMessageHandler";
|
|
16
16
|
import type { PageDescription } from "./types";
|
|
17
|
-
import type { IncomingMessage, ServerResponse } from "http";
|
|
17
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
18
18
|
|
|
19
19
|
import WS from "ws";
|
|
20
20
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _nodeTimers = require("node:timers");
|
|
8
8
|
var _ws = _interopRequireDefault(require("ws"));
|
|
9
9
|
function _interopRequireDefault(e) {
|
|
10
10
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -27,13 +27,13 @@ class InspectorProxyHeartbeat {
|
|
|
27
27
|
start() {
|
|
28
28
|
let latestPingMs = Date.now();
|
|
29
29
|
let terminateTimeout;
|
|
30
|
-
const pingTimeout = (0,
|
|
30
|
+
const pingTimeout = (0, _nodeTimers.setTimeout)(() => {
|
|
31
31
|
if (this.#socket.readyState !== _ws.default.OPEN) {
|
|
32
32
|
pingTimeout.refresh();
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!terminateTimeout) {
|
|
36
|
-
terminateTimeout = (0,
|
|
36
|
+
terminateTimeout = (0, _nodeTimers.setTimeout)(() => {
|
|
37
37
|
if (this.#socket.readyState !== _ws.default.OPEN) {
|
|
38
38
|
terminateTimeout?.refresh();
|
|
39
39
|
return;
|
|
@@ -56,8 +56,8 @@ class InspectorProxyHeartbeat {
|
|
|
56
56
|
terminateTimeout?.refresh();
|
|
57
57
|
});
|
|
58
58
|
this.#socket.on("close", (code, reason) => {
|
|
59
|
-
terminateTimeout && (0,
|
|
60
|
-
(0,
|
|
59
|
+
terminateTimeout && (0, _nodeTimers.clearTimeout)(terminateTimeout);
|
|
60
|
+
(0, _nodeTimers.clearTimeout)(pingTimeout);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -7,7 +7,7 @@ exports.default = openDebuggerMiddleware;
|
|
|
7
7
|
var _getDevToolsFrontendUrl = _interopRequireDefault(
|
|
8
8
|
require("../utils/getDevToolsFrontendUrl"),
|
|
9
9
|
);
|
|
10
|
-
var
|
|
10
|
+
var _nodeCrypto = require("node:crypto");
|
|
11
11
|
function _interopRequireDefault(e) {
|
|
12
12
|
return e && e.__esModule ? e : { default: e };
|
|
13
13
|
}
|
|
@@ -135,7 +135,7 @@ function openDebuggerMiddleware({
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
if (shouldUseStandaloneFuseboxShell) {
|
|
138
|
-
const windowKey = (0,
|
|
138
|
+
const windowKey = (0, _nodeCrypto.createHash)("sha256")
|
|
139
139
|
.update(
|
|
140
140
|
[
|
|
141
141
|
serverBaseUrl,
|
|
@@ -8,9 +8,9 @@ const {
|
|
|
8
8
|
unstable_prepareDebuggerShell,
|
|
9
9
|
unstable_spawnDebuggerShellWithArgs,
|
|
10
10
|
} = require("@react-native/debugger-shell");
|
|
11
|
-
const { spawn } = require("child_process");
|
|
12
11
|
const ChromeLauncher = require("chrome-launcher");
|
|
13
12
|
const { Launcher: EdgeLauncher } = require("chromium-edge-launcher");
|
|
13
|
+
const { spawn } = require("node:child_process");
|
|
14
14
|
const open = require("open");
|
|
15
15
|
const DefaultToolLauncher = {
|
|
16
16
|
launchDebuggerAppWindow: async (url) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/dev-middleware",
|
|
3
|
-
"version": "0.88.0-nightly-
|
|
3
|
+
"version": "0.88.0-nightly-20260722-eb4d3892a",
|
|
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.88.0-nightly-
|
|
30
|
-
"@react-native/debugger-shell": "0.88.0-nightly-
|
|
29
|
+
"@react-native/debugger-frontend": "0.88.0-nightly-20260722-eb4d3892a",
|
|
30
|
+
"@react-native/debugger-shell": "0.88.0-nightly-20260722-eb4d3892a",
|
|
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.88.0-nightly-
|
|
42
|
+
"@react-native/debugger-shell": "0.88.0-nightly-20260722-eb4d3892a",
|
|
43
43
|
"selfsigned": "^5.5.0",
|
|
44
44
|
"undici": "^6.23.0",
|
|
45
45
|
"wait-for-expect": "^3.0.2"
|