@react-native/dev-middleware 0.75.0-rc.2 → 0.76.0-nightly-20240628-TEMP
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/inspector-proxy/Device.d.ts +10 -1
- package/dist/inspector-proxy/Device.js +119 -256
- package/dist/inspector-proxy/Device.js.flow +10 -1
- package/dist/inspector-proxy/DeviceEventReporter.d.ts +2 -1
- package/dist/inspector-proxy/DeviceEventReporter.js +0 -11
- package/dist/inspector-proxy/DeviceEventReporter.js.flow +2 -1
- package/dist/inspector-proxy/InspectorProxy.d.ts +4 -0
- package/dist/inspector-proxy/InspectorProxy.js +24 -91
- package/dist/inspector-proxy/InspectorProxy.js.flow +4 -0
- package/dist/inspector-proxy/cdp-types/messages.d.ts +10 -9
- package/dist/inspector-proxy/cdp-types/messages.js.flow +12 -11
- package/dist/inspector-proxy/cdp-types/protocol.d.ts +14 -10
- package/dist/inspector-proxy/cdp-types/protocol.js.flow +13 -11
- package/dist/inspector-proxy/types.d.ts +6 -0
- package/dist/inspector-proxy/types.js.flow +7 -0
- package/dist/middleware/deprecated_openFlipperMiddleware.js +0 -18
- package/dist/middleware/openDebuggerMiddleware.js +25 -38
- package/dist/utils/DefaultBrowserLauncher.js +0 -24
- package/dist/utils/getDevToolsFrontendUrl.js +0 -17
- package/package.json +3 -3
|
@@ -4,43 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @format
|
|
15
|
-
* @oncall react_native
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
7
|
const { spawn } = require("child_process");
|
|
19
8
|
const ChromeLauncher = require("chrome-launcher");
|
|
20
9
|
const { Launcher: EdgeLauncher } = require("chromium-edge-launcher");
|
|
21
10
|
const open = require("open");
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Default `BrowserLauncher` implementation which opens URLs on the host
|
|
25
|
-
* machine.
|
|
26
|
-
*/
|
|
27
11
|
const DefaultBrowserLauncher = {
|
|
28
|
-
/**
|
|
29
|
-
* Attempt to open the debugger frontend in a Google Chrome or Microsoft Edge
|
|
30
|
-
* app window.
|
|
31
|
-
*/
|
|
32
12
|
launchDebuggerAppWindow: async (url) => {
|
|
33
13
|
let chromePath;
|
|
34
14
|
try {
|
|
35
|
-
// Locate Chrome installation path, will throw if not found
|
|
36
15
|
chromePath = ChromeLauncher.getChromePath();
|
|
37
16
|
} catch (e) {
|
|
38
|
-
// Fall back to Microsoft Edge
|
|
39
17
|
chromePath = EdgeLauncher.getFirstInstallation();
|
|
40
18
|
}
|
|
41
19
|
if (chromePath == null) {
|
|
42
|
-
// Fall back to default browser - the frontend will warn if the browser
|
|
43
|
-
// is not supported.
|
|
44
20
|
await open(url);
|
|
45
21
|
return;
|
|
46
22
|
}
|
|
@@ -4,20 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = getDevToolsFrontendUrl;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @format
|
|
15
|
-
* @oncall react_native
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Get the DevTools frontend URL to debug a given React Native CDP target.
|
|
20
|
-
*/
|
|
21
7
|
function getDevToolsFrontendUrl(
|
|
22
8
|
experiments,
|
|
23
9
|
webSocketDebuggerUrl,
|
|
@@ -57,11 +43,8 @@ function getWsParam({ webSocketDebuggerUrl, devServerUrl }) {
|
|
|
57
43
|
const serverHost = new URL(devServerUrl).host;
|
|
58
44
|
let value;
|
|
59
45
|
if (wsUrl.host === serverHost) {
|
|
60
|
-
// Use a path-absolute (host-relative) URL
|
|
61
|
-
// Depends on https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/4
|
|
62
46
|
value = wsUrl.pathname + wsUrl.search + wsUrl.hash;
|
|
63
47
|
} else {
|
|
64
|
-
// Standard URL format accepted by the DevTools frontend
|
|
65
48
|
value = wsUrl.host + wsUrl.pathname + wsUrl.search + wsUrl.hash;
|
|
66
49
|
}
|
|
67
50
|
const key = wsUrl.protocol.slice(0, -1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/dev-middleware",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0-nightly-20240628-TEMP",
|
|
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.
|
|
26
|
+
"@react-native/debugger-frontend": "0.76.0-nightly-20240628-TEMP",
|
|
27
27
|
"chrome-launcher": "^0.15.2",
|
|
28
28
|
"chromium-edge-launcher": "^0.2.0",
|
|
29
29
|
"connect": "^3.6.5",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"open": "^7.0.3",
|
|
34
34
|
"selfsigned": "^2.4.1",
|
|
35
35
|
"serve-static": "^1.13.1",
|
|
36
|
-
"ws": "^6.2.
|
|
36
|
+
"ws": "^6.2.3"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=18"
|