From 74d6b184486a775279b7a52f271f3dd607847031 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 30 Oct 2026 12:19:26 -0700 Subject: [PATCH] Delete orphan RCTBridgeProxy shims (#59444) Summary: Remove proxy shims whose declarations were deleted from private headers (`parentBridge`, `moduleProvider`, `moduleSetupComplete`, `updateModuleWithInstance:`, profiling, `callNativeModule`, `logMessage`, `_immediatelyCallTimer:`) and never-declared ones (`object`, write-only `jsCallInvoker`). Keep `batchedBridge`, `bridgeDescription`, and `runtime`: Expo and Reanimated still call them. Shims backing deleted public API stay as runtime nets. Changelog: [Internal] Reviewed By: andrewdacenko Differential Revision: D127294703 --- packages/react-native/React/Base/RCTBridge.h | 10 --- .../React/Base/RCTBridgeProxy+Cxx.h | 20 ----- .../react-native/React/Base/RCTBridgeProxy.mm | 79 ------------------- .../platform/ios/ReactCommon/RCTInstance.mm | 2 - .../api-snapshots/ReactAppleDebugCxx.api | 4 - .../api-snapshots/ReactAppleFrameworksCxx.api | 4 - .../api-snapshots/ReactAppleNewarchCxx.api | 4 - .../api-snapshots/ReactAppleReleaseCxx.api | 4 - 8 files changed, 127 deletions(-) delete mode 100644 packages/react-native/React/Base/RCTBridgeProxy+Cxx.h diff --git a/packages/react-native/React/Base/RCTBridge.h b/packages/react-native/React/Base/RCTBridge.h index d09cdeed3edd..43e28b2a60ae 100644 --- a/packages/react-native/React/Base/RCTBridge.h +++ b/packages/react-native/React/Base/RCTBridge.h @@ -21,16 +21,6 @@ @class RCTBridge; @class RCTPerformanceLogger; -/** - * This block can be used to instantiate modules that require additional - * init parameters, or additional configuration prior to being used. - * The bridge will call this block to instantiate the modules, and will - * be responsible for invalidating/releasing them when the bridge is destroyed. - * For this reason, the block should always return new module instances, and - * module instances should not be shared between bridges. - */ -typedef NSArray> * (^RCTBridgeModuleListProvider)(void); - RCT_EXTERN_C_BEGIN /** diff --git a/packages/react-native/React/Base/RCTBridgeProxy+Cxx.h b/packages/react-native/React/Base/RCTBridgeProxy+Cxx.h deleted file mode 100644 index d54521260c9a..000000000000 --- a/packages/react-native/React/Base/RCTBridgeProxy+Cxx.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#ifdef __cplusplus -#import -#endif - -#import "RCTBridgeProxy.h" - -@interface RCTBridgeProxy (Cxx) - -#ifdef __cplusplus -@property (nonatomic, readwrite) std::shared_ptr jsCallInvoker; -#endif - -@end diff --git a/packages/react-native/React/Base/RCTBridgeProxy.mm b/packages/react-native/React/Base/RCTBridgeProxy.mm index 105683fbc4ad..fcc6bb885a6e 100644 --- a/packages/react-native/React/Base/RCTBridgeProxy.mm +++ b/packages/react-native/React/Base/RCTBridgeProxy.mm @@ -6,13 +6,11 @@ */ #import "RCTBridgeProxy.h" -#import "RCTBridgeProxy+Cxx.h" #import #import #import #import -#import #import using namespace facebook; @@ -24,12 +22,6 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; - (void)forwardInvocation:(NSInvocation *)invocation; @end -@interface RCTBridgeProxy () - -@property (nonatomic, readwrite) std::shared_ptr jsCallInvoker; - -@end - @implementation RCTBridgeProxy { RCTUIManagerProxy *_uiManagerProxy; RCTModuleRegistry *_moduleRegistry; @@ -102,12 +94,6 @@ - (void *)runtime return _runtime; } -- (std::shared_ptr)jsCallInvoker -{ - [self logWarning:@"Please migrate to RuntimeExecutor" cmd:_cmd]; - return _jsCallInvoker; -} - /** * RCTModuleRegistry */ @@ -262,40 +248,11 @@ - (RCTBridge *)batchedBridge return (RCTBridge *)self; } -- (void)setBatchedBridge -{ - [self logError:@"This method is not supported. No-oping." cmd:_cmd]; -} - -- (RCTBridgeModuleListProvider)moduleProvider -{ - [self logWarning:@"This method is not supported. Returning empty block" cmd:_cmd]; - return ^{ - return @[]; - }; -} - - (RCTModuleRegistry *)moduleRegistry { return _moduleRegistry; } -/** - * RCTBridge (RCTCxxBridge) - */ - -- (RCTBridge *)parentBridge -{ - [self logWarning:@"This method is not supported. Returning bridge proxy." cmd:_cmd]; - return (RCTBridge *)self; -} - -- (BOOL)moduleSetupComplete -{ - [self logWarning:@"This method is not supported. Returning YES." cmd:_cmd]; - return YES; -} - - (void)registerAdditionalModuleClasses:(NSArray *)newModules { [self @@ -304,37 +261,6 @@ - (void)registerAdditionalModuleClasses:(NSArray *)newModules cmd:_cmd]; } -- (void)updateModuleWithInstance:(id)instance -{ - [self logError:@"This method is not supported. Nooping." cmd:_cmd]; -} - -- (void)startProfiling -{ - [self logWarning:@"This method is not supported. Nooping." cmd:_cmd]; -} - -- (void)stopProfiling:(void (^)(NSData *))callback -{ - [self logWarning:@"This method is not supported. Nooping." cmd:_cmd]; -} - -- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params -{ - [self logError:@"This method is not supported. Nooping and returning nil." cmd:_cmd]; - return nil; -} - -- (void)logMessage:(NSString *)message level:(NSString *)level -{ - [self logWarning:@"This method is not supported. Nooping." cmd:_cmd]; -} - -- (void)_immediatelyCallTimer:(NSNumber *)timer -{ - [self logWarning:@"This method is not supported. Nooping." cmd:_cmd]; -} - /** * RCTBridge (Inspector) */ @@ -352,11 +278,6 @@ - (RCTUIManager *)uiManager return (RCTUIManager *)_uiManagerProxy; } -- (RCTBridgeProxy *)object -{ - return self; -} - /** * NSProxy setup */ diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index fc0f82d267b2..41fdec38a3e2 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -16,7 +16,6 @@ #import #import #import -#import #import #import #import @@ -324,7 +323,6 @@ - (void)_start } runtime:_reactInstance->getJavaScriptContext() launchOptions:_launchOptions]; - bridgeProxy.jsCallInvoker = jsCallInvoker; bridgeProxy.performanceLogger = _performanceLogger; _bridgeProxy = bridgeProxy; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index cb68d6c58bd7..7fe4fb084899 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) { public virtual RCTWebSocketModule* webSocketModule(); } -category RCTBridgeProxy(Cxx) { - public @property (assign) std::shared_ptr jsCallInvoker; -} - category RCTBridgeProxy(RCTAccessibilityManager) { public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index b05f7665f7da..d239517ac7ec 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) { public virtual RCTWebSocketModule* webSocketModule(); } -category RCTBridgeProxy(Cxx) { - public @property (assign) std::shared_ptr jsCallInvoker; -} - category RCTBridgeProxy(RCTAccessibilityManager) { public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 497a3a43a3ee..4c0d2e5ae120 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) { public virtual RCTWebSocketModule* webSocketModule(); } -category RCTBridgeProxy(Cxx) { - public @property (assign) std::shared_ptr jsCallInvoker; -} - category RCTBridgeProxy(RCTAccessibilityManager) { public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 4f7774be13cd..c77ea430d23b 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) { public virtual RCTWebSocketModule* webSocketModule(); } -category RCTBridgeProxy(Cxx) { - public @property (assign) std::shared_ptr jsCallInvoker; -} - category RCTBridgeProxy(RCTAccessibilityManager) { public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; }