Skip to content

Commit fc5cc28

Browse files
rmazmeta-codesync[bot]
authored andcommitted
make ReactInternal compatible with Swift (facebook#55982)
Summary: Pull Request resolved: facebook#55982 This change enables modules for the ReactInternal target, and correctly specifies the exported_deps. There are a few associated fixes required to unblock this change, such as adding missing deps and fixing headers for module compatibility. Changelog: [iOS][Fixed] - Made ReactInteral compatible with Swift Reviewed By: cipolleschi Differential Revision: D95434258 fbshipit-source-id: badb97582aaeaa8c0a9fe44a33c8b19770c561ce
1 parent 57c073f commit fc5cc28

9 files changed

Lines changed: 33 additions & 13 deletions

File tree

packages/react-native/React/Base/RCTDefines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#endif
6868

6969
#ifndef RCT_ENABLE_INSPECTOR
70-
#if (RCT_DEV || RCT_REMOTE_PROFILE) && __has_include(<React/RCTInspectorDevServerHelper.h>)
70+
#if (RCT_DEV || RCT_REMOTE_PROFILE)
7171
#define RCT_ENABLE_INSPECTOR 1
7272
#else
7373
#define RCT_ENABLE_INSPECTOR 0

packages/react-native/React/Base/RCTRootView.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ extern
4747
* like any ordinary UIView. You can have multiple RCTRootViews on screen at
4848
* once, all controlled by the same JavaScript application.
4949
*/
50+
#pragma clang diagnostic push
51+
#pragma clang diagnostic warning "-Wdeprecated"
5052
__deprecated_msg("This API will be removed along with the legacy architecture.") @interface RCTRootView : UIView
5153

5254
/**
@@ -178,4 +180,6 @@ __deprecated_msg("This API will be removed along with the legacy architecture.")
178180

179181
@end
180182

183+
#pragma clang diagnostic pop
184+
181185
NS_ASSUME_NONNULL_END

packages/react-native/React/Base/RCTRootViewDelegate.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77

88
#import <Foundation/Foundation.h>
9-
10-
@class RCTRootView;
9+
#import <React/RCTRootView.h>
1110

1211
@protocol RCTRootViewDelegate <NSObject>
1312

@@ -25,6 +24,10 @@
2524
* The new intrinsic content size is available via the `intrinsicContentSize`
2625
* property of the root view. The view will not resize itself.
2726
*/
27+
28+
#pragma clang diagnostic push
29+
#pragma clang diagnostic ignored "-Wdeprecated"
2830
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView;
31+
#pragma clang diagnostic pop
2932

3033
@end

packages/react-native/React/Base/Surface/RCTSurface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ NS_ASSUME_NONNULL_BEGIN
3232
* * ability to create a UIView instance on demand (later);
3333
* * ability to communicate the current stage of the surface granularly.
3434
*/
35+
#pragma clang diagnostic push
36+
#pragma clang diagnostic warning "-Wdeprecated"
3537
__deprecated_msg("This API will be removed along with the legacy architecture.") @interface RCTSurface
3638
: NSObject<RCTSurfaceProtocol>
39+
#pragma clang diagnostic pop
3740

3841
- (instancetype)initWithBridge:(RCTBridge *)bridge
3942
moduleName:(NSString *)moduleName

packages/react-native/React/Base/Surface/RCTSurfaceDelegate.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
#import <UIKit/UIKit.h>
99

10+
#import <React/RCTSurface.h>
1011
#import <React/RCTSurfaceStage.h>
1112

1213
NS_ASSUME_NONNULL_BEGIN
1314

14-
@class RCTSurface;
15-
1615
@protocol RCTSurfaceDelegate <NSObject>
1716

1817
@optional
@@ -21,13 +20,18 @@ NS_ASSUME_NONNULL_BEGIN
2120
* Notifies a receiver that a surface transitioned to a new stage.
2221
* See `RCTSurfaceStage` for more details.
2322
*/
23+
#pragma clang diagnostic push
24+
#pragma clang diagnostic ignored "-Wdeprecated"
2425
- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage;
25-
26+
#pragma clang diagnostic pop
2627
/**
2728
* Notifies a receiver that root view got a new (intrinsic) size during the last
2829
* layout pass.
2930
*/
31+
#pragma clang diagnostic push
32+
#pragma clang diagnostic ignored "-Wdeprecated"
3033
- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize;
34+
#pragma clang diagnostic pop
3135

3236
@end
3337

packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
#import <React/RCTSurfaceSizeMeasureMode.h>
1313
#import <React/RCTSurfaceStage.h>
1414

15-
@class RCTBridge;
16-
@class RCTSurface;
17-
1815
typedef UIView *_Nullable (^RCTSurfaceHostingViewActivityIndicatorViewFactory)(void);
1916

2017
NS_ASSUME_NONNULL_BEGIN

packages/react-native/React/CoreModules/RCTDevMenuConfigurationDecorator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
@property (nonatomic, strong, readonly) RCTDevMenuConfiguration *__nullable devMenuConfiguration;
1717

18-
- (instancetype)initWithDevMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration;
19-
- (void)decorate:(id<RCTBridgeModule>)devMenuModule;
18+
- (instancetype _Nonnull)initWithDevMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration;
19+
- (void)decorate:(id<RCTBridgeModule> _Nonnull)devMenuModule;
2020

2121
#endif
2222

packages/react-native/React/Profiler/RCTProfile.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
* using it.
2020
*/
2121

22+
#pragma clang diagnostic push
23+
#pragma clang diagnostic ignored "-Wdeprecated"
24+
2225
RCT_EXTERN __deprecated_msg("This API will be removed along with the legacy architecture.") NSString *const
2326
RCTProfileDidStartProfiling;
2427
RCT_EXTERN __deprecated_msg("This API will be removed along with the legacy architecture.") NSString *const
@@ -261,3 +264,5 @@ RCT_EXTERN void RCTProfileHideControls(void)
261264
#define RCTProfileHideControls(...)
262265

263266
#endif
267+
268+
#pragma clang diagnostic pop

packages/react-native/React/Views/ScrollView/RCTScrollView.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717

1818
@protocol UIScrollViewDelegate;
1919

20+
#pragma clang diagnostic push
21+
#pragma clang diagnostic warning "-Wdeprecated"
2022
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
2123
@interface RCTScrollView : RCTView<UIScrollViewDelegate, RCTScrollableProtocol, RCTAutoInsetsProtocol>
24+
#pragma clang diagnostic pop
2225

2326
- (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher NS_DESIGNATED_INITIALIZER;
2427

@@ -69,9 +72,10 @@ __attribute__((deprecated("This API will be removed along with the legacy archit
6972
@end
7073

7174
@interface UIView (RCTScrollView)
72-
75+
#pragma clang diagnostic push
76+
#pragma clang diagnostic ignored "-Wdeprecated"
7377
- (void)reactUpdateResponderOffsetForScrollView:(RCTScrollView *)scrollView;
74-
78+
#pragma clang diagnostic pop
7579
@end
7680

7781
@interface RCTScrollView (Internal)

0 commit comments

Comments
 (0)