Skip to content

Commit 9420de6

Browse files
fkgozalifacebook-github-bot
authored andcommitted
iOS: codemod react-native-github: RCT->RN prefix for Fabric
Summary: Fabric ObjC(++) files will be prefixed by RN* for the time being, this codemod is a simple rename. This includes `interface` and `protocol` definition Reviewed By: PeteTheHeat, yungsters Differential Revision: D16611524 fbshipit-source-id: 868d2571ea2414dde4cbb3b75b1334b779b5d832
1 parent e3ec8db commit 9420de6

File tree

63 files changed

+430
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+430
-431
lines changed

Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#import <React/RCTPropsAnimatedNode.h>
99

1010
#import <React/RCTLog.h>
11-
#import <React/RCTSurfacePresenterStub.h>
11+
#import <React/RNSurfacePresenterStub.h>
1212
#import <React/RCTUIManager.h>
1313

1414
#import <React/RCTAnimationUtils.h>

Libraries/NativeAnimation/RCTNativeAnimatedModule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#import <React/RCTBridgeModule.h>
99
#import <React/RCTEventDispatcher.h>
1010
#import <React/RCTEventEmitter.h>
11-
#import <React/RCTSurfacePresenterStub.h>
11+
#import <React/RNSurfacePresenterStub.h>
1212
#import <React/RCTUIManager.h>
1313
#import <React/RCTUIManagerObserverCoordinator.h>
1414
#import <React/RCTUIManagerUtils.h>
1515

1616
#import "RCTValueAnimatedNode.h"
1717

18-
@interface RCTNativeAnimatedModule : RCTEventEmitter <RCTBridgeModule, RCTValueAnimatedNodeObserver, RCTEventDispatcherObserver, RCTUIManagerObserver, RCTSurfacePresenterObserver>
18+
@interface RCTNativeAnimatedModule : RCTEventEmitter <RCTBridgeModule, RCTValueAnimatedNodeObserver, RCTEventDispatcherObserver, RCTUIManagerObserver, RNSurfacePresenterObserver>
1919

2020
@end

Libraries/NativeAnimation/RCTNativeAnimatedModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ - (void)flushOperationQueues
231231
});
232232
}
233233

234-
#pragma mark - RCTSurfacePresenterObserver
234+
#pragma mark - RNSurfacePresenterObserver
235235

236236
- (void)willMountComponentsWithRootTag:(NSInteger)rootTag
237237
{

RNTester/RNTester/AppDelegate.mm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#endif
2424

2525
#ifdef RN_FABRIC_ENABLED
26-
#import <React/RCTSurfacePresenter.h>
27-
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
26+
#import <React/RNSurfacePresenter.h>
27+
#import <React/RNFabricSurfaceHostingProxyRootView.h>
2828
#endif
2929

3030
#import <ReactCommon/RCTTurboModuleManager.h>
@@ -34,7 +34,7 @@
3434
@interface AppDelegate() <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate>{
3535

3636
#ifdef RN_FABRIC_ENABLED
37-
RCTSurfacePresenter *_surfacePresenter;
37+
RNSurfacePresenter *_surfacePresenter;
3838
#endif
3939

4040
RCTTurboModuleManager *_turboModuleManager;
@@ -58,10 +58,10 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith
5858
}
5959

6060
#ifdef RN_FABRIC_ENABLED
61-
_surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge config:nil];
61+
_surfacePresenter = [[RNSurfacePresenter alloc] initWithBridge:_bridge config:nil];
6262
_bridge.surfacePresenter = _surfacePresenter;
6363

64-
UIView *rootView = [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps];
64+
UIView *rootView = [[RNFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps];
6565
#else
6666
UIView *rootView = [[RCTRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps];
6767
#endif

React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h renamed to React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
#import <UIKit/UIKit.h>
99

10-
#import <React/RCTViewComponentView.h>
10+
#import <React/RNViewComponentView.h>
1111

1212
NS_ASSUME_NONNULL_BEGIN
1313

1414
/**
1515
* UIView class for root <ActivityIndicator> component.
1616
*/
17-
@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView
17+
@interface RNActivityIndicatorViewComponentView : RNViewComponentView
1818

1919
@end
2020

React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm renamed to React/Fabric/Mounting/ComponentViews/ActivityIndicator/RNActivityIndicatorViewComponentView.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import "RCTActivityIndicatorViewComponentView.h"
8+
#import "RNActivityIndicatorViewComponentView.h"
99

1010
#import <react/components/rncore/ComponentDescriptors.h>
1111
#import <react/components/rncore/EventEmitters.h>
@@ -23,11 +23,11 @@ static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const Acti
2323
}
2424
}
2525

