@depup/react-native__dev-middleware 0.84.1-depup.1
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 +38 -0
- package/changes.json +38 -0
- package/dist/createDevMiddleware.d.ts +62 -0
- package/dist/createDevMiddleware.js +140 -0
- package/dist/createDevMiddleware.js.flow +72 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +26 -0
- package/dist/index.js.flow +24 -0
- package/dist/inspector-proxy/CdpDebugLogging.d.ts +20 -0
- package/dist/inspector-proxy/CdpDebugLogging.js +117 -0
- package/dist/inspector-proxy/CdpDebugLogging.js.flow +20 -0
- package/dist/inspector-proxy/CustomMessageHandler.d.ts +48 -0
- package/dist/inspector-proxy/CustomMessageHandler.js +1 -0
- package/dist/inspector-proxy/CustomMessageHandler.js.flow +54 -0
- package/dist/inspector-proxy/Device.d.ts +62 -0
- package/dist/inspector-proxy/Device.js +810 -0
- package/dist/inspector-proxy/Device.js.flow +70 -0
- package/dist/inspector-proxy/DeviceEventReporter.d.ts +54 -0
- package/dist/inspector-proxy/DeviceEventReporter.js +194 -0
- package/dist/inspector-proxy/DeviceEventReporter.js.flow +62 -0
- package/dist/inspector-proxy/EventLoopPerfTracker.d.ts +31 -0
- package/dist/inspector-proxy/EventLoopPerfTracker.js +50 -0
- package/dist/inspector-proxy/EventLoopPerfTracker.js.flow +34 -0
- package/dist/inspector-proxy/InspectorProxy.d.ts +53 -0
- package/dist/inspector-proxy/InspectorProxy.js +477 -0
- package/dist/inspector-proxy/InspectorProxy.js.flow +62 -0
- package/dist/inspector-proxy/InspectorProxyHeartbeat.d.ts +24 -0
- package/dist/inspector-proxy/InspectorProxyHeartbeat.js +64 -0
- package/dist/inspector-proxy/InspectorProxyHeartbeat.js.flow +25 -0
- package/dist/inspector-proxy/cdp-types/messages.d.ts +41 -0
- package/dist/inspector-proxy/cdp-types/messages.js +1 -0
- package/dist/inspector-proxy/cdp-types/messages.js.flow +54 -0
- package/dist/inspector-proxy/cdp-types/protocol.d.ts +106 -0
- package/dist/inspector-proxy/cdp-types/protocol.js +1 -0
- package/dist/inspector-proxy/cdp-types/protocol.js.flow +124 -0
- package/dist/inspector-proxy/types.d.ts +115 -0
- package/dist/inspector-proxy/types.js +1 -0
- package/dist/inspector-proxy/types.js.flow +152 -0
- package/dist/middleware/openDebuggerMiddleware.d.ts +36 -0
- package/dist/middleware/openDebuggerMiddleware.js +216 -0
- package/dist/middleware/openDebuggerMiddleware.js.flow +36 -0
- package/dist/types/BrowserLauncher.d.ts +62 -0
- package/dist/types/BrowserLauncher.js +1 -0
- package/dist/types/BrowserLauncher.js.flow +66 -0
- package/dist/types/EventReporter.d.ts +124 -0
- package/dist/types/EventReporter.js +1 -0
- package/dist/types/EventReporter.js.flow +151 -0
- package/dist/types/Experiments.d.ts +30 -0
- package/dist/types/Experiments.js +1 -0
- package/dist/types/Experiments.js.flow +34 -0
- package/dist/types/Logger.d.ts +15 -0
- package/dist/types/Logger.js +1 -0
- package/dist/types/Logger.js.flow +16 -0
- package/dist/utils/DefaultBrowserLauncher.d.ts +30 -0
- package/dist/utils/DefaultBrowserLauncher.js +57 -0
- package/dist/utils/DefaultBrowserLauncher.js.flow +29 -0
- package/dist/utils/getBaseUrlFromRequest.d.ts +14 -0
- package/dist/utils/getBaseUrlFromRequest.js +19 -0
- package/dist/utils/getBaseUrlFromRequest.js.flow +17 -0
- package/dist/utils/getDevToolsFrontendUrl.d.ts +29 -0
- package/dist/utils/getDevToolsFrontendUrl.js +58 -0
- package/dist/utils/getDevToolsFrontendUrl.js.flow +29 -0
- package/package.json +97 -0
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
*
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { EventReporter } from "../types/EventReporter";
|
|
12
|
+
import type { CreateCustomMessageHandlerFn } from "./CustomMessageHandler";
|
|
13
|
+
import type { Page } from "./types";
|
|
14
|
+
import WS from "ws";
|
|
15
|
+
export declare const WS_CLOSE_REASON: {
|
|
16
|
+
PAGE_NOT_FOUND: "[PAGE_NOT_FOUND] Debugger page not found";
|
|
17
|
+
CONNECTION_LOST: "[CONNECTION_LOST] Connection lost to corresponding device";
|
|
18
|
+
RECREATING_DEVICE: "[RECREATING_DEVICE] Recreating device connection";
|
|
19
|
+
NEW_DEBUGGER_OPENED: "[NEW_DEBUGGER_OPENED] New debugger opened for the same app instance";
|
|
20
|
+
};
|
|
21
|
+
export declare type WS_CLOSE_REASON = typeof WS_CLOSE_REASON;
|
|
22
|
+
export type DeviceOptions = Readonly<{
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
app: string;
|
|
26
|
+
socket: WS;
|
|
27
|
+
eventReporter: null | undefined | EventReporter;
|
|
28
|
+
createMessageMiddleware: null | undefined | CreateCustomMessageHandlerFn;
|
|
29
|
+
deviceRelativeBaseUrl: URL;
|
|
30
|
+
serverRelativeBaseUrl: URL;
|
|
31
|
+
isProfilingBuild: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Device class represents single device connection to Inspector Proxy. Each device
|
|
35
|
+
* can have multiple inspectable pages.
|
|
36
|
+
*/
|
|
37
|
+
declare class Device {
|
|
38
|
+
constructor(deviceOptions: DeviceOptions);
|
|
39
|
+
/**
|
|
40
|
+
* Used to recreate the device connection if there is a device ID collision.
|
|
41
|
+
* 1. Checks if the same device is attempting to reconnect for the same app.
|
|
42
|
+
* 2. If not, close both the device and debugger socket.
|
|
43
|
+
* 3. If the debugger connection can be reused, close the device socket only.
|
|
44
|
+
*
|
|
45
|
+
* This hack attempts to allow users to reload the app, either as result of a
|
|
46
|
+
* crash, or manually reloading, without having to restart the debugger.
|
|
47
|
+
*/
|
|
48
|
+
dangerouslyRecreateDevice(deviceOptions: DeviceOptions): void;
|
|
49
|
+
getName(): string;
|
|
50
|
+
getApp(): string;
|
|
51
|
+
getPagesList(): ReadonlyArray<Page>;
|
|
52
|
+
handleDebuggerConnection(
|
|
53
|
+
socket: WS,
|
|
54
|
+
pageId: string,
|
|
55
|
+
$$PARAM_2$$: Readonly<{
|
|
56
|
+
debuggerRelativeBaseUrl: URL;
|
|
57
|
+
userAgent: string | null;
|
|
58
|
+
}>,
|
|
59
|
+
): void;
|
|
60
|
+
dangerouslyGetSocket(): WS;
|
|
61
|
+
}
|
|
62
|
+
export default Device;
|