Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rn][ios][0.74][RC6] decouple RCTBridge+Private from jsinspector-modern #43708

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions packages/react-native/React/Base/RCTBridge+Inspector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import <React/RCTBridge.h>

#ifdef __cplusplus
#import <jsinspector-modern/ReactCdp.h>
#endif

@interface RCTBridge (Inspector)

/**
* The HostTarget for this bridge, if one has been created. Exposed for RCTCxxBridge only.
*/
@property (nonatomic, assign, readonly)
#ifdef __cplusplus
facebook::react::jsinspector_modern::PageTarget *
#else
// The inspector infrastructure cannot be used in C or Swift code.
void *
#endif
inspectorTarget;

@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;

@end
20 changes: 0 additions & 20 deletions packages/react-native/React/Base/RCTBridge+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
*/

#import <React/RCTBridge.h>
#ifdef __cplusplus
#import <jsinspector-modern/ReactCdp.h>
#endif

@class RCTModuleRegistry;
@class RCTModuleData;
Expand Down Expand Up @@ -73,17 +70,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
*/
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;

/**
* The page target for this bridge, if one has been created. Exposed for RCTCxxBridge only.
*/
@property (nonatomic, assign, readonly)
#ifdef __cplusplus
facebook::react::jsinspector_modern::PageTarget *
#else
// The inspector infrastructure cannot be used in C code.
void *
#endif
inspectorTarget;
@end

@interface RCTBridge (RCTCxxBridge)
Expand Down Expand Up @@ -155,12 +141,6 @@ RCT_EXTERN void RCTRegisterModule(Class);

@end

@interface RCTBridge (Inspector)

@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;

@end

@interface RCTCxxBridge : RCTBridge

// TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue.
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/React/Base/RCTBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#import "RCTBridge.h"
#import "RCTBridge+Inspector.h"
#import "RCTBridge+Private.h"

#import <objc/runtime.h>
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/React/CoreModules/RCTDevSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import <objc/runtime.h>

#import <FBReactNativeSpec/FBReactNativeSpec.h>
#import <React/RCTBridge+Inspector.h>
#import <React/RCTBridge+Private.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTConstants.h>
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <future>

#import <React/RCTAssert.h>
#import <React/RCTBridge+Inspector.h>
#import <React/RCTBridge+Private.h>
#import <React/RCTBridge.h>
#import <React/RCTBridgeMethod.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#import <React/NSDataBigString.h>
#import <React/RCTAssert.h>
#import <React/RCTBridge+Inspector.h>
#import <React/RCTBridge+Private.h>
#import <React/RCTBridge.h>
#import <React/RCTBridgeModule.h>
Expand Down
Loading