From f7c18971a2d5997ba3738236e5ab0a67ffaf6c29 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 30 Oct 2026 14:47:20 -0700 Subject: [PATCH] Delete deprecated FabricSurface bridge init and stub category (#59438) Summary: `-[RCTFabricSurface initWithBridge:moduleName:initialProperties:]` has zero callers, and it was the only reader of `bridge.surfacePresenter`. Delete it with the `RCTBridge (RCTSurfacePresenterStub)` category. The proxy accessors stay so existing message sends keep resolving. Changelog: [iOS][Removed] - Remove deprecated `RCTFabricSurface` bridge initializer and `RCTBridge` surface-presenter category Reviewed By: andrewdacenko Differential Revision: D127294777 --- .../React/Fabric/Surface/RCTFabricSurface.h | 12 ------------ .../React/Fabric/Surface/RCTFabricSurface.mm | 11 ----------- .../React/Modules/RCTSurfacePresenterStub.h | 7 ------- scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 5 ----- .../api-snapshots/ReactAppleFrameworksCxx.api | 5 ----- .../cxx-api/api-snapshots/ReactAppleNewarchCxx.api | 5 ----- .../cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 5 ----- 7 files changed, 50 deletions(-) diff --git a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.h b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.h index 1958c010540f..fd00787cf94f 100644 --- a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.h +++ b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.h @@ -10,7 +10,6 @@ NS_ASSUME_NONNULL_BEGIN -@class RCTBridge; @class RCTSurfaceView; @class RCTSurfacePresenter; @@ -118,15 +117,4 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface RCTFabricSurface (Deprecated) - -/** - * Deprecated. Use `initWithSurfacePresenter:moduleName:initialProperties` instead. - */ -- (instancetype)initWithBridge:(RCTBridge *)bridge - moduleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties; - -@end - NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm index b0bdfed944eb..77452c49febb 100644 --- a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm +++ b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm @@ -300,17 +300,6 @@ - (void)handleContentSizeCategoryDidChangeNotification:(NSNotification *)notific return *_surfaceHandler; } -#pragma mark - Deprecated - -- (instancetype)initWithBridge:(RCTBridge *)bridge - moduleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties -{ - return [self initWithSurfacePresenter:bridge.surfacePresenter - moduleName:moduleName - initialProperties:initialProperties]; -} - - (NSNumber *)rootViewTag { return @(_surfaceHandler->getSurfaceId()); diff --git a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h index aea607083a05..fa17741f1143 100644 --- a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h +++ b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h @@ -38,13 +38,6 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface RCTBridge (RCTSurfacePresenterStub) - -- (id)surfacePresenter; -- (void)setSurfacePresenter:(id)presenter; - -@end - @interface RCTBridgeProxy (RCTSurfacePresenterStub) - (id)surfacePresenter; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 101ef554362f..0defe9be01a6 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -22,11 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTSurfacePresenterStub) { - public virtual id surfacePresenter(); - public virtual void setSurfacePresenter:(id presenter); -} - category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index e89ec1a6c6df..fbc699e893cf 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -22,11 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTSurfacePresenterStub) { - public virtual id surfacePresenter(); - public virtual void setSurfacePresenter:(id presenter); -} - category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index a396e261d86c..a1073862f038 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -22,11 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTSurfacePresenterStub) { - public virtual id surfacePresenter(); - public virtual void setSurfacePresenter:(id presenter); -} - category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 1255a7730e0a..b0b88d9540f9 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -22,11 +22,6 @@ category RCTBridge(RCTImageLoader) { public @property (assign, readonly) RCTImageLoader* imageLoader; } -category RCTBridge(RCTSurfacePresenterStub) { - public virtual id surfacePresenter(); - public virtual void setSurfacePresenter:(id presenter); -} - category RCTBridge(RCTUIManager) { public @property (assign, readonly) RCTUIManager* uiManager; }