From a7bbf1728a3a4ea770f97917f2aa11f6afc86d03 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 8 Aug 2023 21:14:10 -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] i'm looking to limit callsites to the bridge in new architecture. in GH search i didn't see anyone using this method. Differential Revision: D48175886 fbshipit-source-id: db67d2d68d01e0e226c959c552170e7d489bba2b --- 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 241693f25e979c..af4062042531a2 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 4755f7787c6565..e2de5dbfe922bf 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -71,11 +71,6 @@ - (instancetype)initWithSurface:(id)surface return self; } -- (BOOL)hasBridge -{ - return _bridge != nil; -} - - (RCTModuleRegistry *)moduleRegistry { // In bridgeless mode, RCTSurfaceHostingProxyRootView is created with an RCTModuleRegistry