Skip to content

Commit 49bb2f3

Browse files
authored
[rn][ios][0.74][RC6] decouple RCTBridge+Private from jsinspector-modern (#43708)
1 parent dc851b6 commit 49bb2f3

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#import <React/RCTBridge.h>
9+
10+
#ifdef __cplusplus
11+
#import <jsinspector-modern/ReactCdp.h>
12+
#endif
13+
14+
@interface RCTBridge (Inspector)
15+
16+
/**
17+
* The HostTarget for this bridge, if one has been created. Exposed for RCTCxxBridge only.
18+
*/
19+
@property (nonatomic, assign, readonly)
20+
#ifdef __cplusplus
21+
facebook::react::jsinspector_modern::PageTarget *
22+
#else
23+
// The inspector infrastructure cannot be used in C or Swift code.
24+
void *
25+
#endif
26+
inspectorTarget;
27+
28+
@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;
29+
30+
@end

packages/react-native/React/Base/RCTBridge+Private.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
*/
77

88
#import <React/RCTBridge.h>
9-
#ifdef __cplusplus
10-
#import <jsinspector-modern/ReactCdp.h>
11-
#endif
129

1310
@class RCTModuleRegistry;
1411
@class RCTModuleData;
@@ -73,17 +70,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
7370
*/
7471
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
7572

76-
/**
77-
* The page target for this bridge, if one has been created. Exposed for RCTCxxBridge only.
78-
*/
79-
@property (nonatomic, assign, readonly)
80-
#ifdef __cplusplus
81-
facebook::react::jsinspector_modern::PageTarget *
82-
#else
83-
// The inspector infrastructure cannot be used in C code.
84-
void *
85-
#endif
86-
inspectorTarget;
8773
@end
8874

8975
@interface RCTBridge (RCTCxxBridge)
@@ -155,12 +141,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
155141

156142
@end
157143

158-
@interface RCTBridge (Inspector)
159-
160-
@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;
161-
162-
@end
163-
164144
@interface RCTCxxBridge : RCTBridge
165145

166146
// TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue.

packages/react-native/React/Base/RCTBridge.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#import "RCTBridge.h"
9+
#import "RCTBridge+Inspector.h"
910
#import "RCTBridge+Private.h"
1011

1112
#import <objc/runtime.h>

packages/react-native/React/CoreModules/RCTDevSettings.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#import <objc/runtime.h>
1111

1212
#import <FBReactNativeSpec/FBReactNativeSpec.h>
13+
#import <React/RCTBridge+Inspector.h>
1314
#import <React/RCTBridge+Private.h>
1415
#import <React/RCTBridgeModule.h>
1516
#import <React/RCTConstants.h>

packages/react-native/React/CxxBridge/RCTCxxBridge.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <future>
1010

1111
#import <React/RCTAssert.h>
12+
#import <React/RCTBridge+Inspector.h>
1213
#import <React/RCTBridge+Private.h>
1314
#import <React/RCTBridge.h>
1415
#import <React/RCTBridgeMethod.h>

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#import <React/NSDataBigString.h>
1313
#import <React/RCTAssert.h>
14+
#import <React/RCTBridge+Inspector.h>
1415
#import <React/RCTBridge+Private.h>
1516
#import <React/RCTBridge.h>
1617
#import <React/RCTBridgeModule.h>

0 commit comments

Comments
 (0)