From 57b86f7a87b7bed09124cc513d5069b4c0069a4f Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 22 Aug 2023 14:59:52 -0700 Subject: [PATCH] delete hasBridge from root view api (#38870) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38870 ## Changelog: [iOS][Breaking] - hasBridge is removed from RCTRootView and RCTSurfaceHostingProxyRootView i'm looking to limit callsites to the bridge in new architecture. in GH search i didn't see anyone using this method. Reviewed By: cipolleschi Differential Revision: D48175886 fbshipit-source-id: 367bfd549f658a64c5f9defac6eb66b92e681216 --- packages/react-native/React/Base/RCTRootView.h | 5 ----- packages/react-native/React/Base/RCTRootView.m | 5 ----- .../SurfaceHostingView/RCTSurfaceHostingProxyRootView.h | 1 - .../SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm | 5 ----- 4 files changed, 16 deletions(-) diff --git a/packages/react-native/React/Base/RCTRootView.h b/packages/react-native/React/Base/RCTRootView.h index 6ed9c5b8fc48f2..08113e91d343eb 100644 --- a/packages/react-native/React/Base/RCTRootView.h +++ b/packages/react-native/React/Base/RCTRootView.h @@ -77,11 +77,6 @@ extern initialProperties:(nullable NSDictionary *)initialProperties launchOptions:(nullable NSDictionary *)launchOptions; -/** - * This API allows RCTRootView users to know if the root view is backed by the bridge. - */ -@property (nonatomic, readonly) BOOL hasBridge; - /** * This API allows users of RCTRootView to access other NativeModules, without * directly accessing the bridge. diff --git a/packages/react-native/React/Base/RCTRootView.m b/packages/react-native/React/Base/RCTRootView.m index a7b9b22881543f..113f44dc27ebda 100644 --- a/packages/react-native/React/Base/RCTRootView.m +++ b/packages/react-native/React/Base/RCTRootView.m @@ -121,11 +121,6 @@ - (UIView *)view return self; } -- (BOOL)hasBridge -{ - return _bridge != nil; -} - - (RCTModuleRegistry *)moduleRegistry { return _bridge.moduleRegistry; diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h index 647615e98f92ef..c11084908cc2ca 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h @@ -27,7 +27,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy, readonly) NSString *moduleName; @property (nonatomic, strong, readonly) RCTBridge *bridge; -@property (nonatomic, readonly) BOOL hasBridge; @property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; @property (nonatomic, strong, readonly) id eventDispatcher; @property (nonatomic, copy, readwrite) NSDictionary *appProperties; diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index a7c67cffcc68c5..bd2c753fc33c52 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -113,11 +113,6 @@ - (instancetype)initWithSurface:(id)surface return self; } -- (BOOL)hasBridge -{ - return _bridge != nil; -} - - (RCTModuleRegistry *)moduleRegistry { // In bridgeless mode, RCTSurfaceHostingProxyRootView is created with an RCTModuleRegistry