Delete dead bridge flag functions and module hooks (#59440)

Summary:

Remove the always-on TurboModule flag functions, the unread accessibility-manager flag, the uncalled `batchDidComplete` hook, and the unused `RCTJavaScriptCallback` typedef. Deprecate the ignored `newArchEnabled:` configuration initializers, which external clients still call.

Changelog:
[iOS][Removed] - Remove dead `RCTBridge` flag functions, `batchDidComplete`, and unused callback typedef

Reviewed By: zeyap

Differential Revision: D127294780

Pull Request resolved: https://github.com/react/react-native/pull/59440
This commit is contained in:
Christoph Purrer authored and GitHub committed 2026-10-27 18:10:09 +00:00
1 parent 7b8dee1c03
commit 01d55273bc
13 files changed
+18 -58

No files matched your search

@@ -104,11 +104,6 @@
#pragma mark - RCTArchConfiguratorProtocol
- (BOOL)newArchEnabled
{
return YES;
}
- (Class)getModuleClassFromName:(const char *)name
{
return nullptr;
@@ -289,7 +289,7 @@ static NSDictionary *RCTConvertConnectionOptionsToLaunchOptions(UISceneConnectio
};
RCTRootViewFactoryConfiguration *configuration =
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock newArchEnabled:YES];
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock];
configuration.customizeRootView = ^(UIView *_Nonnull rootView) {
[weakSelf.delegate customizeRootView:(RCTRootView *)rootView];
@@ -56,10 +56,16 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
* pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`.
*
*/
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
newArchEnabled:(BOOL)newArchEnabled NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled;
- (instancetype)initWithBundleURL:(NSURL *)bundleURL;
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
newArchEnabled:(BOOL)newArchEnabled
__deprecated_msg("The flag is ignored; use initWithBundleURLBlock:.");
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
newArchEnabled:(BOOL)newArchEnabled __deprecated_msg("The flag is ignored; use initWithBundleURL:.");
/**
* Block that allows to override logic of creating root view instance.
@@ -43,15 +43,6 @@ NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
*/
NSMutableArray<NSString *> *getModulesLoadedWithOldArch(void);
/**
* The New Architecture is enabled by default. These APIs are no-ops and will
* be removed in a future release.
*/
BOOL RCTTurboModuleEnabled(void)
__attribute__((deprecated("TurboModules are always enabled; this always returns YES (NO in test env).")));
void RCTEnableTurboModule(BOOL enabled)
__attribute__((deprecated("No-op. The New Architecture is enabled by default.")));
#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP
// Turn on TurboModule interop
BOOL RCTTurboModuleInteropEnabled(void);
@@ -64,9 +55,6 @@ BOOL RCTFabricInteropLayerEnabled(void);
void RCTEnableFabricInteropLayer(BOOL enabled);
#endif // RCT_REMOVE_LEGACY_COMPONENT_INTEROP
BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void);
void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain(BOOL enabled);
typedef enum {
kRCTBridgeProxyLoggingLevelNone,
kRCTBridgeProxyLoggingLevelWarning,
@@ -182,16 +182,6 @@ NSString *RCTBridgeModuleNameForClass(Class cls)
return RCTDropReactPrefixes(name);
}
BOOL RCTTurboModuleEnabled(void)
{
return YES;
}
void RCTEnableTurboModule(BOOL enabled)
{
// The new Architecture is enabled by default and we are ignoring changes to the TurboModule system.
}
#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP
static BOOL turboModuleInteropEnabled = NO;
BOOL RCTTurboModuleInteropEnabled(void)
@@ -228,17 +218,6 @@ void RCTSetTurboModuleInteropBridgeProxyLogLevel(RCTBridgeProxyLoggingLevel logL
bridgeProxyLoggingLevel = logLevel;
}
BOOL kDispatchAccessibilityManagerInitOntoMain = NO;
BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void)
{
return kDispatchAccessibilityManagerInitOntoMain;
}
void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain(BOOL enabled)
{
kDispatchAccessibilityManagerInitOntoMain = enabled;
}
@implementation RCTBridge
- (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions
{
@@ -402,11 +402,6 @@ RCT_EXTERN_C_END
*/
- (NSDictionary *)constantsToExport;
/**
* Notifies the module that a batch of JS method invocations has just completed.
*/
- (void)batchDidComplete RCT_DEPRECATED;
@end
/**
@@ -12,5 +12,3 @@
typedef void (^RCTJavaScriptCompleteBlock)(NSError *__strong)
__deprecated_msg("This api will be removed along with the bridge.");
typedef void (^RCTJavaScriptCallback)(__strong id, NSError *__strong)
__deprecated_msg("This api will be removed along with the bridge.");
@@ -22,7 +22,6 @@
#import <React/RCTFPSGraph.h>
#import <React/RCTInitializing.h>
#import <React/RCTInvalidating.h>
#import <React/RCTJavaScriptExecutor.h>
#import <React/RCTPerformanceLogger.h>
#import <React/RCTPerformanceLoggerLabels.h>
#import <React/RCTRootView.h>
@@ -22,10 +22,6 @@
#import <unordered_map>
#import <vector>
#define RCT_IS_TURBO_MODULE_CLASS(klass) \
((RCTTurboModuleEnabled() && [(klass) conformsToProtocol:@protocol(RCTTurboModule)]))
#define RCT_IS_TURBO_MODULE_INSTANCE(module) RCT_IS_TURBO_MODULE_CLASS([(module) class])
namespace facebook::react {
class CallbackWrapper;
@@ -1611,7 +1611,9 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
public virtual instancetype initWithBundleURL:(NSURL* bundleURL);
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
public virtual instancetype initWithBundleURLBlock:(RCTBundleURLBlock bundleURLBlock);
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
}
@@ -2545,7 +2547,6 @@ protocol RCTBridgeModule : public NSObject {
public virtual _Nullable NSArray<id<RCTBridgeMethod>>* methodsToExport();
public virtual static BOOL requiresMainQueueSetup();
public virtual static NSString* moduleName();
public virtual void batchDidComplete();
}
protocol RCTCallInvokerModule : public NSObject {
@@ -1654,7 +1654,9 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
public virtual instancetype initWithBundleURL:(NSURL* bundleURL);
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
public virtual instancetype initWithBundleURLBlock:(RCTBundleURLBlock bundleURLBlock);
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
}
@@ -2603,7 +2605,6 @@ protocol RCTBridgeModule : public NSObject {
public virtual _Nullable NSArray<id<RCTBridgeMethod>>* methodsToExport();
public virtual static BOOL requiresMainQueueSetup();
public virtual static NSString* moduleName();
public virtual void batchDidComplete();
}
protocol RCTCallInvokerModule : public NSObject {
@@ -1610,7 +1610,9 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
public virtual instancetype initWithBundleURL:(NSURL* bundleURL);
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
public virtual instancetype initWithBundleURLBlock:(RCTBundleURLBlock bundleURLBlock);
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
}
@@ -2538,7 +2540,6 @@ protocol RCTBridgeModule : public NSObject {
public virtual _Nullable NSArray<id<RCTBridgeMethod>>* methodsToExport();
public virtual static BOOL requiresMainQueueSetup();
public virtual static NSString* moduleName();
public virtual void batchDidComplete();
}
protocol RCTCallInvokerModule : public NSObject {
@@ -1611,7 +1611,9 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
public virtual instancetype initWithBundleURL:(NSURL* bundleURL);
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
public virtual instancetype initWithBundleURLBlock:(RCTBundleURLBlock bundleURLBlock);
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
}
@@ -2545,7 +2547,6 @@ protocol RCTBridgeModule : public NSObject {
public virtual _Nullable NSArray<id<RCTBridgeMethod>>* methodsToExport();
public virtual static BOOL requiresMainQueueSetup();
public virtual static NSString* moduleName();
public virtual void batchDidComplete();
}
protocol RCTCallInvokerModule : public NSObject {