Remove depracted legacy architecture @protocol APIs (#57069)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/57069

## Changelog:
[IOS][Breaking]  Remove depracted legacy architecture protocol APIs

Reviewed By: andrewdacenko

Differential Revision: D107422407

fbshipit-source-id: 442f232981a4c6504c7c64e88ba1f8e99d1c5a5b
This commit is contained in:
Christoph Purrer
2026-06-04 09:25:18 -07:00
committed by meta-codesync[bot]
parent 40b16dca9f
commit ad9936faf6
17 changed files with 1 additions and 154 deletions
@@ -18,7 +18,6 @@
#import "RCTLog.h"
#import "RCTPerformanceLogger.h"
#import "RCTProfile.h"
#import "RCTRootShadowView.h"
#import "RCTTouchHandler.h"
#import "RCTUIManager.h"
#import "RCTUIManagerUtils.h"
@@ -16,9 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
// Whether the New Architecture is enabled or not
RCT_EXTERN BOOL RCTIsNewArchEnabled(void);
RCT_EXTERN void RCTSetNewArchEnabled(BOOL enabled) __attribute__((deprecated(
"This function is now no-op. You need to modify the Info.plist adding a RCTNewArchEnabled bool property to control whether the New Arch is enabled or not")));
;
// Whether React native should output logs for modules and components used
// through the interop layers
@@ -46,12 +46,6 @@ BOOL RCTIsNewArchEnabled(void)
{
return YES;
}
void RCTSetNewArchEnabled(BOOL enabled)
{
// This function is now deprecated and will be removed in the future.
// This function is now no-op. You need to modify the Info.plist adding a `RCTNewArchEnabled` bool property to control
// whether the New Arch is enabled or not.
}
BOOL RCTAreLegacyLogsEnabled(void)
{
@@ -25,9 +25,7 @@
#import "RCTModuleData.h"
#import "RCTModuleMethod.h"
#import "RCTProfile.h"
#import "RCTRootShadowView.h"
#import "RCTScrollableProtocol.h"
#import "RCTShadowView+Internal.h"
#import "RCTShadowView.h"
#import "RCTSurfaceRootShadowView.h"
#import "RCTSurfaceRootView.h"
@@ -1,35 +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.
*/
#import <React/RCTShadowView.h>
#import <yoga/YGEnums.h>
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
@interface RCTRootShadowView : RCTShadowView
/**
* Minimum size to layout all views.
* Defaults to CGSizeZero
*/
@property (nonatomic, assign) CGSize minimumSize;
/**
* Available size to layout all views.
* Defaults to {INFINITY, INFINITY}
*/
@property (nonatomic, assign) CGSize availableSize;
/**
* Layout direction (LTR or RTL) inherited from native environment and
* is using as a base direction value in layout engine.
* Defaults to value inferred from current locale.
*/
@property (nonatomic, assign) YGDirection baseDirection;
- (void)layoutWithAffectedShadowViews:(NSPointerArray *)affectedShadowViews;
@end
@@ -1,14 +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.
*/
#import "RCTRootShadowView.h"
@implementation RCTRootShadowView
- (void)layoutWithAffectedShadowViews:(NSPointerArray *)affectedShadowViews
{
}
@end
@@ -1,18 +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.
*/
#import <UIKit/UIKit.h>
#import <React/RCTShadowView.h>
@class RCTRootShadowView;
@interface RCTShadowView (Internal)
@property (nonatomic, weak, readwrite) RCTRootShadowView *rootView;
@end
@@ -1,23 +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.
*/
#import "RCTShadowView+Layout.h"
@interface RCTShadowView () {
__weak RCTRootShadowView *_rootView;
}
@end
@implementation RCTShadowView (Internal)
- (void)setRootView:(RCTRootShadowView *)rootView
{
_rootView = rootView;
}
@end
@@ -14,7 +14,6 @@
#import <React/RCTRootView.h>
#import <yoga/Yoga.h>
@class RCTRootShadowView;
@class RCTSparseArray;
typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry);
@@ -46,7 +45,6 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER;
- (void)removeReactSubview:(RCTShadowView *)subview NS_REQUIRES_SUPER;
@property (nonatomic, weak, readonly) RCTRootShadowView *rootView;
@property (nonatomic, weak, readonly) RCTShadowView *superview;
@property (nonatomic, assign, readonly) YGNodeRef yogaNode;
@property (nonatomic, copy) NSString *viewName;
@@ -42,7 +42,3 @@
@property (nonatomic, weak) UIScrollView *scrollView;
@end
__attribute__((deprecated("Use RCTCustomRefreshControlProtocol instead")))
@protocol RCTCustomRefreshContolProtocol<RCTCustomRefreshControlProtocol>
@end
@@ -351,9 +351,6 @@ Class getFallbackClassFromName(const char *name)
if ([module respondsToSelector:@selector(installJSIBindingsWithRuntime:callInvoker:)]) {
[(id<RCTTurboModuleWithJSIBindings>)module installJSIBindingsWithRuntime:*runtime callInvoker:_jsInvoker];
} else if ([module respondsToSelector:@selector(installJSIBindingsWithRuntime:)]) {
// Old API without CallInvoker (deprecated)
[(id<RCTTurboModuleWithJSIBindings>)module installJSIBindingsWithRuntime:*runtime];
}
return turboModule;
}
@@ -20,9 +20,6 @@
- (void)installJSIBindingsWithRuntime:(facebook::jsi::Runtime &)runtime
callInvoker:(const std::shared_ptr<facebook::react::CallInvoker> &)callinvoker;
- (void)installJSIBindingsWithRuntime:(facebook::jsi::Runtime &)runtime
__attribute__((deprecated("Use 'installJSIBindingsWithRuntime:callInvoker:' instead")));
#endif
@end
@@ -184,7 +184,6 @@
#import <React/RCTRefreshableProtocol.h>
#import <React/RCTReloadCommand.h>
#import <React/RCTResizeMode.h>
#import <React/RCTRootShadowView.h>
#import <React/RCTRootView.h>
#import <React/RCTRootViewDelegate.h>
#import <React/RCTScrollEvent.h>
@@ -192,7 +191,6 @@
#import <React/RCTScrollableProtocol.h>
#import <React/RCTSettingsManager.h>
#import <React/RCTSettingsPlugins.h>
#import <React/RCTShadowView+Internal.h>
#import <React/RCTShadowView+Layout.h>
#import <React/RCTShadowView.h>
#import <React/RCTSourceCode.h>
@@ -8,7 +8,6 @@
#import <XCTest/XCTest.h>
#import <RCTTest/RCTTestRunner.h>
#import <React/RCTRootShadowView.h>
#import <React/RCTShadowView.h>
#import <React/RCTUIManager.h>
#import <React/RCTView.h>
@@ -90,7 +89,7 @@ RCT_CUSTOM_VIEW_PROPERTY(customProp, NSString, RCTPropsTestView)
RCTUIManager *uiManager = _bridge.uiManager;
dispatch_async(uiManager.methodQueue, ^{
RCTRootShadowView *rootShadowView = [RCTRootShadowView new];
RCTShadowView *rootShadowView = [RCTShadowView new];
rootShadowView.reactTag = self->_rootViewReactTag;
uiManager.shadowViewRegistry[rootShadowView.reactTag] = rootShadowView;
});
@@ -1635,13 +1635,6 @@ interface RCTRedBoxExtraDataViewController : public UIViewController <UITableVie
interface RCTRootComponentView : public RCTViewComponentView {
}
interface RCTRootShadowView : public RCTShadowView {
public @property (assign) CGSize availableSize;
public @property (assign) CGSize minimumSize;
public @property (assign) YGDirection baseDirection;
public virtual void layoutWithAffectedShadowViews:(NSPointerArray* affectedShadowViews);
}
interface RCTRootView : public UIView {
public @property (assign) BOOL passThroughTouches;
public @property (assign) CGSize minimumSize;
@@ -1797,7 +1790,6 @@ interface RCTShadowView : public NSObject <RCTComponent> {
public @property (assign, readonly) YGNodeRef yogaNode;
public @property (copy) NSString* viewName;
public @property (copy) RCTDirectEventBlock onLayout;
public @property (weak, readonly) RCTRootShadowView* rootView;
public @property (weak, readonly) RCTShadowView* superview;
public virtual BOOL canHaveSubviews();
public virtual BOOL isYogaLeafNode();
@@ -2725,9 +2717,6 @@ protocol RCTContextContainerHandling : public NSObject {
protocol RCTCustomPullToRefreshViewProtocol {
}
protocol RCTCustomRefreshContolProtocol : public RCTCustomRefreshControlProtocol {
}
protocol RCTCustomRefreshControlProtocol {
public @property (assign, readonly) BOOL refreshing;
public @property (copy) RCTDirectEventBlock onRefresh;
@@ -3109,7 +3098,6 @@ protocol RCTTurboModuleRegistry : public NSObject {
}
protocol RCTTurboModuleWithJSIBindings : public NSObject {
public virtual void installJSIBindingsWithRuntime:(facebook::jsi::Runtime& runtime);
public virtual void installJSIBindingsWithRuntime:callInvoker:(facebook::jsi::Runtime& runtime, const std::shared_ptr<facebook::react::CallInvoker>& callinvoker);
}
@@ -1632,13 +1632,6 @@ interface RCTRedBoxExtraDataViewController : public UIViewController <UITableVie
interface RCTRootComponentView : public RCTViewComponentView {
}
interface RCTRootShadowView : public RCTShadowView {
public @property (assign) CGSize availableSize;
public @property (assign) CGSize minimumSize;
public @property (assign) YGDirection baseDirection;
public virtual void layoutWithAffectedShadowViews:(NSPointerArray* affectedShadowViews);
}
interface RCTRootView : public UIView {
public @property (assign) BOOL passThroughTouches;
public @property (assign) CGSize minimumSize;
@@ -1792,7 +1785,6 @@ interface RCTShadowView : public NSObject <RCTComponent> {
public @property (assign, readonly) YGNodeRef yogaNode;
public @property (copy) NSString* viewName;
public @property (copy) RCTDirectEventBlock onLayout;
public @property (weak, readonly) RCTRootShadowView* rootView;
public @property (weak, readonly) RCTShadowView* superview;
public virtual BOOL canHaveSubviews();
public virtual BOOL isYogaLeafNode();
@@ -2713,9 +2705,6 @@ protocol RCTContextContainerHandling : public NSObject {
protocol RCTCustomPullToRefreshViewProtocol {
}
protocol RCTCustomRefreshContolProtocol : public RCTCustomRefreshControlProtocol {
}
protocol RCTCustomRefreshControlProtocol {
public @property (assign, readonly) BOOL refreshing;
public @property (copy) RCTDirectEventBlock onRefresh;
@@ -3097,7 +3086,6 @@ protocol RCTTurboModuleRegistry : public NSObject {
}
protocol RCTTurboModuleWithJSIBindings : public NSObject {
public virtual void installJSIBindingsWithRuntime:(facebook::jsi::Runtime& runtime);
public virtual void installJSIBindingsWithRuntime:callInvoker:(facebook::jsi::Runtime& runtime, const std::shared_ptr<facebook::react::CallInvoker>& callinvoker);
}
@@ -1635,13 +1635,6 @@ interface RCTRedBoxExtraDataViewController : public UIViewController <UITableVie
interface RCTRootComponentView : public RCTViewComponentView {
}
interface RCTRootShadowView : public RCTShadowView {
public @property (assign) CGSize availableSize;
public @property (assign) CGSize minimumSize;
public @property (assign) YGDirection baseDirection;
public virtual void layoutWithAffectedShadowViews:(NSPointerArray* affectedShadowViews);
}
interface RCTRootView : public UIView {
public @property (assign) BOOL passThroughTouches;
public @property (assign) CGSize minimumSize;
@@ -1797,7 +1790,6 @@ interface RCTShadowView : public NSObject <RCTComponent> {
public @property (assign, readonly) YGNodeRef yogaNode;
public @property (copy) NSString* viewName;
public @property (copy) RCTDirectEventBlock onLayout;
public @property (weak, readonly) RCTRootShadowView* rootView;
public @property (weak, readonly) RCTShadowView* superview;
public virtual BOOL canHaveSubviews();
public virtual BOOL isYogaLeafNode();
@@ -2725,9 +2717,6 @@ protocol RCTContextContainerHandling : public NSObject {
protocol RCTCustomPullToRefreshViewProtocol {
}
protocol RCTCustomRefreshContolProtocol : public RCTCustomRefreshControlProtocol {
}
protocol RCTCustomRefreshControlProtocol {
public @property (assign, readonly) BOOL refreshing;
public @property (copy) RCTDirectEventBlock onRefresh;
@@ -3109,7 +3098,6 @@ protocol RCTTurboModuleRegistry : public NSObject {
}
protocol RCTTurboModuleWithJSIBindings : public NSObject {
public virtual void installJSIBindingsWithRuntime:(facebook::jsi::Runtime& runtime);
public virtual void installJSIBindingsWithRuntime:callInvoker:(facebook::jsi::Runtime& runtime, const std::shared_ptr<facebook::react::CallInvoker>& callinvoker);
}