Skip to content

Commit 574e923

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Delete dead bridge flag functions and module hooks
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 Differential Revision: D127294780
1 parent 48c3aeb commit 574e923

13 files changed

Lines changed: 5 additions & 57 deletions

File tree

‎packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ - (void)hostDidStart:(RCTHost *)host
105105

106106
#pragma mark - RCTArchConfiguratorProtocol
107107

108-
- (BOOL)newArchEnabled
109-
{
110-
return YES;
111-
}
112-
113108
- (Class)getModuleClassFromName:(const char *)name
114109
{
115110
return nullptr;

‎packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ - (RCTRootViewFactory *)createRCTRootViewFactory
289289
};
290290

291291
RCTRootViewFactoryConfiguration *configuration =
292-
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock newArchEnabled:YES];
292+
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock];
293293

294294
configuration.customizeRootView = ^(UIView *_Nonnull rootView) {
295295
[weakSelf.delegate customizeRootView:(RCTRootView *)rootView];

‎packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ typedef void (^RCTLoadSourceForBridgeWithProgressBlock)(
5656
*
5757
*/
5858
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
59-
newArchEnabled:(BOOL)newArchEnabled NS_DESIGNATED_INITIALIZER;
59+
newArchEnabled:(BOOL)newArchEnabled NS_DESIGNATED_INITIALIZER
60+
__deprecated_msg("The flag is ignored; use initWithBundleURLBlock:.");
6061

61-
- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled;
62+
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
63+
newArchEnabled:(BOOL)newArchEnabled __deprecated_msg("The flag is ignored; use initWithBundleURL:.");
6264

6365
/**
6466
* Block that allows to override logic of creating root view instance.

‎packages/react-native/React/Base/RCTBridge.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
4343
*/
4444
NSMutableArray<NSString *> *getModulesLoadedWithOldArch(void);
4545

46-
/**
47-
* The New Architecture is enabled by default. These APIs are no-ops and will
48-
* be removed in a future release.
49-
*/
50-
BOOL RCTTurboModuleEnabled(void)
51-
__attribute__((deprecated("TurboModules are always enabled; this always returns YES (NO in test env).")));
52-
void RCTEnableTurboModule(BOOL enabled)
53-
__attribute__((deprecated("No-op. The New Architecture is enabled by default.")));
54-
5546
#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP
5647
// Turn on TurboModule interop
5748
BOOL RCTTurboModuleInteropEnabled(void);
@@ -64,9 +55,6 @@ BOOL RCTFabricInteropLayerEnabled(void);
6455
void RCTEnableFabricInteropLayer(BOOL enabled);
6556
#endif // RCT_REMOVE_LEGACY_COMPONENT_INTEROP
6657

67-
BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void);
68-
void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain(BOOL enabled);
69-
7058
typedef enum {
7159
kRCTBridgeProxyLoggingLevelNone,
7260
kRCTBridgeProxyLoggingLevelWarning,

‎packages/react-native/React/Base/RCTBridge.mm‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,6 @@ void RCTRegisterModule(Class moduleClass)
181181
return RCTDropReactPrefixes(name);
182182
}
183183

184-
BOOL RCTTurboModuleEnabled(void)
185-
{
186-
return YES;
187-
}
188-
189-
void RCTEnableTurboModule(BOOL enabled)
190-
{
191-
// The new Architecture is enabled by default and we are ignoring changes to the TurboModule system.
192-
}
193-
194184
#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP
195185
static BOOL turboModuleInteropEnabled = NO;
196186
BOOL RCTTurboModuleInteropEnabled(void)
@@ -227,17 +217,6 @@ void RCTSetTurboModuleInteropBridgeProxyLogLevel(RCTBridgeProxyLoggingLevel logL
227217
bridgeProxyLoggingLevel = logLevel;
228218
}
229219

230-
BOOL kDispatchAccessibilityManagerInitOntoMain = NO;
231-
BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain(void)
232-
{
233-
return kDispatchAccessibilityManagerInitOntoMain;
234-
}
235-
236-
void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain(BOOL enabled)
237-
{
238-
kDispatchAccessibilityManagerInitOntoMain = enabled;
239-
}
240-
241220
@implementation RCTBridge
242221
- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path
243222
{

‎packages/react-native/React/Base/RCTBridgeModule.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,6 @@ RCT_EXTERN_C_END
402402
*/
403403
- (NSDictionary *)constantsToExport;
404404

405-
/**
406-
* Notifies the module that a batch of JS method invocations has just completed.
407-
*/
408-
- (void)batchDidComplete RCT_DEPRECATED;
409-
410405
@end
411406

412407
/**

‎packages/react-native/React/Base/RCTJavaScriptExecutor.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@
1212

1313
typedef void (^RCTJavaScriptCompleteBlock)(NSError *__strong)
1414
__deprecated_msg("This api will be removed along with the bridge.");
15-
typedef void (^RCTJavaScriptCallback)(__strong id, NSError *__strong)
16-
__deprecated_msg("This api will be removed along with the bridge.");

‎packages/react-native/React/CoreModules/RCTPerfMonitor.mm‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#import <React/RCTFPSGraph.h>
2323
#import <React/RCTInitializing.h>
2424
#import <React/RCTInvalidating.h>
25-
#import <React/RCTJavaScriptExecutor.h>
2625
#import <React/RCTPerformanceLogger.h>
2726
#import <React/RCTPerformanceLoggerLabels.h>
2827
#import <React/RCTRootView.h>

‎packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
#import <string>
2020
#import <unordered_map>
2121

22-
#define RCT_IS_TURBO_MODULE_CLASS(klass) \
23-
((RCTTurboModuleEnabled() && [(klass) conformsToProtocol:@protocol(RCTTurboModule)]))
24-
#define RCT_IS_TURBO_MODULE_INSTANCE(module) RCT_IS_TURBO_MODULE_CLASS([(module) class])
25-
2622
namespace facebook::react {
2723

2824
class CallbackWrapper;

‎scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,6 @@ protocol RCTBridgeModule : public NSObject {
25222522
public virtual _Nullable NSArray<id<RCTBridgeMethod>>* methodsToExport();
25232523
public virtual static BOOL requiresMainQueueSetup();
25242524
public virtual static NSString* moduleName();
2525-
public virtual void batchDidComplete();
25262525
}
25272526

25282527
protocol RCTCallInvokerModule : public NSObject {

0 commit comments

Comments
 (0)