@react-native/dev-middleware 0.74.0 → 0.74.2
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 +8 -1
- package/dist/createDevMiddleware.js +12 -9
- package/dist/createDevMiddleware.js.flow +9 -1
- package/dist/index.flow.d.ts +2 -0
- package/dist/index.flow.js +16 -0
- package/dist/index.flow.js.flow +3 -0
- package/dist/inspector-proxy/Device.d.ts +3 -55
- package/dist/inspector-proxy/Device.js +254 -166
- package/dist/inspector-proxy/Device.js.flow +3 -59
- package/dist/inspector-proxy/DeviceEventReporter.d.ts +2 -12
- package/dist/inspector-proxy/DeviceEventReporter.js +37 -35
- package/dist/inspector-proxy/DeviceEventReporter.js.flow +2 -17
- package/dist/inspector-proxy/InspectorProxy.d.ts +1 -24
- package/dist/inspector-proxy/InspectorProxy.js +41 -30
- package/dist/inspector-proxy/InspectorProxy.js.flow +1 -24
- package/dist/inspector-proxy/cdp-types/messages.d.ts +39 -0
- package/dist/inspector-proxy/cdp-types/messages.js +1 -0
- package/dist/inspector-proxy/cdp-types/messages.js.flow +52 -0
- package/dist/inspector-proxy/cdp-types/protocol.d.ts +87 -0
- package/dist/inspector-proxy/cdp-types/protocol.js +1 -0
- package/dist/inspector-proxy/cdp-types/protocol.js.flow +106 -0
- package/dist/inspector-proxy/types.d.ts +60 -45
- package/dist/inspector-proxy/types.js.flow +62 -70
- package/dist/middleware/deprecated_openFlipperMiddleware.d.ts +1 -1
- package/dist/middleware/deprecated_openFlipperMiddleware.js.flow +1 -2
- package/dist/middleware/openDebuggerMiddleware.d.ts +1 -1
- package/dist/middleware/openDebuggerMiddleware.js +23 -8
- package/dist/middleware/openDebuggerMiddleware.js.flow +1 -2
- package/dist/types/EventReporter.d.ts +3 -3
- package/dist/types/EventReporter.js.flow +1 -1
- package/dist/types/Experiments.d.ts +4 -0
- package/dist/types/Experiments.js.flow +5 -0
- package/dist/utils/DefaultBrowserLauncher.js +1 -1
- package/dist/utils/getDevToolsFrontendUrl.d.ts +2 -0
- package/dist/utils/getDevToolsFrontendUrl.js +20 -4
- package/dist/utils/getDevToolsFrontendUrl.js.flow +3 -0
- package/package.json +13 -5
|
@@ -30,10 +30,10 @@ export type ReportableEvent =
|
|
|
30
30
|
| /**
|
|
31
31
|
* > 38 | ...
|
|
32
32
|
* | ^^^
|
|
33
|
-
* > 39 | | SuccessResult<{ appId: string }>
|
|
34
|
-
* |
|
|
33
|
+
* > 39 | | SuccessResult<{ appId: string | null, deviceId: string | null }>
|
|
34
|
+
* | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
35
35
|
* > 40 | | ErrorResult<mixed>
|
|
36
|
-
* |
|
|
36
|
+
* | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
37
37
|
* > 41 | | CodedErrorResult<"NO_APPS_FOUND">,
|
|
38
38
|
* | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with spreads in the middle or at the end" is currently not supported.
|
|
39
39
|
**/
|
|
@@ -36,7 +36,7 @@ export type ReportableEvent =
|
|
|
36
36
|
type: "launch_debugger_frontend",
|
|
37
37
|
launchType: "launch" | "redirect",
|
|
38
38
|
...
|
|
39
|
-
| SuccessResult<{ appId: string }>
|
|
39
|
+
| SuccessResult<{ appId: string | null, deviceId: string | null }>
|
|
40
40
|
| ErrorResult<mixed>
|
|
41
41
|
| CodedErrorResult<"NO_APPS_FOUND">,
|
|
42
42
|
}
|
|
@@ -22,5 +22,9 @@ export type Experiments = Readonly<{
|
|
|
22
22
|
* interface.
|
|
23
23
|
*/
|
|
24
24
|
enableOpenDebuggerRedirect: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enables the Network panel when launching the custom debugger frontend.
|
|
27
|
+
*/
|
|
28
|
+
enableNetworkInspector: boolean;
|
|
25
29
|
}>;
|
|
26
30
|
export type ExperimentsConfig = Partial<Experiments>;
|
|
@@ -23,6 +23,11 @@ export type Experiments = $ReadOnly<{
|
|
|
23
23
|
* interface.
|
|
24
24
|
*/
|
|
25
25
|
enableOpenDebuggerRedirect: boolean,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Enables the Network panel when launching the custom debugger frontend.
|
|
29
|
+
*/
|
|
30
|
+
enableNetworkInspector: boolean,
|
|
26
31
|
}>;
|
|
27
32
|
|
|
28
33
|
export type ExperimentsConfig = Partial<Experiments>;
|
|
@@ -21,8 +21,8 @@ function _interopRequireDefault(obj) {
|
|
|
21
21
|
* @oncall react_native
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
const { Launcher: EdgeLauncher } = require("@rnx-kit/chromium-edge-launcher");
|
|
24
25
|
const ChromeLauncher = require("chrome-launcher");
|
|
25
|
-
const { Launcher: EdgeLauncher } = require("chromium-edge-launcher");
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Default `BrowserLauncher` implementation which opens URLs on the host
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* @oncall react_native
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import type { Experiments } from "../types/Experiments";
|
|
12
13
|
/**
|
|
13
14
|
* Get the DevTools frontend URL to debug a given React Native CDP target.
|
|
14
15
|
*/
|
|
15
16
|
declare function getDevToolsFrontendUrl(
|
|
17
|
+
experiments: Experiments,
|
|
16
18
|
webSocketDebuggerUrl: string,
|
|
17
19
|
devServerUrl: string
|
|
18
20
|
): string;
|
|
@@ -18,10 +18,26 @@ exports.default = getDevToolsFrontendUrl;
|
|
|
18
18
|
/**
|
|
19
19
|
* Get the DevTools frontend URL to debug a given React Native CDP target.
|
|
20
20
|
*/
|
|
21
|
-
function getDevToolsFrontendUrl(
|
|
21
|
+
function getDevToolsFrontendUrl(
|
|
22
|
+
experiments,
|
|
23
|
+
webSocketDebuggerUrl,
|
|
24
|
+
devServerUrl
|
|
25
|
+
) {
|
|
22
26
|
const scheme = new URL(webSocketDebuggerUrl).protocol.slice(0, -1);
|
|
23
|
-
const webSocketUrlWithoutProtocol =
|
|
24
|
-
|
|
27
|
+
const webSocketUrlWithoutProtocol = webSocketDebuggerUrl.replace(
|
|
28
|
+
/^wss?:\/\//,
|
|
29
|
+
""
|
|
30
|
+
);
|
|
31
|
+
const searchParams = new URLSearchParams([
|
|
32
|
+
[scheme, webSocketUrlWithoutProtocol],
|
|
33
|
+
["sources.hide_add_folder", "true"],
|
|
34
|
+
]);
|
|
35
|
+
if (experiments.enableNetworkInspector) {
|
|
36
|
+
searchParams.append("unstable_enableNetworkPanel", "true");
|
|
37
|
+
}
|
|
38
|
+
return (
|
|
39
|
+
`${devServerUrl}/debugger-frontend/rn_inspector.html` +
|
|
40
|
+
"?" +
|
|
41
|
+
searchParams.toString()
|
|
25
42
|
);
|
|
26
|
-
return `${`${devServerUrl}/debugger-frontend/rn_inspector.html`}?${scheme}=${webSocketUrlWithoutProtocol}&sources.hide_add_folder=true`;
|
|
27
43
|
}
|
|
@@ -9,10 +9,13 @@
|
|
|
9
9
|
* @oncall react_native
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import type { Experiments } from "../types/Experiments";
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
15
|
* Get the DevTools frontend URL to debug a given React Native CDP target.
|
|
14
16
|
*/
|
|
15
17
|
declare export default function getDevToolsFrontendUrl(
|
|
18
|
+
experiments: Experiments,
|
|
16
19
|
webSocketDebuggerUrl: string,
|
|
17
20
|
devServerUrl: string
|
|
18
21
|
): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/dev-middleware",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.2",
|
|
4
4
|
"description": "Dev server middleware for React Native",
|
|
5
5
|
"keywords": ["react-native", "tools"],
|
|
6
6
|
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/dev-middleware#readme",
|
|
@@ -15,15 +15,23 @@
|
|
|
15
15
|
"files": ["dist"],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@isaacs/ttlcache": "^1.4.1",
|
|
18
|
-
"@react-native/debugger-frontend": "
|
|
18
|
+
"@react-native/debugger-frontend": "0.74.1",
|
|
19
|
+
"@rnx-kit/chromium-edge-launcher": "^1.0.0",
|
|
19
20
|
"chrome-launcher": "^0.15.2",
|
|
20
|
-
"chromium-edge-launcher": "^1.0.0",
|
|
21
21
|
"connect": "^3.6.5",
|
|
22
22
|
"debug": "^2.2.0",
|
|
23
23
|
"node-fetch": "^2.2.0",
|
|
24
|
+
"nullthrows": "^1.1.1",
|
|
24
25
|
"open": "^7.0.3",
|
|
26
|
+
"selfsigned": "^2.4.1",
|
|
25
27
|
"serve-static": "^1.13.1",
|
|
26
|
-
"temp-dir": "^2.0.0"
|
|
28
|
+
"temp-dir": "^2.0.0",
|
|
29
|
+
"ws": "^6.2.2"
|
|
27
30
|
},
|
|
28
|
-
"engines": { "node": ">=18" }
|
|
31
|
+
"engines": { "node": ">=18" },
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"data-uri-to-buffer": "^6.0.1",
|
|
34
|
+
"undici": "^5.27.2",
|
|
35
|
+
"wait-for-expect": "^3.0.2"
|
|
36
|
+
}
|
|
29
37
|
}
|