@react-native/dev-middleware 0.73.0 → 0.73.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/README.md +77 -3
- package/dist/createDevMiddleware.d.ts +53 -0
- package/dist/createDevMiddleware.js +53 -6
- package/dist/createDevMiddleware.js.flow +44 -15
- package/dist/index.d.ts +12 -0
- package/dist/index.flow.d.ts +14 -0
- package/dist/index.flow.js.flow +5 -2
- package/dist/index.js +14 -1
- package/dist/index.js.flow +1 -9
- package/dist/inspector-proxy/Device.d.ts +90 -0
- package/dist/inspector-proxy/Device.js +708 -0
- package/dist/inspector-proxy/Device.js.flow +97 -0
- package/dist/inspector-proxy/DeviceEventReporter.d.ts +53 -0
- package/dist/inspector-proxy/DeviceEventReporter.js +162 -0
- package/dist/inspector-proxy/DeviceEventReporter.js.flow +65 -0
- package/dist/inspector-proxy/InspectorProxy.d.ts +61 -0
- package/dist/inspector-proxy/InspectorProxy.js +212 -0
- package/dist/inspector-proxy/InspectorProxy.js.flow +65 -0
- package/dist/inspector-proxy/types.d.ts +78 -0
- package/dist/inspector-proxy/types.js +1 -0
- package/dist/inspector-proxy/types.js.flow +135 -0
- package/dist/middleware/openDebuggerMiddleware.d.ts +37 -0
- package/dist/middleware/openDebuggerMiddleware.js +78 -24
- package/dist/middleware/openDebuggerMiddleware.js.flow +15 -64
- package/dist/types/BrowserLauncher.d.ts +27 -0
- package/dist/types/BrowserLauncher.js +1 -0
- package/dist/types/BrowserLauncher.js.flow +31 -0
- package/dist/types/EventReporter.d.ts +69 -0
- package/dist/types/EventReporter.js +1 -0
- package/dist/types/EventReporter.js.flow +81 -0
- package/dist/types/Experiments.d.ts +25 -0
- package/dist/types/Experiments.js +1 -0
- package/dist/types/Experiments.js.flow +27 -0
- package/dist/types/Logger.d.ts +16 -0
- package/dist/utils/DefaultBrowserLauncher.d.ts +18 -0
- package/dist/utils/DefaultBrowserLauncher.js +77 -0
- package/dist/utils/DefaultBrowserLauncher.js.flow +20 -0
- package/dist/utils/getDevToolsFrontendUrl.d.ts +21 -0
- package/dist/utils/getDevToolsFrontendUrl.js +48 -0
- package/dist/utils/getDevToolsFrontendUrl.js.flow +21 -0
- package/package.json +6 -1
- package/dist/utils/getDevServerUrl.js +0 -37
- package/dist/utils/getDevServerUrl.js.flow +0 -32
- package/dist/utils/launchChromeDevTools.js +0 -44
- package/dist/utils/launchChromeDevTools.js.flow +0 -38
- package/dist/utils/launchDebuggerAppWindow.js +0 -58
- package/dist/utils/launchDebuggerAppWindow.js.flow +0 -56
- package/dist/utils/queryInspectorTargets.js +0 -35
- package/dist/utils/queryInspectorTargets.js.flow +0 -40
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true,
|
|
5
|
-
});
|
|
6
|
-
exports.default = queryInspectorTargets;
|
|
7
|
-
var _nodeFetch = _interopRequireDefault(require("node-fetch"));
|
|
8
|
-
function _interopRequireDefault(obj) {
|
|
9
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @format
|
|
19
|
-
* @oncall react_native
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Get the list of available debug targets from the React Native dev server.
|
|
24
|
-
*
|
|
25
|
-
* @see https://chromedevtools.github.io/devtools-protocol/
|
|
26
|
-
*/
|
|
27
|
-
async function queryInspectorTargets(devServerUrl) {
|
|
28
|
-
const res = await (0, _nodeFetch.default)(`${devServerUrl}/json/list`);
|
|
29
|
-
const apps = await res.json();
|
|
30
|
-
|
|
31
|
-
// Only use targets with better reloading support
|
|
32
|
-
return apps.filter(
|
|
33
|
-
(app) => app.title === "React Native Experimental (Improved Chrome Reloads)"
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import fetch from 'node-fetch';
|
|
13
|
-
|
|
14
|
-
type ReactNativeCDPTarget = {
|
|
15
|
-
id: string,
|
|
16
|
-
description: string,
|
|
17
|
-
title: string,
|
|
18
|
-
type: string,
|
|
19
|
-
devtoolsFrontendUrl: string,
|
|
20
|
-
webSocketDebuggerUrl: string,
|
|
21
|
-
vm: string,
|
|
22
|
-
deviceName?: string,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get the list of available debug targets from the React Native dev server.
|
|
27
|
-
*
|
|
28
|
-
* @see https://chromedevtools.github.io/devtools-protocol/
|
|
29
|
-
*/
|
|
30
|
-
export default async function queryInspectorTargets(
|
|
31
|
-
devServerUrl: string,
|
|
32
|
-
): Promise<ReactNativeCDPTarget[]> {
|
|
33
|
-
const res = await fetch(`${devServerUrl}/json/list`);
|
|
34
|
-
const apps = (await res.json(): Array<ReactNativeCDPTarget>);
|
|
35
|
-
|
|
36
|
-
// Only use targets with better reloading support
|
|
37
|
-
return apps.filter(
|
|
38
|
-
app => app.title === 'React Native Experimental (Improved Chrome Reloads)',
|
|
39
|
-
);
|
|
40
|
-
}
|