From 637a6ac4891b85cb5abc92067fa4685b5b79adbd Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 30 Oct 2026 14:54:20 -0700 Subject: [PATCH] Delete deprecated RCTBridge initializers (#59434) Summary: Both `RCTBridge` initializers return an inert stub and have no callers left now that the test harness is gone. Delete the declarations and stub implementations. `RCTBridgeModuleListProvider` stays until the proxy shim using it is removed. Changelog: [iOS][Removed] - Remove deprecated `RCTBridge` initializers Reviewed By: andrewdacenko Differential Revision: D127294773 --- packages/react-native/React/Base/RCTBridge.h | 28 ------------------- packages/react-native/React/Base/RCTBridge.mm | 12 -------- .../api-snapshots/ReactAppleDebugCxx.api | 2 -- .../api-snapshots/ReactAppleFrameworksCxx.api | 2 -- .../api-snapshots/ReactAppleNewarchCxx.api | 2 -- .../api-snapshots/ReactAppleReleaseCxx.api | 2 -- 6 files changed, 48 deletions(-) diff --git a/packages/react-native/React/Base/RCTBridge.h b/packages/react-native/React/Base/RCTBridge.h index 4ccf2a62bf9..934e96ab164 100644 --- a/packages/react-native/React/Base/RCTBridge.h +++ b/packages/react-native/React/Base/RCTBridge.h @@ -85,34 +85,6 @@ RCT_EXTERN_C_END */ @interface RCTBridge : NSObject -/** - * Creates a new bridge with a custom RCTBridgeDelegate. - * - * All the interaction with the JavaScript context should be done using the bridge - * instance of the RCTBridgeModules. Modules will be automatically instantiated - * using the default constructor, but you can optionally pass in an array of - * pre-initialized module instances if they require additional init parameters - * or configuration. - */ -- (instancetype)initWithDelegate:(id)delegate - launchOptions:(NSDictionary *)launchOptions - __deprecated_msg("This API will be removed along with the legacy architecture."); - -/** - * DEPRECATED: Use initWithDelegate:launchOptions: instead - * - * The designated initializer. This creates a new bridge on top of the specified - * executor. The bridge should then be used for all subsequent communication - * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default constructor, but you can optionally pass in an - * array of pre-initialized module instances if they require additional init - * parameters or configuration. - */ -- (instancetype)initWithBundleURL:(NSURL *)bundleURL - moduleProvider:(RCTBridgeModuleListProvider)block - launchOptions:(NSDictionary *)launchOptions - __deprecated_msg("This API will be removed along with the legacy architecture."); - /** * This method registers the file path of an additional JS segment by its ID. * diff --git a/packages/react-native/React/Base/RCTBridge.mm b/packages/react-native/React/Base/RCTBridge.mm index 93d5bd2344d..71ca2e68fda 100644 --- a/packages/react-native/React/Base/RCTBridge.mm +++ b/packages/react-native/React/Base/RCTBridge.mm @@ -219,18 +219,6 @@ void RCTSetTurboModuleInteropBridgeProxyLogLevel(RCTBridgeProxyLoggingLevel logL } @implementation RCTBridge -- (instancetype)initWithDelegate:(id)delegate launchOptions:(NSDictionary *)launchOptions -{ - return self; -} - -- (instancetype)initWithBundleURL:(NSURL *)bundleURL - moduleProvider:(__strong RCTBridgeModuleListProvider)block - launchOptions:(NSDictionary *)launchOptions -{ - return self; -} - - (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path { } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 101ef554362..5caf6dc5cbc 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -660,8 +660,6 @@ interface RCTBridge : public NSObject { public virtual id moduleForClass:(Class moduleClass); public virtual id moduleForName:(NSString* moduleName); public virtual id moduleForName:lazilyLoadIfNecessary:(NSString* moduleName, BOOL lazilyLoad); - public virtual instancetype initWithBundleURL:moduleProvider:launchOptions:(NSURL* bundleURL, RCTBridgeModuleListProvider block, NSDictionary* launchOptions); - public virtual instancetype initWithDelegate:launchOptions:(id delegate, NSDictionary* launchOptions); public virtual void onFastRefresh(); public virtual void registerSegmentWithId:path:(NSUInteger segmentId, NSString* path); public virtual void setRCTTurboModuleRegistry:(id turboModuleRegistry); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index ac0ccfc0ab5..70e34c95f2c 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -669,8 +669,6 @@ interface RCTBridge : public NSObject { public virtual id moduleForClass:(Class moduleClass); public virtual id moduleForName:(NSString* moduleName); public virtual id moduleForName:lazilyLoadIfNecessary:(NSString* moduleName, BOOL lazilyLoad); - public virtual instancetype initWithBundleURL:moduleProvider:launchOptions:(NSURL* bundleURL, RCTBridgeModuleListProvider block, NSDictionary* launchOptions); - public virtual instancetype initWithDelegate:launchOptions:(id delegate, NSDictionary* launchOptions); public virtual void onFastRefresh(); public virtual void registerSegmentWithId:path:(NSUInteger segmentId, NSString* path); public virtual void setRCTTurboModuleRegistry:(id turboModuleRegistry); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index a396e261d86..2dc07a34551 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -660,8 +660,6 @@ interface RCTBridge : public NSObject { public virtual id moduleForClass:(Class moduleClass); public virtual id moduleForName:(NSString* moduleName); public virtual id moduleForName:lazilyLoadIfNecessary:(NSString* moduleName, BOOL lazilyLoad); - public virtual instancetype initWithBundleURL:moduleProvider:launchOptions:(NSURL* bundleURL, RCTBridgeModuleListProvider block, NSDictionary* launchOptions); - public virtual instancetype initWithDelegate:launchOptions:(id delegate, NSDictionary* launchOptions); public virtual void onFastRefresh(); public virtual void registerSegmentWithId:path:(NSUInteger segmentId, NSString* path); public virtual void setRCTTurboModuleRegistry:(id turboModuleRegistry); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 1255a7730e0..3f5ae401167 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -660,8 +660,6 @@ interface RCTBridge : public NSObject { public virtual id moduleForClass:(Class moduleClass); public virtual id moduleForName:(NSString* moduleName); public virtual id moduleForName:lazilyLoadIfNecessary:(NSString* moduleName, BOOL lazilyLoad); - public virtual instancetype initWithBundleURL:moduleProvider:launchOptions:(NSURL* bundleURL, RCTBridgeModuleListProvider block, NSDictionary* launchOptions); - public virtual instancetype initWithDelegate:launchOptions:(id delegate, NSDictionary* launchOptions); public virtual void onFastRefresh(); public virtual void registerSegmentWithId:path:(NSUInteger segmentId, NSString* path); public virtual void setRCTTurboModuleRegistry:(id turboModuleRegistry);