diff --git a/packages/react-native/React/Base/RCTBridge+Inspector.h b/packages/react-native/React/Base/RCTBridge+Inspector.h new file mode 100644 index 00000000000000..25c3732a3c52be --- /dev/null +++ b/packages/react-native/React/Base/RCTBridge+Inspector.h @@ -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 + +#ifdef __cplusplus +#import +#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 diff --git a/packages/react-native/React/Base/RCTBridge+Private.h b/packages/react-native/React/Base/RCTBridge+Private.h index d9b2be4bab269c..4d03df3ce8d607 100644 --- a/packages/react-native/React/Base/RCTBridge+Private.h +++ b/packages/react-native/React/Base/RCTBridge+Private.h @@ -6,9 +6,6 @@ */ #import -#ifdef __cplusplus -#import -#endif @class RCTModuleRegistry; @class RCTModuleData; @@ -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) @@ -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. diff --git a/packages/react-native/React/Base/RCTBridge.mm b/packages/react-native/React/Base/RCTBridge.mm index 65d827e163be5f..9c1890542e869a 100644 --- a/packages/react-native/React/Base/RCTBridge.mm +++ b/packages/react-native/React/Base/RCTBridge.mm @@ -6,6 +6,7 @@ */ #import "RCTBridge.h" +#import "RCTBridge+Inspector.h" #import "RCTBridge+Private.h" #import diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.mm b/packages/react-native/React/CoreModules/RCTDevSettings.mm index b5e81c940e39f6..10930504894a4b 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.mm +++ b/packages/react-native/React/CoreModules/RCTDevSettings.mm @@ -10,6 +10,7 @@ #import #import +#import #import #import #import diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index a611708814e2a1..05278d5572547c 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -9,6 +9,7 @@ #include #import +#import #import #import #import diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index a200998fe49274..918bd4859e586a 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -11,6 +11,7 @@ #import #import +#import #import #import #import