From b1492eff5114cf5c3e4ea7c66d2eb782714a606f Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 29 Oct 2026 07:19:58 -0700 Subject: [PATCH 1/2] Delete dead RCTCxxBridgeDelegate protocol (#59441) Summary: The C++ bridge delegate protocol has no implementers left: its only method served the removed `RCTCxxBridge`. Delete the header with its build entry, the stale forward declaration, and the unused imports. Changelog: [iOS][Removed] - Remove unused `RCTCxxBridgeDelegate` protocol Reviewed By: zeyap Differential Revision: D127294781 --- .../AppDelegate/RCTRootViewFactory.h | 1 - .../React/CxxBridge/RCTCxxBridgeDelegate.h | 31 ------------------- .../api-snapshots/ReactAppleDebugCxx.api | 4 --- .../api-snapshots/ReactAppleFrameworksCxx.api | 4 --- .../api-snapshots/ReactAppleNewarchCxx.api | 4 --- .../api-snapshots/ReactAppleReleaseCxx.api | 4 --- 6 files changed, 48 deletions(-) delete mode 100644 packages/react-native/React/CxxBridge/RCTCxxBridgeDelegate.h diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h index e7af4bb09b6e..53ade7d6fef2 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h @@ -11,7 +11,6 @@ #import #import "RCTJSRuntimeConfiguratorProtocol.h" -@protocol RCTCxxBridgeDelegate; @protocol RCTComponentViewFactoryComponentProvider; @protocol RCTTurboModuleManagerDelegate; @protocol RCTHostDelegate; diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridgeDelegate.h b/packages/react-native/React/CxxBridge/RCTCxxBridgeDelegate.h deleted file mode 100644 index e2d48db4548d..000000000000 --- a/packages/react-native/React/CxxBridge/RCTCxxBridgeDelegate.h +++ /dev/null @@ -1,31 +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. - */ - -#include - -#import - -namespace facebook::react { - -class JSExecutorFactory; - -} // namespace facebook::react - -// This is a separate class so non-C++ implementations don't need to -// take a C++ dependency. - -@protocol RCTCxxBridgeDelegate - -/** - * In the RCTCxxBridge, if this method is implemented, return a - * ExecutorFactory instance which can be used to create the executor. - * If not implemented, or returns an empty pointer, JSIExecutorFactory - * will be used with a JSCRuntime. - */ -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge; - -@end diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index cb68d6c58bd7..0776b99ce483 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -2600,10 +2600,6 @@ protocol RCTCustomRefreshControlProtocol { public @property (weak) UIScrollView* scrollView; } -protocol RCTCxxBridgeDelegate : public RCTBridgeDelegate { - public virtual std::unique_ptr jsExecutorFactoryForBridge:(RCTBridge* bridge); -} - protocol RCTDebuggingOverlayViewProtocol : public NSObject { public virtual void clearElementsHighlights(); public virtual void highlightElements:(const NSArray* elements); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index b05f7665f7da..f627391bcd41 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -2662,10 +2662,6 @@ protocol RCTCustomRefreshControlProtocol { public @property (weak) UIScrollView* scrollView; } -protocol RCTCxxBridgeDelegate : public RCTBridgeDelegate { - public virtual std::unique_ptr jsExecutorFactoryForBridge:(RCTBridge* bridge); -} - protocol RCTDebuggingOverlayViewProtocol : public NSObject { public virtual void clearElementsHighlights(); public virtual void highlightElements:(const NSArray* elements); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 497a3a43a3ee..d444c92404a9 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -2593,10 +2593,6 @@ protocol RCTCustomRefreshControlProtocol { public @property (weak) UIScrollView* scrollView; } -protocol RCTCxxBridgeDelegate : public RCTBridgeDelegate { - public virtual std::unique_ptr jsExecutorFactoryForBridge:(RCTBridge* bridge); -} - protocol RCTDebuggingOverlayViewProtocol : public NSObject { public virtual void clearElementsHighlights(); public virtual void highlightElements:(const NSArray* elements); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 4f7774be13cd..0bf91e2cbebc 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -2600,10 +2600,6 @@ protocol RCTCustomRefreshControlProtocol { public @property (weak) UIScrollView* scrollView; } -protocol RCTCxxBridgeDelegate : public RCTBridgeDelegate { - public virtual std::unique_ptr jsExecutorFactoryForBridge:(RCTBridge* bridge); -} - protocol RCTDebuggingOverlayViewProtocol : public NSObject { public virtual void clearElementsHighlights(); public virtual void highlightElements:(const NSArray* elements); From 90aabf763c75cdade09dee2c792e6fc2f89dffb5 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 29 Oct 2026 07:19:58 -0700 Subject: [PATCH 2/2] Delete dead per-module RCTBridge accessors (#59443) Summary: Five module accessors on `RCTBridge` (`networking`, `webSocketModule`, `accessibilityManager`, `devSettings`, `imageStoreManager`) have no callers. Delete the bridge-side declarations and the last bridge-side implementation (`uiManager`, whose proxy implementation stays). Deprecate `devMenu`, which external clients still use. Changelog: [iOS][Removed] - Remove unused per-module `RCTBridge` accessors Reviewed By: cipolleschi Differential Revision: D127294783 --- .../Libraries/Image/RCTImageStoreManager.h | 6 ------ .../Libraries/Network/RCTNetworking.h | 6 ------ .../CoreModules/RCTAccessibilityManager.h | 6 ------ .../React/CoreModules/RCTDevMenu.h | 3 ++- .../React/CoreModules/RCTDevSettings.h | 6 ------ .../React/CoreModules/RCTWebSocketModule.h | 6 ------ .../React/Modules/RCTUIManager.mm | 9 --------- .../api-snapshots/ReactAppleDebugCxx.api | 20 ------------------- .../api-snapshots/ReactAppleFrameworksCxx.api | 20 ------------------- .../api-snapshots/ReactAppleNewarchCxx.api | 20 ------------------- .../api-snapshots/ReactAppleReleaseCxx.api | 20 ------------------- 11 files changed, 2 insertions(+), 120 deletions(-) diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.h b/packages/react-native/Libraries/Image/RCTImageStoreManager.h index 61f324d51cd4..87cd99a3ed61 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.h +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.h @@ -40,12 +40,6 @@ @end -@interface RCTBridge (RCTImageStoreManager) - -@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; - -@end - @interface RCTBridgeProxy (RCTImageStoreManager) @property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; diff --git a/packages/react-native/Libraries/Network/RCTNetworking.h b/packages/react-native/Libraries/Network/RCTNetworking.h index 430c94f582e7..f6e1313296b6 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.h +++ b/packages/react-native/Libraries/Network/RCTNetworking.h @@ -61,12 +61,6 @@ @end -@interface RCTBridge (RCTNetworking) - -@property (nonatomic, readonly) RCTNetworking *networking; - -@end - @interface RCTBridgeProxy (RCTNetworking) @property (nonatomic, readonly) RCTNetworking *networking; diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.h b/packages/react-native/React/CoreModules/RCTAccessibilityManager.h index e2063e67c885..734b5fd39ced 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.h +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.h @@ -32,12 +32,6 @@ extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; / @end -@interface RCTBridge (RCTAccessibilityManager) - -@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; - -@end - @interface RCTBridgeProxy (RCTAccessibilityManager) @property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.h b/packages/react-native/React/CoreModules/RCTDevMenu.h index 976cb8c517b5..ab6132f0a442 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.h +++ b/packages/react-native/React/CoreModules/RCTDevMenu.h @@ -137,7 +137,8 @@ typedef NSString * (^RCTDevMenuItemTitleBlock)(void); */ @interface RCTBridge (RCTDevMenu) -@property (nonatomic, readonly) RCTDevMenu *devMenu; +@property (nonatomic, readonly) RCTDevMenu *devMenu __deprecated_msg( + "Access RCTDevMenu through the bridge proxy instead; this accessor will be removed."); @end diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.h b/packages/react-native/React/CoreModules/RCTDevSettings.h index cffe380b9355..421b3d252948 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.h +++ b/packages/react-native/React/CoreModules/RCTDevSettings.h @@ -142,12 +142,6 @@ typedef void (^RCTConnectedHandler)(void); @end -@interface RCTBridge (RCTDevSettings) - -@property (nonatomic, readonly) RCTDevSettings *devSettings; - -@end - @interface RCTBridgeProxy (RCTDevSettings) @property (nonatomic, readonly) RCTDevSettings *devSettings; diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.h b/packages/react-native/React/CoreModules/RCTWebSocketModule.h index 0deba70671ff..c0e240f10020 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.h +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.h @@ -33,12 +33,6 @@ RCT_EXTERN void RCTSetCustomSRWebSocketProvider(SRWebSocketProvider provider); @end -@interface RCTBridge (RCTWebSocketModule) - -- (RCTWebSocketModule *)webSocketModule; - -@end - @interface RCTBridgeProxy (RCTWebSocketModule) - (RCTWebSocketModule *)webSocketModule; diff --git a/packages/react-native/React/Modules/RCTUIManager.mm b/packages/react-native/React/Modules/RCTUIManager.mm index 1ab3804b0398..6bacf3f711d4 100644 --- a/packages/react-native/React/Modules/RCTUIManager.mm +++ b/packages/react-native/React/Modules/RCTUIManager.mm @@ -220,15 +220,6 @@ - (void)invalidate @end -@implementation RCTBridge (RCTUIManager) - -- (RCTUIManager *)uiManager -{ - return [self moduleForClass:[RCTUIManager class]]; -} - -@end - UIView *RCTPaperViewOrCurrentView(UIView *view) { if ([view respondsToSelector:@selector(paperView)]) { diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 0776b99ce483..d9ff8771cc19 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -10,18 +10,10 @@ category RCTBridge(Inspector) { public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget; } -category RCTBridge(RCTAccessibilityManager) { - public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; -} - category RCTBridge(RCTDevMenu) { public @property (assign, readonly) RCTDevMenu* devMenu; } -category RCTBridge(RCTDevSettings) { - public @property (assign, readonly) RCTDevSettings* devSettings; -} - category RCTBridge(RCTEventDispatcher) { public virtual id eventDispatcher(); } @@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTImageStoreManager) { - public @property (assign, readonly) RCTImageStoreManager* imageStoreManager; -} - -category RCTBridge(RCTNetworking) { - public @property (assign, readonly) RCTNetworking* networking; -} - category RCTBridge(RCTSurfacePresenterStub) { public virtual id surfacePresenter(); public virtual void setSurfacePresenter:(id presenter); @@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } -category RCTBridge(RCTWebSocketModule) { - public virtual RCTWebSocketModule* webSocketModule(); -} - category RCTBridgeProxy(Cxx) { public @property (assign) std::shared_ptr jsCallInvoker; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index f627391bcd41..8936dd210b9c 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -10,18 +10,10 @@ category RCTBridge(Inspector) { public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget; } -category RCTBridge(RCTAccessibilityManager) { - public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; -} - category RCTBridge(RCTDevMenu) { public @property (assign, readonly) RCTDevMenu* devMenu; } -category RCTBridge(RCTDevSettings) { - public @property (assign, readonly) RCTDevSettings* devSettings; -} - category RCTBridge(RCTEventDispatcher) { public virtual id eventDispatcher(); } @@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTImageStoreManager) { - public @property (assign, readonly) RCTImageStoreManager* imageStoreManager; -} - -category RCTBridge(RCTNetworking) { - public @property (assign, readonly) RCTNetworking* networking; -} - category RCTBridge(RCTSurfacePresenterStub) { public virtual id surfacePresenter(); public virtual void setSurfacePresenter:(id presenter); @@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } -category RCTBridge(RCTWebSocketModule) { - public virtual RCTWebSocketModule* webSocketModule(); -} - category RCTBridgeProxy(Cxx) { public @property (assign) std::shared_ptr jsCallInvoker; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index d444c92404a9..58b2790816be 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -10,18 +10,10 @@ category RCTBridge(Inspector) { public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget; } -category RCTBridge(RCTAccessibilityManager) { - public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; -} - category RCTBridge(RCTDevMenu) { public @property (assign, readonly) RCTDevMenu* devMenu; } -category RCTBridge(RCTDevSettings) { - public @property (assign, readonly) RCTDevSettings* devSettings; -} - category RCTBridge(RCTEventDispatcher) { public virtual id eventDispatcher(); } @@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTImageStoreManager) { - public @property (assign, readonly) RCTImageStoreManager* imageStoreManager; -} - -category RCTBridge(RCTNetworking) { - public @property (assign, readonly) RCTNetworking* networking; -} - category RCTBridge(RCTSurfacePresenterStub) { public virtual id surfacePresenter(); public virtual void setSurfacePresenter:(id presenter); @@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } -category RCTBridge(RCTWebSocketModule) { - public virtual RCTWebSocketModule* webSocketModule(); -} - category RCTBridgeProxy(Cxx) { public @property (assign) std::shared_ptr jsCallInvoker; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 0bf91e2cbebc..6ddcd9a6f9bd 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -10,18 +10,10 @@ category RCTBridge(Inspector) { public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget; } -category RCTBridge(RCTAccessibilityManager) { - public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager; -} - category RCTBridge(RCTDevMenu) { public @property (assign, readonly) RCTDevMenu* devMenu; } -category RCTBridge(RCTDevSettings) { - public @property (assign, readonly) RCTDevSettings* devSettings; -} - category RCTBridge(RCTEventDispatcher) { public virtual id eventDispatcher(); } @@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTImageStoreManager) { - public @property (assign, readonly) RCTImageStoreManager* imageStoreManager; -} - -category RCTBridge(RCTNetworking) { - public @property (assign, readonly) RCTNetworking* networking; -} - category RCTBridge(RCTSurfacePresenterStub) { public virtual id surfacePresenter(); public virtual void setSurfacePresenter:(id presenter); @@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } -category RCTBridge(RCTWebSocketModule) { - public virtual RCTWebSocketModule* webSocketModule(); -} - category RCTBridgeProxy(Cxx) { public @property (assign) std::shared_ptr jsCallInvoker; }