Skip to content

Commit

Permalink
kill RCTFabricSurfaceHostingProxyRootView (#38864)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38864

## Changelog:

[iOS][Breaking] - Deleting RCTFabricSurfaceHostingProxyRootView

We currently have 3 different container view classes in new architecture: `RCTFabricSurfaceHostingProxyRootView`, `RCTSurfaceHostingProxyRootView`, and `RCTSurfaceHostingView`. it's a little complicated for the current use case, so there's an opportunity to simplify.

in this PR, i get rid of `RCTFabricSurfaceHostingProxyRootView` by relying on the composable behavior of surface and host views instead of existing internal reflection logic that depends on inheritance. these are cleaned up in D48140101 and D48140317.

i checked GH search and no one is really using this in a fundamental way.

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D48139820

fbshipit-source-id: 068b994a8b068a4107397f1862356b8fa1da961f
  • Loading branch information
philIip authored and facebook-github-bot committed Aug 16, 2023
1 parent 02408e1 commit 676676c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import <React/RCTComponentViewProtocol.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurface.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTLegacyViewManagerInteropComponentView.h>
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
Expand Down
10 changes: 6 additions & 4 deletions packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#import <React/RCTNetworking.h>

// Fabric
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTFabricSurface.h>
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
#endif
Expand Down Expand Up @@ -68,9 +69,10 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled)
{
#if RCT_NEW_ARCH_ENABLED
if (fabricEnabled) {
return [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:bridge
moduleName:moduleName
initialProperties:initialProperties];
id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
moduleName:moduleName
initialProperties:initialProperties];
return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
}
#endif
return [[RCTRootView alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ NS_ASSUME_NONNULL_BEGIN
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
moduleRegistry:(RCTModuleRegistry *)moduleRegistry;

- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface;

- (void)cancelTouches;

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ - (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
return self;
}

- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
{
if (self = [super initWithSurface:surface
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]) {
[surface start];
}
return self;
}

- (BOOL)hasBridge
{
return _bridge != nil;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 676676c

Please sign in to comment.