Skip to content

Commit

Permalink
Remove FuseboxClient CDP domain (#48004)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #48004

Follows #47962 and depends on facebookexperimental/rn-chrome-devtools-frontend#139.

Updates the modern debugger server to no longer respond to `FuseboxClient` messages — namely `FuseboxClient.setClientMetadata`. This method is replaced by `ReactNativeApplication.enable` for identifying the React Native DevTools frontend.

Changelog:
[General][Breaking] - The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`.

Reviewed By: rubennorte

Differential Revision: D66575324

fbshipit-source-id: f2b4cbacd857931832d89305510f5aaf51df483a
  • Loading branch information
huntie authored and facebook-github-bot committed Dec 2, 2024
1 parent 72bb2f4 commit 1a9780f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
14 changes: 0 additions & 14 deletions packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ void HostAgent::handleRequest(const cdp::PreparsedRequest& req) {
.message = message,
});

shouldSendOKResponse = true;
isFinishedHandlingRequest = true;
} else if (req.method == "FuseboxClient.setClientMetadata") {
fuseboxClientType_ = FuseboxClientType::Fusebox;

if (sessionState_.isLogDomainEnabled) {
sendFuseboxNotice();
}

shouldSendOKResponse = true;
isFinishedHandlingRequest = true;
} else if (req.method == "ReactNativeApplication.enable") {
Expand Down Expand Up @@ -192,16 +183,11 @@ HostAgent::~HostAgent() {
}

void HostAgent::sendFuseboxNotice() {
if (fuseboxNoticeLogged_) {
return;
}

static constexpr auto kFuseboxNotice =
ANSI_COLOR_BG_YELLOW "Welcome to " ANSI_WEIGHT_BOLD
"React Native DevTools" ANSI_WEIGHT_RESET ""sv;

sendInfoLogEntry(kFuseboxNotice);
fuseboxNoticeLogged_ = true;
}

void HostAgent::sendNonFuseboxNotice() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class HostAgent final {
const HostTargetMetadata hostMetadata_;
std::shared_ptr<InstanceAgent> instanceAgent_;
FuseboxClientType fuseboxClientType_{FuseboxClientType::Unknown};
bool fuseboxNoticeLogged_{false};
bool isPausedInDebuggerOverlayVisible_{false};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,6 @@ TYPED_TEST(JsiIntegrationPortableTest, ExceptionDuringAddBindingIsIgnored) {
EXPECT_TRUE(this->eval("globalThis.foo === 42").getBool());
}

TYPED_TEST(JsiIntegrationPortableTest, FuseboxSetClientMetadata) {
this->connect();

this->expectMessageFromPage(JsonEq(R"({
"id": 1,
"result": {}
})"));

this->toPage_->sendMessage(R"({
"id": 1,
"method": "FuseboxClient.setClientMetadata",
"params": {}
})");
}

TYPED_TEST(JsiIntegrationPortableTest, ReactNativeApplicationEnable) {
this->connect();

Expand Down

0 comments on commit 1a9780f

Please sign in to comment.