C++ InspectorPackagerConnection: Indicate new implementation in /json response (#42200)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42200

Changelog: [Internal]

Quick hack to make it easy to determine whether a given build of React Native is using the C++ implementation of InspectorPackagerConnection or the legacy platform-specific implementation.

For now, we just append this information to the `title` field. Ultimately, rather than polluting the title, this should be an inert capability flag that gets reported via `inspector-proxy`. I'm not doing that yet since we have work in the pipeline to set up a proper capability flag system soon.

Reviewed By: huntie

Differential Revision: D52629415

fbshipit-source-id: a4e873f4be78ae49b35b94fd5d41d0e2efc02dbe
This commit is contained in:
Moti Zilberman
2024-01-10 06:48:03 -08:00
committed by Facebook GitHub Bot
parent 9525074a19
commit 4d22d02b77
2 changed files with 2 additions and 2 deletions
@@ -142,7 +142,7 @@ folly::dynamic InspectorPackagerConnection::Impl::pages() {
for (const auto& page : pages) {
array.push_back(folly::dynamic::object("id", std::to_string(page.id))(
"title", page.title)("app", app_)("vm", page.vm));
"title", page.title + " [C++ connection]")("app", app_)("vm", page.vm));
}
return array;
}
@@ -170,7 +170,7 @@ TEST_F(InspectorPackagerConnectionTest, TestGetPages) {
"/payload",
ElementsAreArray({AllOf(
AtJsonPtr("/app", Eq("my-app")),
AtJsonPtr("/title", Eq("mock-title")),
AtJsonPtr("/title", Eq("mock-title [C++ connection]")),
AtJsonPtr("/vm", Eq("mock-vm")),
AtJsonPtr("/id", Eq(std::to_string(pageId))))}))))))
.RetiresOnSaturation();