26-
@implementation RCTActivityIndicatorViewComponentView {
26+
@implementation RNActivityIndicatorViewComponentView {
2727
UIActivityIndicatorView *_activityIndicatorView;
2828
}
2929

30-
#pragma mark - RCTComponentViewProtocol
30+
#pragma mark - RNComponentViewProtocol
3131

3232
+ (ComponentDescriptorProvider)componentDescriptorProvider
3333
{

React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h renamed to React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <React/RCTImageResponseDelegate.h>
9-
#import "RCTViewComponentView.h"
8+
#import <React/RNImageResponseDelegate.h>
9+
#import "RNViewComponentView.h"
1010

1111
NS_ASSUME_NONNULL_BEGIN
1212

1313
/**
1414
* UIView class for root <Image> component.
1515
*/
16-
@interface RCTImageComponentView : RCTViewComponentView <RCTImageResponseDelegate>
16+
@interface RNImageComponentView : RNViewComponentView <RNImageResponseDelegate>
1717

1818
@end
1919

React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm renamed to React/Fabric/Mounting/ComponentViews/Image/RNImageComponentView.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import "RCTImageComponentView.h"
8+
#import "RNImageComponentView.h"
99

10-
#import <React/RCTImageResponseObserverProxy.h>
10+
#import <React/RNImageResponseObserverProxy.h>
1111
#import <react/components/image/ImageComponentDescriptor.h>
1212
#import <react/components/image/ImageEventEmitter.h>
1313
#import <react/components/image/ImageLocalData.h>
1414
#import <react/components/image/ImageProps.h>
1515
#import <react/imagemanager/ImageRequest.h>
1616
#import <react/imagemanager/RCTImagePrimitivesConversions.h>
1717

18-
#import "RCTConversions.h"
18+
#import "RNConversions.h"
1919

20-
@implementation RCTImageComponentView {
20+
@implementation RNImageComponentView {
2121
UIImageView *_imageView;
2222
SharedImageLocalData _imageLocalData;
2323
const ImageResponseObserverCoordinator *_coordinator;
24-
std::unique_ptr<RCTImageResponseObserverProxy> _imageResponseObserverProxy;
24+
std::unique_ptr<RNImageResponseObserverProxy> _imageResponseObserverProxy;
2525
}
2626

2727
- (instancetype)initWithFrame:(CGRect)frame
@@ -35,15 +35,15 @@ - (instancetype)initWithFrame:(CGRect)frame
3535

3636
_imageView.contentMode = (UIViewContentMode)RCTResizeModeFromImageResizeMode(defaultProps->resizeMode);
3737

38-
_imageResponseObserverProxy = std::make_unique<RCTImageResponseObserverProxy>((__bridge void *)self);
38+
_imageResponseObserverProxy = std::make_unique<RNImageResponseObserverProxy>((__bridge void *)self);
3939

4040
self.contentView = _imageView;
4141
}
4242

4343
return self;
4444
}
4545

46-
#pragma mark - RCTComponentViewProtocol
46+
#pragma mark - RNComponentViewProtocol
4747

4848
+ (ComponentDescriptorProvider)componentDescriptorProvider
4949
{
@@ -125,7 +125,7 @@ - (void)dealloc
125125
_imageResponseObserverProxy.reset();
126126
}
127127

128-
#pragma mark - RCTImageResponseDelegate
128+
#pragma mark - RNImageResponseDelegate
129129

130130
- (void)didReceiveImage:(UIImage *)image fromObserver:(void *)observer
131131
{

React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <React/RCTViewComponentView.h>
8+
#import <React/RNViewComponentView.h>
99

1010
/**
1111
* UIView class for root <ModalHostView> component.
1212
*/
13-
@interface RNModalHostViewComponentView : RCTViewComponentView
13+
@interface RNModalHostViewComponentView : RNViewComponentView
1414

1515
@end

React/Fabric/Mounting/ComponentViews/Modal/RNModalHostViewComponentView.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#import <react/components/modal/ModalHostViewState.h>
1414
#import <react/components/rncore/EventEmitters.h>
1515
#import <react/components/rncore/Props.h>
16-
#import "RCTConversions.h"
16+
#import "RNConversions.h"
1717

1818
using namespace facebook::react;
1919

@@ -164,7 +164,7 @@ - (void)boundsDidChange:(CGRect)newBounds
164164
}
165165
}
166166

167-
#pragma mark - RCTComponentViewProtocol
167+
#pragma mark - RNComponentViewProtocol
168168

169169
+ (ComponentDescriptorProvider)componentDescriptorProvider
170170
{
@@ -194,12 +194,12 @@ - (void)updateState:(facebook::react::State::Shared const &)state
194194
_state = std::static_pointer_cast<const ModalHostViewShadowNode::ConcreteState>(state);
195195
}
196196

197-
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
197+
- (void)mountChildComponentView:(UIView<RNComponentViewProtocol> *)childComponentView index:(NSInteger)index
198198
{
199199
[_viewController.view insertSubview:childComponentView atIndex:index];
200200
}
201201

202-
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
202+
- (void)unmountChildComponentView:(UIView<RNComponentViewProtocol> *)childComponentView index:(NSInteger)index
203203
{
204204
[childComponentView removeFromSuperview];
205205
}

0 commit comments

Comments
 (0)