diff --git a/packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js b/packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js index 2b7a1e710c7ce2..cb94b100bfbf9e 100644 --- a/packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js +++ b/packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js @@ -172,7 +172,6 @@ describe('inspector proxy HTTP API', () => { app: 'bar-app', id: 'page1', title: 'bar-title', - vm: 'bar-vm', }, ]); @@ -209,7 +208,6 @@ describe('inspector proxy HTTP API', () => { }, title: 'bar-title', type: 'node', - vm: 'bar-vm', webSocketDebuggerUrl: expect.any(String), }, ]); diff --git a/packages/dev-middleware/src/inspector-proxy/InspectorProxy.js b/packages/dev-middleware/src/inspector-proxy/InspectorProxy.js index 4cde8e9172f254..b0b8264e3f1e72 100644 --- a/packages/dev-middleware/src/inspector-proxy/InspectorProxy.js +++ b/packages/dev-middleware/src/inspector-proxy/InspectorProxy.js @@ -160,7 +160,7 @@ export default class InspectorProxy implements InspectorProxyQueries { type: 'node', devtoolsFrontendUrl, webSocketDebuggerUrl, - vm: page.vm, + ...(page.vm != null ? {vm: page.vm} : null), deviceName: device.getName(), reactNative: { logicalDeviceId: deviceId, diff --git a/packages/dev-middleware/src/inspector-proxy/types.js b/packages/dev-middleware/src/inspector-proxy/types.js index bcfba57fa962b0..72b975b27489a5 100644 --- a/packages/dev-middleware/src/inspector-proxy/types.js +++ b/packages/dev-middleware/src/inspector-proxy/types.js @@ -53,12 +53,16 @@ export type TargetCapabilityFlags = $ReadOnly<{ export type PageFromDevice = $ReadOnly<{ id: string, title: string, - vm: string, + /** @deprecated This is sent from legacy targets only */ + vm?: string, app: string, capabilities?: TargetCapabilityFlags, }>; -export type Page = Required; +export type Page = $ReadOnly<{ + ...PageFromDevice, + capabilities: $NonMaybeType, +}>; // Chrome Debugger Protocol message/event passed between device and debugger. export type WrappedEvent = $ReadOnly<{ @@ -116,7 +120,8 @@ export type PageDescription = $ReadOnly<{ // React Native specific fields deviceName: string, - vm: string, + /** @deprecated This is sent from legacy targets only */ + vm?: string, // React Native specific metadata reactNative: $ReadOnly<{ diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp index 5d9712d1b44a18..85cf1f1f069458 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp @@ -161,7 +161,6 @@ folly::dynamic InspectorPackagerConnection::Impl::pages() { pageDescription["id"] = std::to_string(page.id); pageDescription["title"] = page.title + " [C++ connection]"; pageDescription["app"] = app_; - pageDescription["vm"] = page.vm; pageDescription["capabilities"] = targetCapabilitiesToDynamic(page.capabilities); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp index 6cc8d87c66796c..db23471a638259 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/InspectorPackagerConnectionTest.cpp @@ -216,7 +216,6 @@ TEST_F(InspectorPackagerConnectionTest, TestGetPages) { ElementsAreArray({AllOf( AtJsonPtr("/app", Eq("my-app")), AtJsonPtr("/title", Eq("mock-title [C++ connection]")), - AtJsonPtr("/vm", Eq("mock-vm")), AtJsonPtr("/id", Eq(std::to_string(pageId))), AtJsonPtr("/capabilities/nativePageReloads", Eq(true)), AtJsonPtr(