From 703e36210dcc43c8061ba7aa47ae3fc2f1ce3b0d Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 6 Jul 2026 07:43:37 -0700 Subject: [PATCH] Narrow nativemodule/core cxxreact dep to tracesection + module (#57445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/react/react-native/pull/57445 Drop the broad `cxxreact:bridge` dep from `nativemodule/core` in favor of the narrower pieces it actually needs: `cxxreact:tracesection` for `TraceSection.h`, plus the already-present `cxxreact:module`. Also extracts `MoveWrapper` to `react/utils/MoveWrapper.h` (a tiny stdlib-only utility) — it was previously living in `cxxreact:bridge` and is the one source-level dep that prevented the narrowing. The cxxreact copy remains in place (out of scope for this diff) but `JavaTurboModule.cpp` now uses the new location. Cleanup: drops dead `exclude_patterns` for `CallbackWrapper.h` / `LongLivedObject.h` from `exported_headers` (those files no longer exist) and collapses multi-line glob formatting. Verified with `buck2 uquery 'somepath(...:coreAndroid, ...:cxxreact:bridgeAndroid)'` — no path; the edge is gone. Changelog: [Internal] Reviewed By: zeyap Differential Revision: D108786500 fbshipit-source-id: aa5340c3c4c6ac4889c6945b5c1d6f02da02269a --- .../react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp | 3 ++- .../core/platform/android/ReactCommon/JavaTurboModule.cpp | 2 +- .../ReactCommon/{cxxreact => react/utils}/MoveWrapper.h | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename packages/react-native/ReactCommon/{cxxreact => react/utils}/MoveWrapper.h (100%) diff --git a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp index 64aa6d640e6..ddfb8836af4 100644 --- a/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp +++ b/packages/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp @@ -21,10 +21,11 @@ #include "MessageQueueThread.h" #include "MethodCall.h" #include "ModuleRegistry.h" -#include "MoveWrapper.h" #include "RAMBundleRegistry.h" #include "TraceSection.h" +#include + #include #include diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp b/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp index 5c9b464a8c3..6b5c024a092 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp @@ -8,11 +8,11 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/packages/react-native/ReactCommon/cxxreact/MoveWrapper.h b/packages/react-native/ReactCommon/react/utils/MoveWrapper.h similarity index 100% rename from packages/react-native/ReactCommon/cxxreact/MoveWrapper.h rename to packages/react-native/ReactCommon/react/utils/MoveWrapper.h