From d2e18a1c5cfdb9bb06f0768e0fd9a7fbda30ec5a Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Thu, 8 Aug 2019 07:13:22 -0700 Subject: [PATCH] iOS: Revert RCT->RN prefix renaming to avoid confusion Summary: The previous rename from RCT->RN prefix ended up causing some confusions on which prefix to use for which files and under what circumstances. To avoid further confusion before we're done with the re-architecture project, let's keep them as RCT. Reviewed By: mdvacca Differential Revision: D16705566 fbshipit-source-id: 395bff771c84e5ded6b2261a84c7549df1e6c5e5 --- .../Nodes/RCTPropsAnimatedNode.m | 2 +- .../NativeAnimation/RCTNativeAnimatedModule.h | 4 +- .../NativeAnimation/RCTNativeAnimatedModule.m | 2 +- RNTester/RNTester/AppDelegate.mm | 10 +- ...> RCTActivityIndicatorViewComponentView.h} | 4 +- ... RCTActivityIndicatorViewComponentView.mm} | 6 +- ...omponentView.h => RCTImageComponentView.h} | 6 +- ...ponentView.mm => RCTImageComponentView.mm} | 16 +-- ...r.h => RCTFabricModalHostViewController.h} | 6 +- ...mm => RCTFabricModalHostViewController.mm} | 10 +- ...View.h => RCTModalHostViewComponentView.h} | 4 +- ...ew.mm => RCTModalHostViewComponentView.mm} | 23 ++-- ...ComponentView.h => RCTRootComponentView.h} | 4 +- ...mponentView.mm => RCTRootComponentView.mm} | 6 +- ...edScrollView.h => RCTEnhancedScrollView.h} | 4 +- ...ScrollView.mm => RCTEnhancedScrollView.mm} | 4 +- ....h => RCTPullToRefreshViewComponentView.h} | 4 +- ...m => RCTPullToRefreshViewComponentView.mm} | 14 +-- ...entView.h => RCTScrollViewComponentView.h} | 15 +-- ...tView.mm => RCTScrollViewComponentView.mm} | 30 +++--- ...mponentView.h => RCTSliderComponentView.h} | 4 +- ...onentView.mm => RCTSliderComponentView.mm} | 26 ++--- ...mponentView.h => RCTSwitchComponentView.h} | 4 +- ...onentView.mm => RCTSwitchComponentView.mm} | 6 +- ...nentView.h => RCTParagraphComponentView.h} | 4 +- ...ntView.mm => RCTParagraphComponentView.mm} | 8 +- ... => RCTUnimplementedNativeComponentView.h} | 4 +- ...=> RCTUnimplementedNativeComponentView.mm} | 6 +- ...ComponentView.h => RCTViewComponentView.h} | 8 +- ...mponentView.mm => RCTViewComponentView.mm} | 16 +-- ...iewFactory.h => RCTComponentViewFactory.h} | 12 +-- ...wFactory.mm => RCTComponentViewFactory.mm} | 60 +++++------ ...wProtocol.h => RCTComponentViewProtocol.h} | 8 +- ...wRegistry.h => RCTComponentViewRegistry.h} | 20 ++-- ...egistry.mm => RCTComponentViewRegistry.mm} | 52 ++++----- ...MountingManager.h => RCTMountingManager.h} | 12 +-- ...untingManager.mm => RCTMountingManager.mm} | 64 +++++------ ...elegate.h => RCTMountingManagerDelegate.h} | 10 +- .../Mounting/UIView+ComponentViewProtocol.h | 10 +- .../Mounting/UIView+ComponentViewProtocol.mm | 10 +- .../{RNConversions.h => RCTConversions.h} | 0 ...eDelegate.h => RCTImageResponseDelegate.h} | 2 +- ...roxy.h => RCTImageResponseObserverProxy.h} | 8 +- ...xy.mm => RCTImageResponseObserverProxy.mm} | 12 +-- .../{RNPrimitives.h => RCTPrimitives.h} | 0 .../Fabric/{RNScheduler.h => RCTScheduler.h} | 10 +- .../{RNScheduler.mm => RCTScheduler.mm} | 18 ++-- ...rfacePresenter.h => RCTSurfacePresenter.h} | 34 +++--- ...acePresenter.mm => RCTSurfacePresenter.mm} | 100 +++++++++--------- ...SurfaceRegistry.h => RCTSurfaceRegistry.h} | 14 +-- ...rfaceRegistry.mm => RCTSurfaceRegistry.mm} | 14 +-- ...ouchHandler.h => RCTSurfaceTouchHandler.h} | 2 +- ...chHandler.mm => RCTSurfaceTouchHandler.mm} | 14 +-- ....h => RCTTouchableComponentViewProtocol.h} | 2 +- .../{RNFabricSurface.h => RCTFabricSurface.h} | 12 +-- ...RNFabricSurface.mm => RCTFabricSurface.mm} | 16 +-- ...=> RCTFabricSurfaceHostingProxyRootView.h} | 2 +- ...> RCTFabricSurfaceHostingProxyRootView.mm} | 12 +-- ...ngView.h => RCTFabricSurfaceHostingView.h} | 2 +- ...View.mm => RCTFabricSurfaceHostingView.mm} | 12 +-- ...plitter.h => RCTGenericDelegateSplitter.h} | 2 +- ...itter.mm => RCTGenericDelegateSplitter.mm} | 4 +- ...senterStub.h => RCTSurfacePresenterStub.h} | 16 +-- ...senterStub.m => RCTSurfacePresenterStub.m} | 8 +- .../core/platform/ios/RCTTurboModule.h | 2 +- 65 files changed, 421 insertions(+), 415 deletions(-) rename React/Fabric/Mounting/ComponentViews/ActivityIndicator/{RNActivityIndicatorViewComponentView.h => RCTActivityIndicatorViewComponentView.h} (75%) rename React/Fabric/Mounting/ComponentViews/ActivityIndicator/{RNActivityIndicatorViewComponentView.mm => RCTActivityIndicatorViewComponentView.mm} (95%) rename React/Fabric/Mounting/ComponentViews/Image/{RNImageComponentView.h => RCTImageComponentView.h} (65%) rename React/Fabric/Mounting/ComponentViews/Image/{RNImageComponentView.mm => RCTImageComponentView.mm} (93%) rename React/Fabric/Mounting/ComponentViews/Modal/{RNModalHostViewController.h => RCTFabricModalHostViewController.h} (64%) rename React/Fabric/Mounting/ComponentViews/Modal/{RNModalHostViewController.mm => RCTFabricModalHostViewController.mm} (90%) rename React/Fabric/Mounting/ComponentViews/Modal/{RNModalHostViewComponentView.h => RCTModalHostViewComponentView.h} (71%) rename React/Fabric/Mounting/ComponentViews/Modal/{RNModalHostViewComponentView.mm => RCTModalHostViewComponentView.mm} (89%) rename React/Fabric/Mounting/ComponentViews/Root/{RNRootComponentView.h => RCTRootComponentView.h} (77%) rename React/Fabric/Mounting/ComponentViews/Root/{RNRootComponentView.mm => RCTRootComponentView.mm} (86%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNEnhancedScrollView.h => RCTEnhancedScrollView.h} (85%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNEnhancedScrollView.mm => RCTEnhancedScrollView.mm} (89%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNPullToRefreshViewComponentView.h => RCTPullToRefreshViewComponentView.h} (82%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNPullToRefreshViewComponentView.mm => RCTPullToRefreshViewComponentView.mm} (90%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNScrollViewComponentView.h => RCTScrollViewComponentView.h} (76%) rename React/Fabric/Mounting/ComponentViews/ScrollView/{RNScrollViewComponentView.mm => RCTScrollViewComponentView.mm} (89%) rename React/Fabric/Mounting/ComponentViews/Slider/{RNSliderComponentView.h => RCTSliderComponentView.h} (77%) rename React/Fabric/Mounting/ComponentViews/Slider/{RNSliderComponentView.mm => RCTSliderComponentView.mm} (92%) rename React/Fabric/Mounting/ComponentViews/Switch/{RNSwitchComponentView.h => RCTSwitchComponentView.h} (77%) rename React/Fabric/Mounting/ComponentViews/Switch/{RNSwitchComponentView.mm => RCTSwitchComponentView.mm} (95%) rename React/Fabric/Mounting/ComponentViews/Text/{RNParagraphComponentView.h => RCTParagraphComponentView.h} (76%) rename React/Fabric/Mounting/ComponentViews/Text/{RNParagraphComponentView.mm => RCTParagraphComponentView.mm} (96%) rename React/Fabric/Mounting/ComponentViews/UnimplementedComponent/{RNUnimplementedNativeComponentView.h => RCTUnimplementedNativeComponentView.h} (71%) rename React/Fabric/Mounting/ComponentViews/UnimplementedComponent/{RNUnimplementedNativeComponentView.mm => RCTUnimplementedNativeComponentView.mm} (92%) rename React/Fabric/Mounting/ComponentViews/View/{RNViewComponentView.h => RCTViewComponentView.h} (93%) rename React/Fabric/Mounting/ComponentViews/View/{RNViewComponentView.mm => RCTViewComponentView.mm} (97%) rename React/Fabric/Mounting/{RNComponentViewFactory.h => RCTComponentViewFactory.h} (74%) rename React/Fabric/Mounting/{RNComponentViewFactory.mm => RCTComponentViewFactory.mm} (53%) rename React/Fabric/Mounting/{RNComponentViewProtocol.h => RCTComponentViewProtocol.h} (93%) rename React/Fabric/Mounting/{RNComponentViewRegistry.h => RCTComponentViewRegistry.h} (65%) rename React/Fabric/Mounting/{RNComponentViewRegistry.mm => RCTComponentViewRegistry.mm} (75%) rename React/Fabric/Mounting/{RNMountingManager.h => RCTMountingManager.h} (79%) rename React/Fabric/Mounting/{RNMountingManager.mm => RCTMountingManager.mm} (79%) rename React/Fabric/Mounting/{RNMountingManagerDelegate.h => RCTMountingManagerDelegate.h} (63%) rename React/Fabric/{RNConversions.h => RCTConversions.h} (100%) rename React/Fabric/{RNImageResponseDelegate.h => RCTImageResponseDelegate.h} (91%) rename React/Fabric/{RNImageResponseObserverProxy.h => RCTImageResponseObserverProxy.h} (73%) rename React/Fabric/{RNImageResponseObserverProxy.mm => RCTImageResponseObserverProxy.mm} (68%) rename React/Fabric/{RNPrimitives.h => RCTPrimitives.h} (100%) rename React/Fabric/{RNScheduler.h => RCTScheduler.h} (92%) rename React/Fabric/{RNScheduler.mm => RCTScheduler.mm} (87%) rename React/Fabric/{RNSurfacePresenter.h => RCTSurfacePresenter.h} (62%) rename React/Fabric/{RNSurfacePresenter.mm => RCTSurfacePresenter.mm} (79%) rename React/Fabric/{RNSurfaceRegistry.h => RCTSurfaceRegistry.h} (69%) rename React/Fabric/{RNSurfaceRegistry.mm => RCTSurfaceRegistry.mm} (80%) rename React/Fabric/{RNSurfaceTouchHandler.h => RCTSurfaceTouchHandler.h} (86%) rename React/Fabric/{RNSurfaceTouchHandler.mm => RCTSurfaceTouchHandler.mm} (96%) rename React/Fabric/{RNTouchableComponentViewProtocol.h => RCTTouchableComponentViewProtocol.h} (86%) rename React/Fabric/Surface/{RNFabricSurface.h => RCTFabricSurface.h} (94%) rename React/Fabric/Surface/{RNFabricSurface.mm => RCTFabricSurface.mm} (94%) rename React/Fabric/Surface/{RNFabricSurfaceHostingProxyRootView.h => RCTFabricSurfaceHostingProxyRootView.h} (79%) rename React/Fabric/Surface/{RNFabricSurfaceHostingProxyRootView.mm => RCTFabricSurfaceHostingProxyRootView.mm} (52%) rename React/Fabric/Surface/{RNFabricSurfaceHostingView.h => RCTFabricSurfaceHostingView.h} (82%) rename React/Fabric/Surface/{RNFabricSurfaceHostingView.mm => RCTFabricSurfaceHostingView.mm} (66%) rename React/Fabric/Utils/{RNGenericDelegateSplitter.h => RCTGenericDelegateSplitter.h} (96%) rename React/Fabric/Utils/{RNGenericDelegateSplitter.mm => RCTGenericDelegateSplitter.mm} (94%) rename React/Modules/{RNSurfacePresenterStub.h => RCTSurfacePresenterStub.h} (63%) rename React/Modules/{RNSurfacePresenterStub.m => RCTSurfacePresenterStub.m} (64%) diff --git a/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m b/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m index b1e286bcad2..3469d941026 100644 --- a/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +++ b/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m @@ -8,7 +8,7 @@ #import #import -#import +#import #import #import diff --git a/Libraries/NativeAnimation/RCTNativeAnimatedModule.h b/Libraries/NativeAnimation/RCTNativeAnimatedModule.h index 2cf34ded2ce..2b003e53bc2 100644 --- a/Libraries/NativeAnimation/RCTNativeAnimatedModule.h +++ b/Libraries/NativeAnimation/RCTNativeAnimatedModule.h @@ -8,13 +8,13 @@ #import #import #import -#import +#import #import #import #import #import "RCTValueAnimatedNode.h" -@interface RCTNativeAnimatedModule : RCTEventEmitter +@interface RCTNativeAnimatedModule : RCTEventEmitter @end diff --git a/Libraries/NativeAnimation/RCTNativeAnimatedModule.m b/Libraries/NativeAnimation/RCTNativeAnimatedModule.m index b5f3089ed29..45be88e033e 100644 --- a/Libraries/NativeAnimation/RCTNativeAnimatedModule.m +++ b/Libraries/NativeAnimation/RCTNativeAnimatedModule.m @@ -231,7 +231,7 @@ RCT_EXPORT_METHOD(removeAnimatedEventFromView:(nonnull NSNumber *)viewTag }); } -#pragma mark - RNSurfacePresenterObserver +#pragma mark - RCTSurfacePresenterObserver - (void)willMountComponentsWithRootTag:(NSInteger)rootTag { diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index 22aac7368bb..76f4a3deb7c 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -23,8 +23,8 @@ #endif #ifdef RN_FABRIC_ENABLED -#import -#import +#import +#import #endif #import @@ -34,7 +34,7 @@ @interface AppDelegate() { #ifdef RN_FABRIC_ENABLED - RNSurfacePresenter *_surfacePresenter; + RCTSurfacePresenter *_surfacePresenter; #endif RCTTurboModuleManager *_turboModuleManager; @@ -58,10 +58,10 @@ } #ifdef RN_FABRIC_ENABLED - _surfacePresenter = [[RNSurfacePresenter alloc] initWithBridge:_bridge config:nil]; + _surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge config:nil]; _bridge.surfacePresenter = _surfacePresenter; - UIView *rootView = [[RNFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps]; + UIView *rootView = [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps]; #else UIView *rootView = [[RCTRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps]; #endif diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h similarity index 75% rename from React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.h rename to React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h index f33dbdb7747..541eefc6bb9 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h @@ -7,14 +7,14 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** * UIView class for root component. */ -@interface RNActivityIndicatorViewComponentView : RNViewComponentView +@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm similarity index 95% rename from React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.mm rename to React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm index 09eca8cb915..f8ccc1024d0 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNActivityIndicatorViewComponentView.h" +#import "RCTActivityIndicatorViewComponentView.h" #import #import @@ -23,11 +23,11 @@ static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const Acti } } -@implementation RNActivityIndicatorViewComponentView { +@implementation RCTActivityIndicatorViewComponentView { UIActivityIndicatorView *_activityIndicatorView; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { diff --git a/React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.h b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h similarity index 65% rename from React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.h rename to React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h index d33e9a9984e..716edc91071 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h @@ -5,15 +5,15 @@ * LICENSE file in the root directory of this source tree. */ -#import -#import "RNViewComponentView.h" +#import +#import "RCTViewComponentView.h" NS_ASSUME_NONNULL_BEGIN /** * UIView class for root component. */ -@interface RNImageComponentView : RNViewComponentView +@interface RCTImageComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm similarity index 93% rename from React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index de8fdf16e79..8608170cd01 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNImageComponentView.h" +#import "RCTImageComponentView.h" -#import +#import #import #import #import @@ -15,13 +15,13 @@ #import #import -#import "RNConversions.h" +#import "RCTConversions.h" -@implementation RNImageComponentView { +@implementation RCTImageComponentView { UIImageView *_imageView; SharedImageLocalData _imageLocalData; const ImageResponseObserverCoordinator *_coordinator; - std::unique_ptr _imageResponseObserverProxy; + std::unique_ptr _imageResponseObserverProxy; } - (instancetype)initWithFrame:(CGRect)frame @@ -35,7 +35,7 @@ _imageView.contentMode = (UIViewContentMode)RCTResizeModeFromImageResizeMode(defaultProps->resizeMode); - _imageResponseObserverProxy = std::make_unique((__bridge void *)self); + _imageResponseObserverProxy = std::make_unique((__bridge void *)self); self.contentView = _imageView; } @@ -43,7 +43,7 @@ return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { @@ -125,7 +125,7 @@ _imageResponseObserverProxy.reset(); } -#pragma mark - RNImageResponseDelegate +#pragma mark - RCTImageResponseDelegate - (void)didReceiveImage:(UIImage *)image fromObserver:(void *)observer { diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.h b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h similarity index 64% rename from React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.h rename to React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h index 392597b7924..6b9ba540ebf 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.h +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h @@ -7,13 +7,13 @@ #import -@protocol RNModalHostViewControllerDelegate +@protocol RCTFabricModalHostViewControllerDelegate - (void)boundsDidChange:(CGRect)newBounds; @end -@interface RNModalHostViewController : UIViewController +@interface RCTFabricModalHostViewController : UIViewController -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; #if !TARGET_OS_TV @property (nonatomic, assign) UIInterfaceOrientationMask supportedInterfaceOrientations; diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.mm b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm similarity index 90% rename from React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.mm rename to React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm index 9bda62b3595..57dca4f7510 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewController.mm +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNModalHostViewController.h" +#import "RCTFabricModalHostViewController.h" #import -#import +#import -@implementation RNModalHostViewController { +@implementation RCTFabricModalHostViewController { CGRect _lastViewBounds; - RNSurfaceTouchHandler *_touchHandler; + RCTSurfaceTouchHandler *_touchHandler; } - (instancetype)init @@ -20,7 +20,7 @@ if (!(self = [super init])) { return nil; } - _touchHandler = [RNSurfaceTouchHandler new]; + _touchHandler = [RCTSurfaceTouchHandler new]; return self; } diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.h b/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h similarity index 71% rename from React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.h rename to React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h index 077db52f639..0aba39e273c 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -#import +#import /** * UIView class for root component. */ -@interface RNModalHostViewComponentView : RNViewComponentView +@interface RCTModalHostViewComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm similarity index 89% rename from React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm index 759bed8095a..d37a108dbde 100644 --- a/React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm @@ -5,15 +5,16 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNModalHostViewComponentView.h" -#import "RNModalHostViewController.h" +#import "RCTModalHostViewComponentView.h" #import #import #import #import #import -#import "RNConversions.h" + +#import "RCTConversions.h" +#import "RCTFabricModalHostViewController.h" using namespace facebook::react; @@ -90,12 +91,12 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r return {orientation}; } -@interface RNModalHostViewComponentView () +@interface RCTModalHostViewComponentView () @end -@implementation RNModalHostViewComponentView { - RNModalHostViewController *_viewController; +@implementation RCTModalHostViewComponentView { + RCTFabricModalHostViewController *_viewController; ModalHostViewShadowNode::ConcreteState::Shared _state; BOOL _shouldAnimatePresentation; } @@ -106,7 +107,7 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r static const auto defaultProps = std::make_shared(); _props = defaultProps; _shouldAnimatePresentation = YES; - _viewController = [RNModalHostViewController new]; + _viewController = [RCTFabricModalHostViewController new]; _viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; _viewController.delegate = self; } @@ -151,7 +152,7 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r [self ensurePresentedOnlyIfNeeded]; } -#pragma mark - RNModalHostViewControllerDelegate +#pragma mark - RCTFabricModalHostViewControllerDelegate - (void)boundsDidChange:(CGRect)newBounds { @@ -164,7 +165,7 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r } } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { @@ -194,12 +195,12 @@ static ModalHostViewOnOrientationChangeStruct onOrientationChangeStruct(CGRect r _state = std::static_pointer_cast(state); } -- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { [_viewController.view insertSubview:childComponentView atIndex:index]; } -- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { [childComponentView removeFromSuperview]; } diff --git a/React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.h b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h similarity index 77% rename from React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.h rename to React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h index c4f8b2a13ee..ef647bc1555 100644 --- a/React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h @@ -7,14 +7,14 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** * UIView class for root component. */ -@interface RNRootComponentView : RNViewComponentView +@interface RCTRootComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.mm b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm similarity index 86% rename from React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm index 7ca0cb73df4..40178a53354 100644 --- a/React/Fabric/Mounting/ComponentViews/Root/RNRootComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNRootComponentView.h" +#import "RCTRootComponentView.h" #import #import using namespace facebook::react; -@implementation RNRootComponentView +@implementation RCTRootComponentView - (instancetype)initWithFrame:(CGRect)frame { @@ -24,7 +24,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h similarity index 85% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.h rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h index ee25dd1fcc0..d58465de681 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h @@ -7,7 +7,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN * `UIScrollView` subclass which has some improvements and tweaks * which are not directly related to React. */ -@interface RNEnhancedScrollView : UIScrollView +@interface RCTEnhancedScrollView : UIScrollView @property (nonatomic, assign) BOOL pinchGestureEnabled; @property (nonatomic, assign) BOOL centerContent; diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm similarity index 89% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.mm rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm index 114fd9f1733..e5b547b0ffb 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNEnhancedScrollView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNEnhancedScrollView.h" +#import "RCTEnhancedScrollView.h" -@implementation RNEnhancedScrollView +@implementation RCTEnhancedScrollView - (instancetype)initWithFrame:(CGRect)frame { diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h similarity index 82% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.h rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h index 135699b4ab7..18a1542486c 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h @@ -7,7 +7,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN * This view is designed to only serve ViewController-like purpose for the actual `UIRefreshControl` view which is being * attached to some `UIScrollView` (not to this view). */ -@interface RNPullToRefreshViewComponentView : RNViewComponentView +@interface RCTPullToRefreshViewComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm similarity index 90% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.mm rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index 942a132b4ba..bb8d564a73a 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNPullToRefreshViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -5,20 +5,20 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNPullToRefreshViewComponentView.h" +#import "RCTPullToRefreshViewComponentView.h" #import #import #import -#import -#import +#import +#import using namespace facebook::react; -@implementation RNPullToRefreshViewComponentView { +@implementation RCTPullToRefreshViewComponentView { UIRefreshControl *_refreshControl; - RNScrollViewComponentView *_scrollViewComponentView; + RCTScrollViewComponentView *_scrollViewComponentView; } - (instancetype)initWithFrame:(CGRect)frame @@ -41,7 +41,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { @@ -120,7 +120,7 @@ using namespace facebook::react; [self _detach]; } - _scrollViewComponentView = [RNScrollViewComponentView findScrollViewComponentViewForView:self]; + _scrollViewComponentView = [RCTScrollViewComponentView findScrollViewComponentViewForView:self]; if (!_scrollViewComponentView) { return; } diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h similarity index 76% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.h rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h index 92553504f5d..244edaea645 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h @@ -7,9 +7,9 @@ #import +#import #import -#import -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -21,12 +21,12 @@ NS_ASSUME_NONNULL_BEGIN * keyboard-avoiding functionality and so on. All that complexity must be implemented inside those components in order * to keep the complexity of this component manageable. */ -@interface RNScrollViewComponentView : RNViewComponentView +@interface RCTScrollViewComponentView : RCTViewComponentView /* - * Finds and returns the closet RNScrollViewComponentView component to the given view + * Finds and returns the closet RCTScrollViewComponentView component to the given view */ -+ (RNScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view; ++ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view; /* * Returns an actual UIScrollView that this component uses under the hood. @@ -43,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN /* * Returns a delegate splitter that can be used to subscribe for UIScrollView delegate. */ -@property (nonatomic, strong, readonly) RNGenericDelegateSplitter> *scrollViewDelegateSplitter; +@property (nonatomic, strong, readonly) + RCTGenericDelegateSplitter> *scrollViewDelegateSplitter; @end @@ -52,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN * Until Fabric has own command-execution pipeline we have to support that to some extent. The implementation shouldn't * be perfect though because very soon we will migrate that to the new commands infra and get rid of this. */ -@interface RNScrollViewComponentView (ScrollableProtocol) +@interface RCTScrollViewComponentView (ScrollableProtocol) @end diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm similarity index 89% rename from React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.mm rename to React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index ef55dec5d97..4006d01a4b8 100644 --- a/React/Fabric/Mounting/ComponentViews/ScrollView/RNScrollViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNScrollViewComponentView.h" +#import "RCTScrollViewComponentView.h" #import @@ -15,28 +15,28 @@ #import #import -#import "RNConversions.h" -#import "RNEnhancedScrollView.h" +#import "RCTConversions.h" +#import "RCTEnhancedScrollView.h" using namespace facebook::react; -@interface RNScrollViewComponentView () +@interface RCTScrollViewComponentView () @property (nonatomic, assign) CGFloat scrollEventThrottle; @end -@implementation RNScrollViewComponentView { +@implementation RCTScrollViewComponentView { ScrollViewShadowNode::ConcreteState::Shared _state; CGSize _contentSize; } -+ (RNScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view ++ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view { do { view = view.superview; - } while (view != nil && ![view isKindOfClass:[RNScrollViewComponentView class]]); - return (RNScrollViewComponentView *)view; + } while (view != nil && ![view isKindOfClass:[RCTScrollViewComponentView class]]); + return (RCTScrollViewComponentView *)view; } - (instancetype)initWithFrame:(CGRect)frame @@ -45,7 +45,7 @@ using namespace facebook::react; static const auto defaultProps = std::make_shared(); _props = defaultProps; - _scrollView = [[RNEnhancedScrollView alloc] initWithFrame:self.bounds]; + _scrollView = [[RCTEnhancedScrollView alloc] initWithFrame:self.bounds]; _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _scrollView.delaysContentTouches = NO; [self addSubview:_scrollView]; @@ -54,7 +54,7 @@ using namespace facebook::react; [_scrollView addSubview:_containerView]; __weak __typeof(self) weakSelf = self; - _scrollViewDelegateSplitter = [[RNGenericDelegateSplitter alloc] initWithDelegateUpdateBlock:^(id delegate) { + _scrollViewDelegateSplitter = [[RCTGenericDelegateSplitter alloc] initWithDelegateUpdateBlock:^(id delegate) { weakSelf.scrollView.delegate = delegate; }]; @@ -64,7 +64,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { @@ -84,7 +84,7 @@ using namespace facebook::react; #define REMAP_VIEW_PROP(reactName, localName) REMAP_PROP(reactName, localName, self) #define MAP_VIEW_PROP(name) REMAP_VIEW_PROP(name, name) #define REMAP_SCROLL_VIEW_PROP(reactName, localName) \ - REMAP_PROP(reactName, localName, ((RNEnhancedScrollView *)_scrollView)) + REMAP_PROP(reactName, localName, ((RCTEnhancedScrollView *)_scrollView)) #define MAP_SCROLL_VIEW_PROP(name) REMAP_SCROLL_VIEW_PROP(name, name) // FIXME: Commented props are not supported yet. @@ -137,12 +137,12 @@ using namespace facebook::react; _scrollView.contentSize = contentSize; } -- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { [_containerView insertSubview:childComponentView atIndex:index]; } -- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { RCTAssert(childComponentView.superview == _containerView, @"Attempt to unmount improperly mounted component view."); [childComponentView removeFromSuperview]; @@ -267,7 +267,7 @@ using namespace facebook::react; @end -@implementation RNScrollViewComponentView (ScrollableProtocol) +@implementation RCTScrollViewComponentView (ScrollableProtocol) - (CGSize)contentSize { diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.h b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h similarity index 77% rename from React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.h rename to React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h index f5e6c72bce6..75ca052d915 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h @@ -7,14 +7,14 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** * UIView class for root component. */ -@interface RNSliderComponentView : RNViewComponentView +@interface RCTSliderComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.mm b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm similarity index 92% rename from React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm index b89a6403d8c..cb0bb3757b6 100644 --- a/React/Fabric/Mounting/ComponentViews/Slider/RNSliderComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSliderComponentView.h" +#import "RCTSliderComponentView.h" -#import +#import #import #import #import @@ -15,7 +15,7 @@ using namespace facebook::react; -@implementation RNSliderComponentView { +@implementation RCTSliderComponentView { UISlider *_sliderView; float _previousValue; SharedSliderLocalData _sliderLocalData; @@ -30,10 +30,10 @@ using namespace facebook::react; const ImageResponseObserverCoordinator *_maximumTrackImageCoordinator; const ImageResponseObserverCoordinator *_thumbImageCoordinator; - std::unique_ptr _trackImageResponseObserverProxy; - std::unique_ptr _minimumTrackImageResponseObserverProxy; - std::unique_ptr _maximumTrackImageResponseObserverProxy; - std::unique_ptr _thumbImageResponseObserverProxy; + std::unique_ptr _trackImageResponseObserverProxy; + std::unique_ptr _minimumTrackImageResponseObserverProxy; + std::unique_ptr _maximumTrackImageResponseObserverProxy; + std::unique_ptr _thumbImageResponseObserverProxy; } - (instancetype)initWithFrame:(CGRect)frame @@ -51,10 +51,10 @@ using namespace facebook::react; _sliderView.value = defaultProps->value; - _trackImageResponseObserverProxy = std::make_unique((__bridge void *)self); - _minimumTrackImageResponseObserverProxy = std::make_unique((__bridge void *)self); - _maximumTrackImageResponseObserverProxy = std::make_unique((__bridge void *)self); - _thumbImageResponseObserverProxy = std::make_unique((__bridge void *)self); + _trackImageResponseObserverProxy = std::make_unique((__bridge void *)self); + _minimumTrackImageResponseObserverProxy = std::make_unique((__bridge void *)self); + _maximumTrackImageResponseObserverProxy = std::make_unique((__bridge void *)self); + _thumbImageResponseObserverProxy = std::make_unique((__bridge void *)self); self.contentView = _sliderView; } @@ -100,7 +100,7 @@ using namespace facebook::react; _thumbImageResponseObserverProxy.reset(); } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { @@ -310,7 +310,7 @@ using namespace facebook::react; _previousValue = value; } -#pragma mark - RNImageResponseDelegate +#pragma mark - RCTImageResponseDelegate - (void)didReceiveImage:(UIImage *)image fromObserver:(void *)observer { diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.h b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h similarity index 77% rename from React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.h rename to React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h index 76b2accc368..b18ea4b2148 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h @@ -7,14 +7,14 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** * UIView class for root component. */ -@interface RNSwitchComponentView : RNViewComponentView +@interface RCTSwitchComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.mm b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm similarity index 95% rename from React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm index 7b626d9113c..c4183aecb17 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RNSwitchComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSwitchComponentView.h" +#import "RCTSwitchComponentView.h" #import #import @@ -13,7 +13,7 @@ using namespace facebook::react; -@implementation RNSwitchComponentView { +@implementation RCTSwitchComponentView { UISwitch *_switchView; BOOL _wasOn; } @@ -36,7 +36,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { diff --git a/React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.h b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h similarity index 76% rename from React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.h rename to React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h index 8c62aa6a0b0..9e9573a58f3 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h @@ -7,14 +7,14 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** * UIView class for component. */ -@interface RNParagraphComponentView : RNViewComponentView +@interface RCTParagraphComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm similarity index 96% rename from React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.mm rename to React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index f13b2115fb3..accbeea508a 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RNParagraphComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNParagraphComponentView.h" +#import "RCTParagraphComponentView.h" #import #import @@ -16,11 +16,11 @@ #import #import #import -#import "RNConversions.h" +#import "RCTConversions.h" using namespace facebook::react; -@implementation RNParagraphComponentView { +@implementation RCTParagraphComponentView { ParagraphShadowNode::ConcreteState::Shared _state; ParagraphAttributes _paragraphAttributes; } @@ -40,7 +40,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { diff --git a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.h b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h similarity index 71% rename from React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.h rename to React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h index ec823fc9226..0a33c7f7d66 100644 --- a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h @@ -7,11 +7,11 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN -@interface RNUnimplementedNativeComponentView : RNViewComponentView +@interface RCTUnimplementedNativeComponentView : RCTViewComponentView @end diff --git a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.mm b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm similarity index 92% rename from React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.mm rename to React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm index 6e20a514bc7..dd9555959db 100644 --- a/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RNUnimplementedNativeComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNUnimplementedNativeComponentView.h" +#import "RCTUnimplementedNativeComponentView.h" #import #import @@ -13,7 +13,7 @@ using namespace facebook::react; -@implementation RNUnimplementedNativeComponentView { +@implementation RCTUnimplementedNativeComponentView { UILabel *_label; } @@ -38,7 +38,7 @@ using namespace facebook::react; return self; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { diff --git a/React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.h b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h similarity index 93% rename from React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.h rename to React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h index 94165fa2167..a3d55f0fd07 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h @@ -7,8 +7,8 @@ #import -#import -#import +#import +#import #import #import #import @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN /** * UIView class for component. */ -@interface RNViewComponentView : UIView { +@interface RCTViewComponentView : UIView { @protected facebook::react::LayoutMetrics _layoutMetrics; facebook::react::SharedViewProps _props; @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; /** - * Enforcing `call super` semantic for overridden methods from `RNComponentViewProtocol`. + * Enforcing `call super` semantic for overridden methods from `RCTComponentViewProtocol`. * The methods update the instance variables. */ - (void)updateProps:(facebook::react::Props::Shared const &)props diff --git a/React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm similarity index 97% rename from React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.mm rename to React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 4bbcf5f4286..8c67f8f0457 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RNViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNViewComponentView.h" +#import "RCTViewComponentView.h" #import #import @@ -14,11 +14,11 @@ #import #import -#import "RNConversions.h" +#import "RCTConversions.h" using namespace facebook::react; -@implementation RNViewComponentView { +@implementation RCTViewComponentView { UIColor *_backgroundColor; CALayer *_borderLayer; BOOL _needsInvalidateLayer; @@ -83,13 +83,13 @@ using namespace facebook::react; _backgroundColor = backgroundColor; } -#pragma mark - RNComponentViewProtocol +#pragma mark - RCTComponentViewProtocol + (ComponentDescriptorProvider)componentDescriptorProvider { RCTAssert( - self == [RNViewComponentView class], - @"`+[RNComponentViewProtocol componentDescriptorProvider]` must be implemented for all subclasses (and `%@` particularly).", + self == [RCTViewComponentView class], + @"`+[RCTComponentViewProtocol componentDescriptorProvider]` must be implemented for all subclasses (and `%@` particularly).", NSStringFromClass([self class])); return concreteComponentDescriptorProvider(); } @@ -100,9 +100,9 @@ using namespace facebook::react; auto propsRawPtr = _props.get(); RCTAssert( propsRawPtr && - ([self class] == [RNViewComponentView class] || + ([self class] == [RCTViewComponentView class] || typeid(*propsRawPtr).hash_code() != typeid(ViewProps const).hash_code()), - @"`RNViewComponentView` subclasses (and `%@` particularly) must setup `_props`" + @"`RCTViewComponentView` subclasses (and `%@` particularly) must setup `_props`" " instance variable with a default value in the constructor.", NSStringFromClass([self class])); #endif diff --git a/React/Fabric/Mounting/RNComponentViewFactory.h b/React/Fabric/Mounting/RCTComponentViewFactory.h similarity index 74% rename from React/Fabric/Mounting/RNComponentViewFactory.h rename to React/Fabric/Mounting/RCTComponentViewFactory.h index 5cfb1fe6c2c..6f3c72642c4 100644 --- a/React/Fabric/Mounting/RNComponentViewFactory.h +++ b/React/Fabric/Mounting/RCTComponentViewFactory.h @@ -7,7 +7,7 @@ #import -#import +#import #import @@ -17,27 +17,27 @@ NS_ASSUME_NONNULL_BEGIN * Registry of supported component view classes that can instantiate * view component instances by given component handle. */ -@interface RNComponentViewFactory : NSObject +@interface RCTComponentViewFactory : NSObject /** * Constructs and returns an instance of the class with a bunch of already registered standard components. */ -+ (RNComponentViewFactory *)standardComponentViewFactory; ++ (RCTComponentViewFactory *)standardComponentViewFactory; /** * Registers a component view class in the factory. */ -- (void)registerComponentViewClass:(Class)componentViewClass; +- (void)registerComponentViewClass:(Class)componentViewClass; /** * Unregisters a component view class in the factory. */ -- (void)unregisterComponentViewClass:(Class)componentViewClass; +- (void)unregisterComponentViewClass:(Class)componentViewClass; /** * Creates a component view with given component handle. */ -- (UIView *)createComponentViewWithComponentHandle: +- (UIView *)createComponentViewWithComponentHandle: (facebook::react::ComponentHandle)componentHandle; /** diff --git a/React/Fabric/Mounting/RNComponentViewFactory.mm b/React/Fabric/Mounting/RCTComponentViewFactory.mm similarity index 53% rename from React/Fabric/Mounting/RNComponentViewFactory.mm rename to React/Fabric/Mounting/RCTComponentViewFactory.mm index 578b8587b44..4a2d9703d31 100644 --- a/React/Fabric/Mounting/RNComponentViewFactory.mm +++ b/React/Fabric/Mounting/RCTComponentViewFactory.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNComponentViewFactory.h" +#import "RCTComponentViewFactory.h" #import #import @@ -14,46 +14,46 @@ #import #import -#import "RNActivityIndicatorViewComponentView.h" -#import "RNImageComponentView.h" -#import "RNModalHostViewComponentView.h" -#import "RNParagraphComponentView.h" -#import "RNPullToRefreshViewComponentView.h" -#import "RNRootComponentView.h" -#import "RNScrollViewComponentView.h" -#import "RNSliderComponentView.h" -#import "RNSwitchComponentView.h" -#import "RNUnimplementedNativeComponentView.h" -#import "RNViewComponentView.h" +#import "RCTActivityIndicatorViewComponentView.h" +#import "RCTImageComponentView.h" +#import "RCTModalHostViewComponentView.h" +#import "RCTParagraphComponentView.h" +#import "RCTPullToRefreshViewComponentView.h" +#import "RCTRootComponentView.h" +#import "RCTScrollViewComponentView.h" +#import "RCTSliderComponentView.h" +#import "RCTSwitchComponentView.h" +#import "RCTUnimplementedNativeComponentView.h" +#import "RCTViewComponentView.h" using namespace facebook::react; -@implementation RNComponentViewFactory { - better::map> _componentViewClasses; +@implementation RCTComponentViewFactory { + better::map> _componentViewClasses; ComponentDescriptorProviderRegistry _providerRegistry; better::shared_mutex _mutex; } -+ (RNComponentViewFactory *)standardComponentViewFactory ++ (RCTComponentViewFactory *)standardComponentViewFactory { - RNComponentViewFactory *componentViewFactory = [[RNComponentViewFactory alloc] init]; + RCTComponentViewFactory *componentViewFactory = [[RCTComponentViewFactory alloc] init]; - [componentViewFactory registerComponentViewClass:[RNViewComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNRootComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNScrollViewComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNPullToRefreshViewComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNImageComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNParagraphComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNActivityIndicatorViewComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNSliderComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNSwitchComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNUnimplementedNativeComponentView class]]; - [componentViewFactory registerComponentViewClass:[RNModalHostViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTRootComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTScrollViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTPullToRefreshViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTImageComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTParagraphComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTActivityIndicatorViewComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTSliderComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTSwitchComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTUnimplementedNativeComponentView class]]; + [componentViewFactory registerComponentViewClass:[RCTModalHostViewComponentView class]]; return componentViewFactory; } -- (void)registerComponentViewClass:(Class)componentViewClass +- (void)registerComponentViewClass:(Class)componentViewClass { std::unique_lock lock(_mutex); @@ -67,7 +67,7 @@ using namespace facebook::react; } } -- (void)unregisterComponentViewClass:(Class)componentViewClass +- (void)unregisterComponentViewClass:(Class)componentViewClass { std::unique_lock lock(_mutex); @@ -76,7 +76,7 @@ using namespace facebook::react; _providerRegistry.remove(componentDescriptorProvider); } -- (UIView *)createComponentViewWithComponentHandle: +- (UIView *)createComponentViewWithComponentHandle: (facebook::react::ComponentHandle)componentHandle { RCTAssertMainQueue(); diff --git a/React/Fabric/Mounting/RNComponentViewProtocol.h b/React/Fabric/Mounting/RCTComponentViewProtocol.h similarity index 93% rename from React/Fabric/Mounting/RNComponentViewProtocol.h rename to React/Fabric/Mounting/RCTComponentViewProtocol.h index 8336776dcaa..c27e46f319e 100644 --- a/React/Fabric/Mounting/RNComponentViewProtocol.h +++ b/React/Fabric/Mounting/RCTComponentViewProtocol.h @@ -7,7 +7,7 @@ #import -#import +#import #import #import #import @@ -38,7 +38,7 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) { * `UIView+ComponentViewProtocol` category provides default implementation * for all of them. */ -@protocol RNComponentViewProtocol +@protocol RCTComponentViewProtocol /* * Returns a `ComponentDescriptorProvider` of a particular `ComponentDescriptor` which this component view @@ -57,14 +57,14 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) { * component view. * Receiver must add `childComponentView` as a subview. */ -- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; /* * Called for unmounting (detaching) a child component view from `self` * component view. * Receiver must remove `childComponentView` as a subview. */ -- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; /* * Called for updating component's props. diff --git a/React/Fabric/Mounting/RNComponentViewRegistry.h b/React/Fabric/Mounting/RCTComponentViewRegistry.h similarity index 65% rename from React/Fabric/Mounting/RNComponentViewRegistry.h rename to React/Fabric/Mounting/RCTComponentViewRegistry.h index a87b48513d8..d86b021e725 100644 --- a/React/Fabric/Mounting/RNComponentViewRegistry.h +++ b/React/Fabric/Mounting/RCTComponentViewRegistry.h @@ -7,8 +7,8 @@ #import -#import -#import +#import +#import #import NS_ASSUME_NONNULL_BEGIN @@ -17,18 +17,18 @@ NS_ASSUME_NONNULL_BEGIN * Registry of native component views. * Provides basic functionality for allocation, recycling, and querying (by tag) native view instances. */ -@interface RNComponentViewRegistry : NSObject +@interface RCTComponentViewRegistry : NSObject -@property (nonatomic, strong, readonly) RNComponentViewFactory *componentViewFactory; +@property (nonatomic, strong, readonly) RCTComponentViewFactory *componentViewFactory; /** * Returns a native view instance from the recycle pool (or create) * for given `componentHandle` and with given `tag`. * #RefuseSingleUse */ -- (UIView *)dequeueComponentViewWithComponentHandle: - (facebook::react::ComponentHandle)componentHandle - tag:(ReactTag)tag; +- (UIView *)dequeueComponentViewWithComponentHandle: + (facebook::react::ComponentHandle)componentHandle + tag:(ReactTag)tag; /** * Puts a given native component view to the recycle pool. @@ -36,17 +36,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)enqueueComponentViewWithComponentHandle:(facebook::react::ComponentHandle)componentHandle tag:(ReactTag)tag - componentView:(UIView *)componentView; + componentView:(UIView *)componentView; /** * Returns a native component view by given `tag`. */ -- (UIView *)componentViewByTag:(ReactTag)tag; +- (UIView *)componentViewByTag:(ReactTag)tag; /** * Returns `tag` associated with given `componentView`. */ -- (ReactTag)tagByComponentView:(UIView *)componentView; +- (ReactTag)tagByComponentView:(UIView *)componentView; /** * Creates a component view with a given type and puts it to the recycle pool. diff --git a/React/Fabric/Mounting/RNComponentViewRegistry.mm b/React/Fabric/Mounting/RCTComponentViewRegistry.mm similarity index 75% rename from React/Fabric/Mounting/RNComponentViewRegistry.mm rename to React/Fabric/Mounting/RCTComponentViewRegistry.mm index b7b343fa524..80ed859e420 100644 --- a/React/Fabric/Mounting/RNComponentViewRegistry.mm +++ b/React/Fabric/Mounting/RCTComponentViewRegistry.mm @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNComponentViewRegistry.h" +#import "RCTComponentViewRegistry.h" #import #import -#import "RNImageComponentView.h" -#import "RNParagraphComponentView.h" -#import "RNViewComponentView.h" +#import "RCTImageComponentView.h" +#import "RCTParagraphComponentView.h" +#import "RCTViewComponentView.h" using namespace facebook::react; @@ -70,11 +70,11 @@ using namespace facebook::react; #endif -const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; +const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024; -@implementation RNComponentViewRegistry { - NSMapTable *> *_registry; - NSMapTable *> *> *_recyclePool; +@implementation RCTComponentViewRegistry { + NSMapTable *> *_registry; + NSMapTable *> *> *_recyclePool; } - (instancetype)init @@ -85,7 +85,7 @@ const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; _recyclePool = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsOpaquePersonality | NSPointerFunctionsOpaqueMemory valueOptions:NSPointerFunctionsObjectPersonality]; - _componentViewFactory = [RNComponentViewFactory standardComponentViewFactory]; + _componentViewFactory = [RCTComponentViewFactory standardComponentViewFactory]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleApplicationDidReceiveMemoryWarningNotification) @@ -106,9 +106,9 @@ const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; // This data is based on empirical evidence which should represent the reality pretty well. // Regular `` has magnitude equals to `1` by definition. std::vector> componentMagnitudes = { - {[RNViewComponentView componentDescriptorProvider].handle, 1}, - {[RNImageComponentView componentDescriptorProvider].handle, 0.3}, - {[RNParagraphComponentView componentDescriptorProvider].handle, 0.3}, + {[RCTViewComponentView componentDescriptorProvider].handle, 1}, + {[RCTImageComponentView componentDescriptorProvider].handle, 0.3}, + {[RCTParagraphComponentView componentDescriptorProvider].handle, 0.3}, }; // `complexity` represents the complexity of a typical surface in a number of `` components (with Flattening @@ -128,16 +128,16 @@ const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (UIView *)dequeueComponentViewWithComponentHandle:(ComponentHandle)componentHandle - tag:(ReactTag)tag +- (UIView *)dequeueComponentViewWithComponentHandle:(ComponentHandle)componentHandle + tag:(ReactTag)tag { RCTAssertMainQueue(); RCTAssert( ![_registry objectForKey:(__bridge id)(void *)tag], - @"RNComponentViewRegistry: Attempt to dequeue already registered component."); + @"RCTComponentViewRegistry: Attempt to dequeue already registered component."); - UIView *componentView = [self _dequeueComponentViewWithComponentHandle:componentHandle]; + UIView *componentView = [self _dequeueComponentViewWithComponentHandle:componentHandle]; componentView.tag = tag; [_registry setObject:componentView forKey:(__bridge id)(void *)tag]; @@ -150,13 +150,13 @@ const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; - (void)enqueueComponentViewWithComponentHandle:(ComponentHandle)componentHandle tag:(ReactTag)tag - componentView:(UIView *)componentView + componentView:(UIView *)componentView { RCTAssertMainQueue(); RCTAssert( [_registry objectForKey:(__bridge id)(void *)tag], - @"RNComponentViewRegistry: Attempt to enqueue unregistered component."); + @"RCTComponentViewRegistry: Attempt to enqueue unregistered component."); #ifdef LEGACY_UIMANAGER_INTEGRATION_ENABLED [RCTUIManager unregisterView:componentView]; @@ -175,44 +175,44 @@ const NSInteger RNComponentViewRegistryRecyclePoolMaxSize = 1024; createComponentViewWithComponentHandle:componentHandle]]; } -- (UIView *)componentViewByTag:(ReactTag)tag +- (UIView *)componentViewByTag:(ReactTag)tag { RCTAssertMainQueue(); return [_registry objectForKey:(__bridge id)(void *)tag]; } -- (ReactTag)tagByComponentView:(UIView *)componentView +- (ReactTag)tagByComponentView:(UIView *)componentView { RCTAssertMainQueue(); return componentView.tag; } -- (nullable UIView *)_dequeueComponentViewWithComponentHandle:(ComponentHandle)componentHandle +- (nullable UIView *)_dequeueComponentViewWithComponentHandle:(ComponentHandle)componentHandle { RCTAssertMainQueue(); - NSHashTable *> *componentViews = + NSHashTable *> *componentViews = [_recyclePool objectForKey:(__bridge id)(void *)componentHandle]; if (!componentViews || componentViews.count == 0) { return [self.componentViewFactory createComponentViewWithComponentHandle:componentHandle]; } - UIView *componentView = [componentViews anyObject]; + UIView *componentView = [componentViews anyObject]; [componentViews removeObject:componentView]; return componentView; } - (void)_enqueueComponentViewWithComponentHandle:(ComponentHandle)componentHandle - componentView:(UIView *)componentView + componentView:(UIView *)componentView { RCTAssertMainQueue(); - NSHashTable *> *componentViews = + NSHashTable *> *componentViews = [_recyclePool objectForKey:(__bridge id)(void *)componentHandle]; if (!componentViews) { componentViews = [NSHashTable hashTableWithOptions:NSPointerFunctionsObjectPersonality]; [_recyclePool setObject:componentViews forKey:(__bridge id)(void *)componentHandle]; } - if (componentViews.count >= RNComponentViewRegistryRecyclePoolMaxSize) { + if (componentViews.count >= RCTComponentViewRegistryRecyclePoolMaxSize) { return; } diff --git a/React/Fabric/Mounting/RNMountingManager.h b/React/Fabric/Mounting/RCTMountingManager.h similarity index 79% rename from React/Fabric/Mounting/RNMountingManager.h rename to React/Fabric/Mounting/RCTMountingManager.h index f6ff35ae77c..dbc0d604d87 100644 --- a/React/Fabric/Mounting/RNMountingManager.h +++ b/React/Fabric/Mounting/RCTMountingManager.h @@ -7,8 +7,8 @@ #import -#import -#import +#import +#import #import #import #import @@ -16,15 +16,15 @@ NS_ASSUME_NONNULL_BEGIN -@class RNComponentViewRegistry; +@class RCTComponentViewRegistry; /** * Manages mounting process. */ -@interface RNMountingManager : NSObject +@interface RCTMountingManager : NSObject -@property (nonatomic, weak) id delegate; -@property (nonatomic, strong) RNComponentViewRegistry *componentViewRegistry; +@property (nonatomic, weak) id delegate; +@property (nonatomic, strong) RCTComponentViewRegistry *componentViewRegistry; /** * Schedule a mounting transaction to be performed on the main thread. diff --git a/React/Fabric/Mounting/RNMountingManager.mm b/React/Fabric/Mounting/RCTMountingManager.mm similarity index 79% rename from React/Fabric/Mounting/RNMountingManager.mm rename to React/Fabric/Mounting/RCTMountingManager.mm index 0bac90c7309..48eeeff15ee 100644 --- a/React/Fabric/Mounting/RNMountingManager.mm +++ b/React/Fabric/Mounting/RCTMountingManager.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNMountingManager.h" +#import "RCTMountingManager.h" #import @@ -16,25 +16,25 @@ #import #import -#import "RNComponentViewProtocol.h" -#import "RNComponentViewRegistry.h" -#import "RNConversions.h" +#import "RCTComponentViewProtocol.h" +#import "RCTComponentViewRegistry.h" +#import "RCTConversions.h" using namespace facebook; using namespace facebook::react; // `Create` instruction -static void RNCreateMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNCreateMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { [registry dequeueComponentViewWithComponentHandle:mutation.newChildShadowView.componentHandle tag:mutation.newChildShadowView.tag]; } // `Delete` instruction -static void RNDeleteMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNDeleteMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &oldChildShadowView = mutation.oldChildShadowView; - UIView *componentView = [registry componentViewByTag:oldChildShadowView.tag]; + UIView *componentView = [registry componentViewByTag:oldChildShadowView.tag]; assert(componentView != nil && "Attempt to delete unregistered component."); @@ -44,13 +44,13 @@ static void RNDeleteMountInstruction(ShadowViewMutation const &mutation, RNCompo } // `Insert` instruction -static void RNInsertMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNInsertMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &newShadowView = mutation.newChildShadowView; auto const &parentShadowView = mutation.parentShadowView; - UIView *childComponentView = [registry componentViewByTag:newShadowView.tag]; - UIView *parentComponentView = [registry componentViewByTag:parentShadowView.tag]; + UIView *childComponentView = [registry componentViewByTag:newShadowView.tag]; + UIView *parentComponentView = [registry componentViewByTag:parentShadowView.tag]; assert(childComponentView != nil && "Attempt to mount unregistered component."); assert(parentComponentView != nil && "Attempt to mount into unregistered component."); @@ -59,13 +59,13 @@ static void RNInsertMountInstruction(ShadowViewMutation const &mutation, RNCompo } // `Remove` instruction -static void RNRemoveMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNRemoveMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &oldShadowView = mutation.oldChildShadowView; auto const &parentShadowView = mutation.parentShadowView; - UIView *childComponentView = [registry componentViewByTag:oldShadowView.tag]; - UIView *parentComponentView = [registry componentViewByTag:parentShadowView.tag]; + UIView *childComponentView = [registry componentViewByTag:oldShadowView.tag]; + UIView *parentComponentView = [registry componentViewByTag:parentShadowView.tag]; assert(childComponentView != nil && "Attempt to unmount unregistered component."); assert(parentComponentView != nil && "Attempt to unmount from unregistered component."); @@ -74,46 +74,48 @@ static void RNRemoveMountInstruction(ShadowViewMutation const &mutation, RNCompo } // `Update Props` instruction -static void RNUpdatePropsMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNUpdatePropsMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &oldShadowView = mutation.oldChildShadowView; auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView updateProps:newShadowView.props oldProps:oldShadowView.props]; } // `Update EventEmitter` instruction -static void RNUpdateEventEmitterMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNUpdateEventEmitterMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView updateEventEmitter:newShadowView.eventEmitter]; } // `Update LayoutMetrics` instruction -static void RNUpdateLayoutMetricsMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNUpdateLayoutMetricsMountInstruction( + ShadowViewMutation const &mutation, + RCTComponentViewRegistry *registry) { auto const &oldShadowView = mutation.oldChildShadowView; auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView updateLayoutMetrics:newShadowView.layoutMetrics oldLayoutMetrics:oldShadowView.layoutMetrics]; } // `Update LocalData` instruction -static void RNUpdateLocalDataMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNUpdateLocalDataMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &oldShadowView = mutation.oldChildShadowView; auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView updateLocalData:newShadowView.localData oldLocalData:oldShadowView.localData]; } // `Update State` instruction -static void RNUpdateStateMountInstruction(ShadowViewMutation const &mutation, RNComponentViewRegistry *registry) +static void RNUpdateStateMountInstruction(ShadowViewMutation const &mutation, RCTComponentViewRegistry *registry) { auto const &oldShadowView = mutation.oldChildShadowView; auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView updateState:newShadowView.state oldState:oldShadowView.state]; } @@ -121,15 +123,15 @@ static void RNUpdateStateMountInstruction(ShadowViewMutation const &mutation, RN static void RNFinalizeUpdatesMountInstruction( ShadowViewMutation const &mutation, RNComponentViewUpdateMask mask, - RNComponentViewRegistry *registry) + RCTComponentViewRegistry *registry) { auto const &newShadowView = mutation.newChildShadowView; - UIView *componentView = [registry componentViewByTag:newShadowView.tag]; + UIView *componentView = [registry componentViewByTag:newShadowView.tag]; [componentView finalizeUpdates:mask]; } // `Update` instruction -static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, RNComponentViewRegistry *registry) +static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, RCTComponentViewRegistry *registry) { SystraceSection s("RNPerformMountInstructions"); @@ -194,12 +196,12 @@ static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, } } -@implementation RNMountingManager +@implementation RCTMountingManager - (instancetype)init { if (self = [super init]) { - _componentViewRegistry = [[RNComponentViewRegistry alloc] init]; + _componentViewRegistry = [[RCTComponentViewRegistry alloc] init]; } return self; @@ -241,7 +243,7 @@ static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, - (void)mountMutations:(MountingCoordinator::Shared const &)mountingCoordinator { - SystraceSection s("-[RNMountingManager mountMutations:]"); + SystraceSection s("-[RCTMountingManager mountMutations:]"); auto transaction = mountingCoordinator->pullTransaction(); if (!transaction.has_value()) { @@ -261,7 +263,7 @@ static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, componentDescriptor:(const ComponentDescriptor &)componentDescriptor { RCTAssertMainQueue(); - UIView *componentView = [_componentViewRegistry componentViewByTag:reactTag]; + UIView *componentView = [_componentViewRegistry componentViewByTag:reactTag]; SharedProps oldProps = [componentView props]; SharedProps newProps = componentDescriptor.cloneProps(oldProps, RawProps(convertIdToFollyDynamic(props))); [componentView updateProps:newProps oldProps:oldProps]; @@ -272,7 +274,7 @@ static void RNPerformMountInstructions(ShadowViewMutationList const &mutations, args:(NSArray *)args { RCTAssertMainQueue(); - UIView *componentView = [_componentViewRegistry componentViewByTag:reactTag]; + UIView *componentView = [_componentViewRegistry componentViewByTag:reactTag]; [componentView handleCommand:commandName args:args]; } diff --git a/React/Fabric/Mounting/RNMountingManagerDelegate.h b/React/Fabric/Mounting/RCTMountingManagerDelegate.h similarity index 63% rename from React/Fabric/Mounting/RNMountingManagerDelegate.h rename to React/Fabric/Mounting/RCTMountingManagerDelegate.h index bb5deb444aa..cd0108153f8 100644 --- a/React/Fabric/Mounting/RNMountingManagerDelegate.h +++ b/React/Fabric/Mounting/RCTMountingManagerDelegate.h @@ -7,30 +7,30 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN -@class RNMountingManager; +@class RCTMountingManager; /** * MountingManager's delegate. */ -@protocol RNMountingManagerDelegate +@protocol RCTMountingManagerDelegate /* * Called right *before* execution of mount items which affect a Surface with * given `rootTag`. * Always called on the main queue. */ -- (void)mountingManager:(RNMountingManager *)mountingManager willMountComponentsWithRootTag:(ReactTag)MountingManager; +- (void)mountingManager:(RCTMountingManager *)mountingManager willMountComponentsWithRootTag:(ReactTag)MountingManager; /* * Called right *after* execution of mount items which affect a Surface with * given `rootTag`. * Always called on the main queue. */ -- (void)mountingManager:(RNMountingManager *)mountingManager didMountComponentsWithRootTag:(ReactTag)rootTag; +- (void)mountingManager:(RCTMountingManager *)mountingManager didMountComponentsWithRootTag:(ReactTag)rootTag; @end diff --git a/React/Fabric/Mounting/UIView+ComponentViewProtocol.h b/React/Fabric/Mounting/UIView+ComponentViewProtocol.h index 76cbbb2df29..ac46d801c6c 100644 --- a/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +++ b/React/Fabric/Mounting/UIView+ComponentViewProtocol.h @@ -7,20 +7,20 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN /** - * Default implementation of RNComponentViewProtocol. + * Default implementation of RCTComponentViewProtocol. */ -@interface UIView (ComponentViewProtocol) +@interface UIView (ComponentViewProtocol) + (std::vector)supplementalComponentDescriptorProviders; -- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; -- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index; - (void)updateProps:(facebook::react::Props::Shared const &)props oldProps:(facebook::react::Props::Shared const &)oldProps; diff --git a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm index 50c1d189529..225e7bf4a2c 100644 --- a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +++ b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm @@ -11,7 +11,7 @@ #import #import -#import "RNConversions.h" +#import "RCTConversions.h" using namespace facebook::react; @@ -19,7 +19,7 @@ using namespace facebook::react; + (ComponentDescriptorProvider)componentDescriptorProvider { - RCTAssert(NO, @"`-[RNComponentViewProtocol componentDescriptorProvider]` must be implemented in a concrete class."); + RCTAssert(NO, @"`-[RCTComponentViewProtocol componentDescriptorProvider]` must be implemented in a concrete class."); return {}; } @@ -28,12 +28,12 @@ using namespace facebook::react; return {}; } -- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)mountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { [self insertSubview:childComponentView atIndex:index]; } -- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index +- (void)unmountChildComponentView:(UIView *)childComponentView index:(NSInteger)index { RCTAssert(childComponentView.superview == self, @"Attempt to unmount improperly mounted component view."); [childComponentView removeFromSuperview]; @@ -115,7 +115,7 @@ using namespace facebook::react; - (facebook::react::SharedProps)props { - RCTAssert(NO, @"props access should be implemented by RNViewComponentView."); + RCTAssert(NO, @"props access should be implemented by RCTViewComponentView."); return nullptr; } diff --git a/React/Fabric/RNConversions.h b/React/Fabric/RCTConversions.h similarity index 100% rename from React/Fabric/RNConversions.h rename to React/Fabric/RCTConversions.h diff --git a/React/Fabric/RNImageResponseDelegate.h b/React/Fabric/RCTImageResponseDelegate.h similarity index 91% rename from React/Fabric/RNImageResponseDelegate.h rename to React/Fabric/RCTImageResponseDelegate.h index b639e0f2936..db313305f44 100644 --- a/React/Fabric/RNImageResponseDelegate.h +++ b/React/Fabric/RCTImageResponseDelegate.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@protocol RNImageResponseDelegate +@protocol RCTImageResponseDelegate - (void)didReceiveImage:(UIImage *)image fromObserver:(void*)observer; - (void)didReceiveProgress:(float)progress fromObserver:(void*)observer; diff --git a/React/Fabric/RNImageResponseObserverProxy.h b/React/Fabric/RCTImageResponseObserverProxy.h similarity index 73% rename from React/Fabric/RNImageResponseObserverProxy.h rename to React/Fabric/RCTImageResponseObserverProxy.h index 3ad0927b148..a595dc53750 100644 --- a/React/Fabric/RNImageResponseObserverProxy.h +++ b/React/Fabric/RCTImageResponseObserverProxy.h @@ -7,7 +7,7 @@ #pragma once -#import "RNImageResponseDelegate.h" +#import "RCTImageResponseDelegate.h" #include @@ -15,15 +15,15 @@ NS_ASSUME_NONNULL_BEGIN namespace facebook { namespace react { -class RNImageResponseObserverProxy : public ImageResponseObserver { +class RCTImageResponseObserverProxy : public ImageResponseObserver { public: - RNImageResponseObserverProxy(void *delegate); + RCTImageResponseObserverProxy(void *delegate); void didReceiveImage(const ImageResponse &imageResponse) override; void didReceiveProgress(float p) override; void didReceiveFailure() override; private: - __weak id delegate_; + __weak id delegate_; }; } // namespace react } // namespace facebook diff --git a/React/Fabric/RNImageResponseObserverProxy.mm b/React/Fabric/RCTImageResponseObserverProxy.mm similarity index 68% rename from React/Fabric/RNImageResponseObserverProxy.mm rename to React/Fabric/RCTImageResponseObserverProxy.mm index 4c9d6b17a4d..9a532d354a0 100644 --- a/React/Fabric/RNImageResponseObserverProxy.mm +++ b/React/Fabric/RCTImageResponseObserverProxy.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNImageResponseObserverProxy.h" +#import "RCTImageResponseObserverProxy.h" #import #import @@ -13,12 +13,12 @@ namespace facebook { namespace react { -RNImageResponseObserverProxy::RNImageResponseObserverProxy(void *delegate) - : delegate_((__bridge id)delegate) +RCTImageResponseObserverProxy::RCTImageResponseObserverProxy(void *delegate) + : delegate_((__bridge id)delegate) { } -void RNImageResponseObserverProxy::didReceiveImage(const ImageResponse &imageResponse) +void RCTImageResponseObserverProxy::didReceiveImage(const ImageResponse &imageResponse) { UIImage *image = (__bridge UIImage *)imageResponse.getImage().get(); void *this_ = this; @@ -27,7 +27,7 @@ void RNImageResponseObserverProxy::didReceiveImage(const ImageResponse &imageRes }); } -void RNImageResponseObserverProxy::didReceiveProgress(float p) +void RCTImageResponseObserverProxy::didReceiveProgress(float p) { void *this_ = this; dispatch_async(dispatch_get_main_queue(), ^{ @@ -35,7 +35,7 @@ void RNImageResponseObserverProxy::didReceiveProgress(float p) }); } -void RNImageResponseObserverProxy::didReceiveFailure() +void RCTImageResponseObserverProxy::didReceiveFailure() { void *this_ = this; dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/React/Fabric/RNPrimitives.h b/React/Fabric/RCTPrimitives.h similarity index 100% rename from React/Fabric/RNPrimitives.h rename to React/Fabric/RCTPrimitives.h diff --git a/React/Fabric/RNScheduler.h b/React/Fabric/RCTScheduler.h similarity index 92% rename from React/Fabric/RNScheduler.h rename to React/Fabric/RCTScheduler.h index 4221c9d3278..1dbd74b49e8 100644 --- a/React/Fabric/RNScheduler.h +++ b/React/Fabric/RCTScheduler.h @@ -8,7 +8,7 @@ #import #import -#import +#import #import #import #import @@ -19,12 +19,12 @@ NS_ASSUME_NONNULL_BEGIN -@class RNMountingManager; +@class RCTMountingManager; /** * Exactly same semantic as `facebook::react::SchedulerDelegate`. */ -@protocol RNSchedulerDelegate +@protocol RCTSchedulerDelegate - (void)schedulerDidFinishTransaction:(facebook::react::MountingCoordinator::Shared const &)mountingCoordinator; @@ -37,9 +37,9 @@ NS_ASSUME_NONNULL_BEGIN /** * `facebook::react::Scheduler` as an Objective-C class. */ -@interface RNScheduler : NSObject +@interface RCTScheduler : NSObject -@property (atomic, weak, nullable) id delegate; +@property (atomic, weak, nullable) id delegate; - (instancetype)initWithToolbox:(facebook::react::SchedulerToolbox)toolbox; diff --git a/React/Fabric/RNScheduler.mm b/React/Fabric/RCTScheduler.mm similarity index 87% rename from React/Fabric/RNScheduler.mm rename to React/Fabric/RCTScheduler.mm index 7ef7fda25de..2bd27b7663b 100644 --- a/React/Fabric/RNScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNScheduler.h" +#import "RCTScheduler.h" #import #import @@ -14,7 +14,7 @@ #import -#import "RNConversions.h" +#import "RCTConversions.h" using namespace facebook::react; @@ -24,7 +24,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { void schedulerDidFinishTransaction(MountingCoordinator::Shared const &mountingCoordinator) override { - RNScheduler *scheduler = (__bridge RNScheduler *)scheduler_; + RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_; [scheduler.delegate schedulerDidFinishTransaction:mountingCoordinator]; } @@ -39,7 +39,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { const std::string &commandName, const folly::dynamic args) override { - RNScheduler *scheduler = (__bridge RNScheduler *)scheduler_; + RCTScheduler *scheduler = (__bridge RCTScheduler *)scheduler_; [scheduler.delegate schedulerDidDispatchCommand:shadowView commandName:commandName args:args]; } @@ -61,7 +61,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { void *scheduler_; }; -@implementation RNScheduler { +@implementation RCTScheduler { std::shared_ptr _scheduler; std::shared_ptr _delegateProxy; } @@ -87,7 +87,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { layoutConstraints:(LayoutConstraints)layoutConstraints layoutContext:(LayoutContext)layoutContext; { - SystraceSection s("-[RNScheduler startSurfaceWithSurfaceId:...]"); + SystraceSection s("-[RCTScheduler startSurfaceWithSurfaceId:...]"); auto props = convertIdToFollyDynamic(initialProps); _scheduler->startSurface(surfaceId, RCTStringFromNSString(moduleName), props, layoutConstraints, layoutContext); @@ -97,7 +97,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { - (void)stopSurfaceWithSurfaceId:(SurfaceId)surfaceId { - SystraceSection s("-[RNScheduler stopSurfaceWithSurfaceId:]"); + SystraceSection s("-[RCTScheduler stopSurfaceWithSurfaceId:]"); _scheduler->stopSurface(surfaceId); } @@ -105,7 +105,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { layoutContext:(LayoutContext)layoutContext surfaceId:(SurfaceId)surfaceId { - SystraceSection s("-[RNScheduler measureSurfaceWithLayoutConstraints:]"); + SystraceSection s("-[RCTScheduler measureSurfaceWithLayoutConstraints:]"); return RCTCGSizeFromSize(_scheduler->measureSurface(surfaceId, layoutConstraints, layoutContext)); } @@ -113,7 +113,7 @@ class SchedulerDelegateProxy : public SchedulerDelegate { layoutContext:(LayoutContext)layoutContext surfaceId:(SurfaceId)surfaceId { - SystraceSection s("-[RNScheduler constraintSurfaceLayoutWithLayoutConstraints:]"); + SystraceSection s("-[RCTScheduler constraintSurfaceLayoutWithLayoutConstraints:]"); _scheduler->constraintSurfaceLayout(surfaceId, layoutConstraints, layoutContext); } diff --git a/React/Fabric/RNSurfacePresenter.h b/React/Fabric/RCTSurfacePresenter.h similarity index 62% rename from React/Fabric/RNSurfacePresenter.h rename to React/Fabric/RCTSurfacePresenter.h index d47c6dd7471..0d7d33a62d7 100644 --- a/React/Fabric/RNSurfacePresenter.h +++ b/React/Fabric/RCTSurfacePresenter.h @@ -9,16 +9,16 @@ #import #import -#import -#import -#import +#import +#import +#import #import #import NS_ASSUME_NONNULL_BEGIN -@class RNFabricSurface; -@class RNMountingManager; +@class RCTFabricSurface; +@class RCTMountingManager; /** * Coordinates presenting of React Native Surfaces and represents application @@ -26,49 +26,49 @@ NS_ASSUME_NONNULL_BEGIN * SurfacePresenter incapsulates a bridge object inside and discourage direct * access to it. */ -@interface RNSurfacePresenter : NSObject +@interface RCTSurfacePresenter : NSObject - (instancetype)initWithBridge:(RCTBridge *)bridge config:(std::shared_ptr)config; -@property (nonatomic, readonly) RNComponentViewFactory *componentViewFactory; +@property (nonatomic, readonly) RCTComponentViewFactory *componentViewFactory; @property (nonatomic, readonly) facebook::react::ContextContainer::Shared contextContainer; @end -@interface RNSurfacePresenter (Surface) +@interface RCTSurfacePresenter (Surface) /** * Surface uses these methods to register itself in the Presenter. */ -- (void)registerSurface:(RNFabricSurface *)surface; +- (void)registerSurface:(RCTFabricSurface *)surface; /** * Starting initiates running, rendering and mounting processes. * Should be called after registerSurface and any other surface-specific setup is done */ -- (void)startSurface:(RNFabricSurface *)surface; -- (void)unregisterSurface:(RNFabricSurface *)surface; -- (void)setProps:(NSDictionary *)props surface:(RNFabricSurface *)surface; +- (void)startSurface:(RCTFabricSurface *)surface; +- (void)unregisterSurface:(RCTFabricSurface *)surface; +- (void)setProps:(NSDictionary *)props surface:(RCTFabricSurface *)surface; -- (nullable RNFabricSurface *)surfaceForRootTag:(ReactTag)rootTag; +- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag; /** * Measures the Surface with given constraints. */ - (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize - surface:(RNFabricSurface *)surface; + surface:(RCTFabricSurface *)surface; /** * Sets `minimumSize` and `maximumSize` layout constraints for the Surface. */ -- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize surface:(RNFabricSurface *)surface; +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize surface:(RCTFabricSurface *)surface; - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; -- (void)addObserver:(id)observer; +- (void)addObserver:(id)observer; -- (void)removeObserver:(id)observer; +- (void)removeObserver:(id)observer; @end diff --git a/React/Fabric/RNSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm similarity index 79% rename from React/Fabric/RNSurfacePresenter.mm rename to React/Fabric/RCTSurfacePresenter.mm index fd12833ce9b..820c38df09a 100644 --- a/React/Fabric/RNSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSurfacePresenter.h" +#import "RCTSurfacePresenter.h" #import #import @@ -14,18 +14,18 @@ #import #import +#import +#import +#import #import #import +#import +#import +#import +#import #import #import #import -#import -#import -#import -#import -#import -#import -#import #import #import @@ -37,7 +37,7 @@ #import #import "MainRunLoopEventBeat.h" -#import "RNConversions.h" +#import "RCTConversions.h" #import "RuntimeEventBeat.h" using namespace facebook::react; @@ -47,21 +47,21 @@ using namespace facebook::react; - (void)invokeAsync:(std::function &&)func; @end -@interface RNSurfacePresenter () +@interface RCTSurfacePresenter () @end -@implementation RNSurfacePresenter { +@implementation RCTSurfacePresenter { std::mutex _schedulerMutex; std::mutex _contextContainerMutex; - RNScheduler + RCTScheduler *_Nullable _scheduler; // Thread-safe. Mutation of the instance variable is protected by `_schedulerMutex`. - RNMountingManager *_mountingManager; // Thread-safe. - RNSurfaceRegistry *_surfaceRegistry; // Thread-safe. + RCTMountingManager *_mountingManager; // Thread-safe. + RCTSurfaceRegistry *_surfaceRegistry; // Thread-safe. RCTBridge *_bridge; // Unsafe. We are moving away from Bridge. RCTBridge *_batchedBridge; std::shared_ptr _reactNativeConfig; better::shared_mutex _observerListMutex; - NSMutableArray> *_observers; + NSMutableArray> *_observers; } - (instancetype)initWithBridge:(RCTBridge *)bridge config:(std::shared_ptr)config @@ -71,9 +71,9 @@ using namespace facebook::react; _batchedBridge = [_bridge batchedBridge] ?: _bridge; [_batchedBridge setSurfacePresenter:self]; - _surfaceRegistry = [[RNSurfaceRegistry alloc] init]; + _surfaceRegistry = [[RCTSurfaceRegistry alloc] init]; - _mountingManager = [[RNMountingManager alloc] init]; + _mountingManager = [[RCTMountingManager alloc] init]; _mountingManager.delegate = self; if (config != nullptr) { @@ -102,42 +102,44 @@ using namespace facebook::react; [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (RNComponentViewFactory *)componentViewFactory +- (RCTComponentViewFactory *)componentViewFactory { return _mountingManager.componentViewRegistry.componentViewFactory; } #pragma mark - Internal Surface-dedicated Interface -- (void)registerSurface:(RNFabricSurface *)surface +- (void)registerSurface:(RCTFabricSurface *)surface { [_surfaceRegistry registerSurface:surface]; } -- (void)startSurface:(RNFabricSurface *)surface +- (void)startSurface:(RCTFabricSurface *)surface { [self _startSurface:surface]; } -- (void)unregisterSurface:(RNFabricSurface *)surface +- (void)unregisterSurface:(RCTFabricSurface *)surface { [self _stopSurface:surface]; [_surfaceRegistry unregisterSurface:surface]; } -- (void)setProps:(NSDictionary *)props surface:(RNFabricSurface *)surface +- (void)setProps:(NSDictionary *)props surface:(RCTFabricSurface *)surface { // This implementation is suboptimal indeed but still better than nothing for now. [self _stopSurface:surface]; [self _startSurface:surface]; } -- (RNFabricSurface *)surfaceForRootTag:(ReactTag)rootTag +- (RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag { return [_surfaceRegistry surfaceForRootTag:rootTag]; } -- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize surface:(RNFabricSurface *)surface +- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize + maximumSize:(CGSize)maximumSize + surface:(RCTFabricSurface *)surface { LayoutContext layoutContext = {.pointScaleFactor = RCTScreenScale()}; @@ -149,7 +151,7 @@ using namespace facebook::react; surfaceId:surface.rootTag]; } -- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize surface:(RNFabricSurface *)surface +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize surface:(RCTFabricSurface *)surface { LayoutContext layoutContext = {.pointScaleFactor = RCTScreenScale()}; @@ -164,7 +166,7 @@ using namespace facebook::react; - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props { ReactTag tag = [reactTag integerValue]; - UIView *componentView = [_mountingManager.componentViewRegistry componentViewByTag:tag]; + UIView *componentView = [_mountingManager.componentViewRegistry componentViewByTag:tag]; if (componentView == nil) { return NO; // This view probably isn't managed by Fabric } @@ -178,7 +180,7 @@ using namespace facebook::react; #pragma mark - Private -- (RNScheduler *)_scheduler +- (RCTScheduler *)_scheduler { std::lock_guard lock(_schedulerMutex); @@ -189,7 +191,7 @@ using namespace facebook::react; auto componentRegistryFactory = [factory = wrapManagedObject(self.componentViewFactory)]( EventDispatcher::Shared const &eventDispatcher, ContextContainer::Shared const &contextContainer) { - return [(RNComponentViewFactory *)unwrapManagedObject(factory) + return [(RCTComponentViewFactory *)unwrapManagedObject(factory) createComponentDescriptorRegistryWithParameters:{eventDispatcher, contextContainer}]; }; @@ -208,7 +210,7 @@ using namespace facebook::react; return std::make_unique(runtimeExecutor); }; - _scheduler = [[RNScheduler alloc] initWithToolbox:toolbox]; + _scheduler = [[RCTScheduler alloc] initWithToolbox:toolbox]; _scheduler.delegate = self; return _scheduler; @@ -247,7 +249,7 @@ using namespace facebook::react; _contextContainer = std::make_shared(); // Please do not add stuff here; `SurfacePresenter` must not alter `ContextContainer`. // Those two pieces eventually should be moved out there: - // * `RCTImageLoader` should be moved to `RNImageComponentView`. + // * `RCTImageLoader` should be moved to `RCTImageComponentView`. // * `ReactNativeConfig` should be set by outside product code. _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); _contextContainer->insert("RCTImageLoader", wrapManagedObject([_bridge moduleForClass:[RCTImageLoader class]])); @@ -255,9 +257,9 @@ using namespace facebook::react; return _contextContainer; } -- (void)_startSurface:(RNFabricSurface *)surface +- (void)_startSurface:(RCTFabricSurface *)surface { - RNMountingManager *mountingManager = _mountingManager; + RCTMountingManager *mountingManager = _mountingManager; RCTExecuteOnMainQueue(^{ [mountingManager.componentViewRegistry dequeueComponentViewWithComponentHandle:RootShadowNode::Handle() tag:surface.rootTag]; @@ -275,13 +277,13 @@ using namespace facebook::react; layoutContext:layoutContext]; } -- (void)_stopSurface:(RNFabricSurface *)surface +- (void)_stopSurface:(RCTFabricSurface *)surface { [self._scheduler stopSurfaceWithSurfaceId:surface.rootTag]; - RNMountingManager *mountingManager = _mountingManager; + RCTMountingManager *mountingManager = _mountingManager; RCTExecuteOnMainQueue(^{ - UIView *rootView = + UIView *rootView = [mountingManager.componentViewRegistry componentViewByTag:surface.rootTag]; [mountingManager.componentViewRegistry enqueueComponentViewWithComponentHandle:RootShadowNode::Handle() tag:surface.rootTag @@ -293,8 +295,8 @@ using namespace facebook::react; - (void)_startAllSurfaces { - [_surfaceRegistry enumerateWithBlock:^(NSEnumerator *enumerator) { - for (RNFabricSurface *surface in enumerator) { + [_surfaceRegistry enumerateWithBlock:^(NSEnumerator *enumerator) { + for (RCTFabricSurface *surface in enumerator) { [self _startSurface:surface]; } }]; @@ -302,18 +304,18 @@ using namespace facebook::react; - (void)_stopAllSurfaces { - [_surfaceRegistry enumerateWithBlock:^(NSEnumerator *enumerator) { - for (RNFabricSurface *surface in enumerator) { + [_surfaceRegistry enumerateWithBlock:^(NSEnumerator *enumerator) { + for (RCTFabricSurface *surface in enumerator) { [self _stopSurface:surface]; } }]; } -#pragma mark - RNSchedulerDelegate +#pragma mark - RCTSchedulerDelegate - (void)schedulerDidFinishTransaction:(facebook::react::MountingCoordinator::Shared const &)mountingCoordinator { - RNFabricSurface *surface = [_surfaceRegistry surfaceForRootTag:mountingCoordinator->getSurfaceId()]; + RCTFabricSurface *surface = [_surfaceRegistry surfaceForRootTag:mountingCoordinator->getSurfaceId()]; [surface _setStage:RCTSurfaceStagePrepared]; @@ -331,37 +333,37 @@ using namespace facebook::react; [self->_mountingManager dispatchCommand:tag commandName:commandStr args:argsArray]; } -- (void)addObserver:(id)observer +- (void)addObserver:(id)observer { std::unique_lock lock(_observerListMutex); [self->_observers addObject:observer]; } -- (void)removeObserver:(id)observer +- (void)removeObserver:(id)observer { std::unique_lock lock(_observerListMutex); [self->_observers removeObject:observer]; } -#pragma mark - RNMountingManagerDelegate +#pragma mark - RCTMountingManagerDelegate -- (void)mountingManager:(RNMountingManager *)mountingManager willMountComponentsWithRootTag:(ReactTag)rootTag +- (void)mountingManager:(RCTMountingManager *)mountingManager willMountComponentsWithRootTag:(ReactTag)rootTag { RCTAssertMainQueue(); std::shared_lock lock(_observerListMutex); - for (id observer in _observers) { + for (id observer in _observers) { if ([observer respondsToSelector:@selector(willMountComponentsWithRootTag:)]) { [observer willMountComponentsWithRootTag:rootTag]; } } } -- (void)mountingManager:(RNMountingManager *)mountingManager didMountComponentsWithRootTag:(ReactTag)rootTag +- (void)mountingManager:(RCTMountingManager *)mountingManager didMountComponentsWithRootTag:(ReactTag)rootTag { RCTAssertMainQueue(); - RNFabricSurface *surface = [_surfaceRegistry surfaceForRootTag:rootTag]; + RCTFabricSurface *surface = [_surfaceRegistry surfaceForRootTag:rootTag]; RCTSurfaceStage stage = surface.stage; if (stage & RCTSurfaceStagePrepared) { // We have to progress the stage only if the preparing phase is done. @@ -372,7 +374,7 @@ using namespace facebook::react; } std::shared_lock lock(_observerListMutex); - for (id observer in _observers) { + for (id observer in _observers) { if ([observer respondsToSelector:@selector(didMountComponentsWithRootTag:)]) { [observer didMountComponentsWithRootTag:rootTag]; } diff --git a/React/Fabric/RNSurfaceRegistry.h b/React/Fabric/RCTSurfaceRegistry.h similarity index 69% rename from React/Fabric/RNSurfaceRegistry.h rename to React/Fabric/RCTSurfaceRegistry.h index 4e5f8871b0e..2e89e5e7103 100644 --- a/React/Fabric/RNSurfaceRegistry.h +++ b/React/Fabric/RCTSurfaceRegistry.h @@ -7,13 +7,13 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN -@class RNFabricSurface; +@class RCTFabricSurface; -typedef void (^RCTSurfaceEnumeratorBlock)(NSEnumerator *enumerator); +typedef void (^RCTSurfaceEnumeratorBlock)(NSEnumerator *enumerator); /** * Registry of Surfaces. @@ -21,7 +21,7 @@ typedef void (^RCTSurfaceEnumeratorBlock)(NSEnumerator *enume * All methods of the registry are thread-safe. * The registry stores Surface objects as weak references. */ -@interface RNSurfaceRegistry : NSObject +@interface RCTSurfaceRegistry : NSObject - (void)enumerateWithBlock:(RCTSurfaceEnumeratorBlock)block; @@ -29,18 +29,18 @@ typedef void (^RCTSurfaceEnumeratorBlock)(NSEnumerator *enume * Adds Surface object into the registry. * The registry does not retain Surface references. */ -- (void)registerSurface:(RNFabricSurface *)surface; +- (void)registerSurface:(RCTFabricSurface *)surface; /** * Removes Surface object from the registry. */ -- (void)unregisterSurface:(RNFabricSurface *)surface; +- (void)unregisterSurface:(RCTFabricSurface *)surface; /** * Returns stored Surface object by given root tag. * If the registry does not have such Surface registered, returns `nil`. */ -- (nullable RNFabricSurface *)surfaceForRootTag:(ReactTag)rootTag; +- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag; @end diff --git a/React/Fabric/RNSurfaceRegistry.mm b/React/Fabric/RCTSurfaceRegistry.mm similarity index 80% rename from React/Fabric/RNSurfaceRegistry.mm rename to React/Fabric/RCTSurfaceRegistry.mm index a58b7c342b3..0eae535f40b 100644 --- a/React/Fabric/RNSurfaceRegistry.mm +++ b/React/Fabric/RCTSurfaceRegistry.mm @@ -5,19 +5,19 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSurfaceRegistry.h" +#import "RCTSurfaceRegistry.h" #import #import #import -#import +#import using namespace facebook; -@implementation RNSurfaceRegistry { +@implementation RCTSurfaceRegistry { better::shared_mutex _mutex; - NSMapTable *_registry; + NSMapTable *_registry; } - (instancetype)init @@ -36,7 +36,7 @@ using namespace facebook; block([_registry objectEnumerator]); } -- (void)registerSurface:(RNFabricSurface *)surface +- (void)registerSurface:(RCTFabricSurface *)surface { std::unique_lock lock(_mutex); @@ -44,7 +44,7 @@ using namespace facebook; [_registry setObject:surface forKey:(__bridge id)(void *)rootTag]; } -- (void)unregisterSurface:(RNFabricSurface *)surface +- (void)unregisterSurface:(RCTFabricSurface *)surface { std::unique_lock lock(_mutex); @@ -52,7 +52,7 @@ using namespace facebook; [_registry removeObjectForKey:(__bridge id)(void *)rootTag]; } -- (RNFabricSurface *)surfaceForRootTag:(ReactTag)rootTag +- (RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag { std::shared_lock lock(_mutex); diff --git a/React/Fabric/RNSurfaceTouchHandler.h b/React/Fabric/RCTSurfaceTouchHandler.h similarity index 86% rename from React/Fabric/RNSurfaceTouchHandler.h rename to React/Fabric/RCTSurfaceTouchHandler.h index 195e697d7aa..3c0b68be0d8 100644 --- a/React/Fabric/RNSurfaceTouchHandler.h +++ b/React/Fabric/RCTSurfaceTouchHandler.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface RNSurfaceTouchHandler : UIGestureRecognizer +@interface RCTSurfaceTouchHandler : UIGestureRecognizer - (void)attachToView:(UIView *)view; - (void)detachFromView:(UIView *)view; diff --git a/React/Fabric/RNSurfaceTouchHandler.mm b/React/Fabric/RCTSurfaceTouchHandler.mm similarity index 96% rename from React/Fabric/RNSurfaceTouchHandler.mm rename to React/Fabric/RCTSurfaceTouchHandler.mm index a9b862b186a..345b80fecc6 100644 --- a/React/Fabric/RNSurfaceTouchHandler.mm +++ b/React/Fabric/RCTSurfaceTouchHandler.mm @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSurfaceTouchHandler.h" +#import "RCTSurfaceTouchHandler.h" #import -#import +#import #import -#import "RNConversions.h" -#import "RNTouchableComponentViewProtocol.h" +#import "RCTConversions.h" +#import "RCTTouchableComponentViewProtocol.h" using namespace facebook::react; @@ -92,7 +92,7 @@ static ActiveTouch CreateTouchWithUITouch(UITouch *uiTouch, UIView *rootComponen ActiveTouch activeTouch = {}; if ([componentView respondsToSelector:@selector(touchEventEmitterAtPoint:)]) { - activeTouch.eventEmitter = [(id)componentView + activeTouch.eventEmitter = [(id)componentView touchEventEmitterAtPoint:[uiTouch locationInView:componentView]]; activeTouch.touch.target = (Tag)componentView.tag; } @@ -135,10 +135,10 @@ struct PointerHasher { } }; -@interface RNSurfaceTouchHandler () +@interface RCTSurfaceTouchHandler () @end -@implementation RNSurfaceTouchHandler { +@implementation RCTSurfaceTouchHandler { std::unordered_map< __unsafe_unretained UITouch *, ActiveTouch, diff --git a/React/Fabric/RNTouchableComponentViewProtocol.h b/React/Fabric/RCTTouchableComponentViewProtocol.h similarity index 86% rename from React/Fabric/RNTouchableComponentViewProtocol.h rename to React/Fabric/RCTTouchableComponentViewProtocol.h index b174dbba3dd..3b30283b255 100644 --- a/React/Fabric/RNTouchableComponentViewProtocol.h +++ b/React/Fabric/RCTTouchableComponentViewProtocol.h @@ -8,6 +8,6 @@ #import #import -@protocol RNTouchableComponentViewProtocol +@protocol RCTTouchableComponentViewProtocol - (facebook::react::SharedTouchEventEmitter)touchEventEmitterAtPoint:(CGPoint)point; @end diff --git a/React/Fabric/Surface/RNFabricSurface.h b/React/Fabric/Surface/RCTFabricSurface.h similarity index 94% rename from React/Fabric/Surface/RNFabricSurface.h rename to React/Fabric/Surface/RCTFabricSurface.h index e6651cb5667..cbc2cf25936 100644 --- a/React/Fabric/Surface/RNFabricSurface.h +++ b/React/Fabric/Surface/RCTFabricSurface.h @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +#import #import -#import NS_ASSUME_NONNULL_BEGIN @class RCTBridge; @class RCTSurfaceView; -@class RNSurfacePresenter; +@class RCTSurfacePresenter; @protocol RCTSurfaceDelegate; /** @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN * * ability to create a UIView instance on demand (later); * * ability to communicate the current stage of the surface granularly. */ -@interface RNFabricSurface : NSObject +@interface RCTFabricSurface : NSObject @property (atomic, readonly) RCTSurfaceStage stage; @property (atomic, readonly) NSString *moduleName; @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @property (atomic, copy, readwrite) NSDictionary *properties; -- (instancetype)initWithSurfacePresenter:(RNSurfacePresenter *)surfacePresenter +- (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties; @@ -128,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface RNFabricSurface (Internal) +@interface RCTFabricSurface (Internal) /** * Sets and clears given stage flags (bitmask). @@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface RNFabricSurface (Deprecated) +@interface RCTFabricSurface (Deprecated) /** * Deprecated. Use `initWithSurfacePresenter:moduleName:initialProperties` instead. diff --git a/React/Fabric/Surface/RNFabricSurface.mm b/React/Fabric/Surface/RCTFabricSurface.mm similarity index 94% rename from React/Fabric/Surface/RNFabricSurface.mm rename to React/Fabric/Surface/RCTFabricSurface.mm index f336108838e..77ae024a4c1 100644 --- a/React/Fabric/Surface/RNFabricSurface.mm +++ b/React/Fabric/Surface/RCTFabricSurface.mm @@ -5,24 +5,24 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNFabricSurface.h" +#import "RCTFabricSurface.h" #import #import #import #import +#import #import #import #import #import -#import -#import "RNSurfacePresenter.h" +#import "RCTSurfacePresenter.h" -@implementation RNFabricSurface { +@implementation RCTFabricSurface { // Immutable - RNSurfacePresenter *_surfacePresenter; + RCTSurfacePresenter *_surfacePresenter; NSString *_moduleName; // Protected by the `_mutex` @@ -35,10 +35,10 @@ // The Main thread only RCTSurfaceView *_Nullable _view; - RNSurfaceTouchHandler *_Nullable _touchHandler; + RCTSurfaceTouchHandler *_Nullable _touchHandler; } -- (instancetype)initWithSurfacePresenter:(RNSurfacePresenter *)surfacePresenter +- (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties { @@ -52,7 +52,7 @@ // FIXME: Replace with `_maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);`. _maximumSize = RCTScreenSize(); - _touchHandler = [RNSurfaceTouchHandler new]; + _touchHandler = [RCTSurfaceTouchHandler new]; _stage = RCTSurfaceStageSurfaceDidInitialize; diff --git a/React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.h b/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h similarity index 79% rename from React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.h rename to React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h index 0ba18b84a72..bd653909cea 100644 --- a/React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.h +++ b/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h @@ -10,6 +10,6 @@ /** * Fabric-compatible RCTSurfaceHostingProxyRootView implementation. */ -@interface RNFabricSurfaceHostingProxyRootView : RCTSurfaceHostingProxyRootView +@interface RCTFabricSurfaceHostingProxyRootView : RCTSurfaceHostingProxyRootView @end diff --git a/React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.mm b/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.mm similarity index 52% rename from React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.mm rename to React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.mm index f184c3d536c..ac76e023ba4 100644 --- a/React/Fabric/Surface/RNFabricSurfaceHostingProxyRootView.mm +++ b/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.mm @@ -5,19 +5,19 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNFabricSurfaceHostingProxyRootView.h" +#import "RCTFabricSurfaceHostingProxyRootView.h" -#import "RNFabricSurface.h" +#import "RCTFabricSurface.h" -@implementation RNFabricSurfaceHostingProxyRootView +@implementation RCTFabricSurfaceHostingProxyRootView + (RCTSurface *)createSurfaceWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties { - return (RCTSurface *)[[RNFabricSurface alloc] initWithBridge:bridge - moduleName:moduleName - initialProperties:initialProperties]; + return (RCTSurface *)[[RCTFabricSurface alloc] initWithBridge:bridge + moduleName:moduleName + initialProperties:initialProperties]; } @end diff --git a/React/Fabric/Surface/RNFabricSurfaceHostingView.h b/React/Fabric/Surface/RCTFabricSurfaceHostingView.h similarity index 82% rename from React/Fabric/Surface/RNFabricSurfaceHostingView.h rename to React/Fabric/Surface/RCTFabricSurfaceHostingView.h index 244a3d79d92..76de83ea5ea 100644 --- a/React/Fabric/Surface/RNFabricSurfaceHostingView.h +++ b/React/Fabric/Surface/RCTFabricSurfaceHostingView.h @@ -10,6 +10,6 @@ /** * Fabric-compatible RCTSurfaceHostingView implementation. */ -@interface RNFabricSurfaceHostingView : RCTSurfaceHostingView +@interface RCTFabricSurfaceHostingView : RCTSurfaceHostingView @end diff --git a/React/Fabric/Surface/RNFabricSurfaceHostingView.mm b/React/Fabric/Surface/RCTFabricSurfaceHostingView.mm similarity index 66% rename from React/Fabric/Surface/RNFabricSurfaceHostingView.mm rename to React/Fabric/Surface/RCTFabricSurfaceHostingView.mm index 929136bbaab..ebc21df8c1a 100644 --- a/React/Fabric/Surface/RNFabricSurfaceHostingView.mm +++ b/React/Fabric/Surface/RCTFabricSurfaceHostingView.mm @@ -5,21 +5,21 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNFabricSurfaceHostingView.h" +#import "RCTFabricSurfaceHostingView.h" #import -#import "RNFabricSurface.h" +#import "RCTFabricSurface.h" -@implementation RNFabricSurfaceHostingView +@implementation RCTFabricSurfaceHostingView - (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode { - RCTSurface *surface = (RCTSurface *)[[RNFabricSurface alloc] initWithBridge:bridge - moduleName:moduleName - initialProperties:initialProperties]; + RCTSurface *surface = (RCTSurface *)[[RCTFabricSurface alloc] initWithBridge:bridge + moduleName:moduleName + initialProperties:initialProperties]; [surface start]; return [self initWithSurface:surface sizeMeasureMode:sizeMeasureMode]; } diff --git a/React/Fabric/Utils/RNGenericDelegateSplitter.h b/React/Fabric/Utils/RCTGenericDelegateSplitter.h similarity index 96% rename from React/Fabric/Utils/RNGenericDelegateSplitter.h rename to React/Fabric/Utils/RCTGenericDelegateSplitter.h index 53874575e47..5346ed7cfa2 100644 --- a/React/Fabric/Utils/RNGenericDelegateSplitter.h +++ b/React/Fabric/Utils/RCTGenericDelegateSplitter.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN * receiver is being subscribed directly. In the case where more than one receiving objects are registered, using * Splitter introduces some performance overhead. */ -@interface RNGenericDelegateSplitter : NSObject +@interface RCTGenericDelegateSplitter : NSObject @property (nonatomic, copy, nullable) void (^delegateUpdateBlock)(DelegateT _Nullable delegate); diff --git a/React/Fabric/Utils/RNGenericDelegateSplitter.mm b/React/Fabric/Utils/RCTGenericDelegateSplitter.mm similarity index 94% rename from React/Fabric/Utils/RNGenericDelegateSplitter.mm rename to React/Fabric/Utils/RCTGenericDelegateSplitter.mm index 44b604838b3..0282b0833c5 100644 --- a/React/Fabric/Utils/RNGenericDelegateSplitter.mm +++ b/React/Fabric/Utils/RCTGenericDelegateSplitter.mm @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNGenericDelegateSplitter.h" +#import "RCTGenericDelegateSplitter.h" -@implementation RNGenericDelegateSplitter { +@implementation RCTGenericDelegateSplitter { NSHashTable *_delegates; } diff --git a/React/Modules/RNSurfacePresenterStub.h b/React/Modules/RCTSurfacePresenterStub.h similarity index 63% rename from React/Modules/RNSurfacePresenterStub.h rename to React/Modules/RCTSurfacePresenterStub.h index b63c8ce8e61..d21d3ca8665 100644 --- a/React/Modules/RNSurfacePresenterStub.h +++ b/React/Modules/RCTSurfacePresenterStub.h @@ -11,12 +11,12 @@ NS_ASSUME_NONNULL_BEGIN -// TODO: Eventually this should go away and files should just include RNSurfacePresenter.h, but +// TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but // that pulls in all of fabric which doesn't compile in open source yet, so we mirror the protocol // and duplicate the category here for now. -@protocol RNSurfacePresenterObserver +@protocol RCTSurfacePresenterObserver @optional @@ -25,18 +25,18 @@ NS_ASSUME_NONNULL_BEGIN @end -@protocol RNSurfacePresenterStub +@protocol RCTSurfacePresenterStub - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; -- (void)addObserver:(id)observer; -- (void)removeObserver:(id)observer; +- (void)addObserver:(id)observer; +- (void)removeObserver:(id)observer; @end -@interface RCTBridge (RNSurfacePresenterStub) +@interface RCTBridge (RCTSurfacePresenterStub) -- (id)surfacePresenter; -- (void)setSurfacePresenter:(id)presenter; +- (id)surfacePresenter; +- (void)setSurfacePresenter:(id)presenter; @end diff --git a/React/Modules/RNSurfacePresenterStub.m b/React/Modules/RCTSurfacePresenterStub.m similarity index 64% rename from React/Modules/RNSurfacePresenterStub.m rename to React/Modules/RCTSurfacePresenterStub.m index 76bb4ec4fea..c369a15eed2 100644 --- a/React/Modules/RNSurfacePresenterStub.m +++ b/React/Modules/RCTSurfacePresenterStub.m @@ -5,16 +5,16 @@ * LICENSE file in the root directory of this source tree. */ -#import "RNSurfacePresenterStub.h" +#import "RCTSurfacePresenterStub.h" -@implementation RCTBridge (RNSurfacePresenterStub) +@implementation RCTBridge (RCTSurfacePresenterStub) -- (id)surfacePresenter +- (id)surfacePresenter { return objc_getAssociatedObject(self, @selector(surfacePresenter)); } -- (void)setSurfacePresenter:(id)surfacePresenter +- (void)setSurfacePresenter:(id)surfacePresenter { objc_setAssociatedObject(self, @selector(surfacePresenter), surfacePresenter, OBJC_ASSOCIATION_ASSIGN); } diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h index 95e24b7d51e..05e0af4b6e4 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h @@ -88,7 +88,7 @@ private: @end -// TODO: Consolidate this extension with the one in RNSurfacePresenter. +// TODO: Consolidate this extension with the one in RCTSurfacePresenter. @interface RCTBridge () - (std::weak_ptr)reactInstance;