From 6a1e6af8eee99cd7af11f9e048df1c85cede460e Mon Sep 17 00:00:00 2001 From: Ryan Stelly Date: Mon, 11 May 2026 09:40:59 -0500 Subject: [PATCH] add worklets patch for extra react native host preventing profiling (#3604) --- patches/react-native-worklets+0.7.4.patch | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/react-native-worklets+0.7.4.patch diff --git a/patches/react-native-worklets+0.7.4.patch b/patches/react-native-worklets+0.7.4.patch new file mode 100644 index 000000000..5429f1fc4 --- /dev/null +++ b/patches/react-native-worklets+0.7.4.patch @@ -0,0 +1,28 @@ +diff --git a/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp b/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +index 22388b6..48fe9ae 100644 +--- a/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp ++++ b/node_modules/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +@@ -63,8 +63,11 @@ WorkletHermesRuntime::WorkletHermesRuntime( + const std::string &name) + : jsi::WithRuntimeDecorator(*runtime, reentrancyCheck_), runtime_(std::move(runtime)) { + #if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +- auto adapter = std::make_unique(*runtime_, jsQueue); +- debugToken_ = chrome::enableDebugging(std::move(adapter), name); ++ // Skip worklet debug target registration to avoid RN 0.83.5+ false-positive ++ // "multiple React Native hosts" in DevTools, which disables Network and ++ // Performance tabs. See react-native-community/discussions-and-proposals#954. ++ (void)jsQueue; ++ (void)name; + #endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) + + #ifndef NDEBUG +@@ -92,8 +95,7 @@ WorkletHermesRuntime::WorkletHermesRuntime( + + WorkletHermesRuntime::~WorkletHermesRuntime() { + #if HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) +- // We have to disable debugging before the runtime is destroyed. +- chrome::disableDebugging(debugToken_); ++ // Paired with skipped enableDebugging above. + #endif // HERMES_ENABLE_DEBUGGER && !defined(HERMES_V1_ENABLED) + } +