Skip to content

Commit ddadc6f

Browse files
coadofacebook-github-bot
authored andcommitted
Reach public modules through umbrellas from unguarded exported headers (#59026)
Summary: Several exported headers without a stable API guard included fine-grained headers of public modules directly. They are preprocessed in the including translation unit, so under `RN_STRICT_API` any app or library including them hits the public module's `UmbrellaGuard.h` `#error`. Switch them to the module umbrellas: - iOS `RCTCallInvoker.h`, `RCTBridgeProxy+Cxx.h`: `<React/CallInvoker.h>`; `NSDataBigString.h`: `<React/JSBigString.h>`. - Android `react/fabric/AnimatedPropBufferEncoder.h`: `<React/RendererCore.h>`; `react/runtime/jni/JJSTimerExecutor.h`, `JReactInstance.h`: `<React/RuntimeExecutor.h>`. - ReactCxxPlatform `ImageLoaderModule.h`, `NativeExceptionsManager.h`: `<React/Bridging.h>`; `IMountingManager.h`, `RunLoopObserverManager.h`: `<React/RendererCore.h>`; `ReactHost.h`: `<React/CallInvoker.h>`, `<React/NativeModuleCore.h>`; `ReactInstanceConfig.h`: `<React/Debug.h>`. Each umbrella is a superset of the header it replaces, so no declarations are lost. Includes of "for frameworks" headers stay direct. The guards are inert without `RN_STRICT_API`. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D124323428
1 parent 10a5089 commit ddadc6f

12 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎packages/react-native/React/Base/RCTBridgeProxy+Cxx.h‎

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

88
#ifdef __cplusplus
9-
#import <ReactCommon/CallInvoker.h>
9+
#import <React/CallInvoker.h>
1010
#endif
1111

1212
#import "RCTBridgeProxy.h"

‎packages/react-native/React/Base/RCTCallInvoker.h‎

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

1010
#ifdef __cplusplus
11-
#import <ReactCommon/CallInvoker.h>
11+
#import <React/CallInvoker.h>
1212
#endif
1313

1414
NS_ASSUME_NONNULL_BEGIN

‎packages/react-native/React/CxxBridge/NSDataBigString.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#import <Foundation/Foundation.h>
99

10-
#include <cxxreact/JSBigString.h>
10+
#include <React/JSBigString.h>
1111

1212
namespace facebook::react {
1313

‎packages/react-native/ReactAndroid/src/main/jni/react/fabric/AnimatedPropBufferEncoder.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#pragma once
99

10+
#include <React/RendererCore.h>
1011
#include <react/renderer/animationbackend/AnimatedProps.h>
11-
#include <react/renderer/core/ReactPrimitives.h>
1212
#include <unordered_map>
1313
#include <vector>
1414

‎packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JJSTimerExecutor.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <ReactCommon/RuntimeExecutor.h>
10+
#include <React/RuntimeExecutor.h>
1111
#include <fbjni/fbjni.h>
1212
#include <jni.h>
1313
#include <react/jni/WritableNativeArray.h>

‎packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
#pragma once
99

10+
#include <React/RuntimeExecutor.h>
1011
#include <ReactCommon/CallInvokerHolder.h>
1112
#include <ReactCommon/NativeMethodCallInvokerHolder.h>
12-
#include <ReactCommon/RuntimeExecutor.h>
1313
#include <fbjni/fbjni.h>
1414
#include <jni.h>
1515
#include <jsi/jsi.h>

‎packages/react-native/ReactCxxPlatform/react/io/ImageLoaderModule.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#pragma once
99

1010
#include <FBReactNativeSpec/FBReactNativeSpecJSI.h>
11-
#include <react/bridging/Promise.h>
11+
#include <React/Bridging.h>
1212
#include <memory>
1313
#include <string>
1414
#include <utility>

‎packages/react-native/ReactCxxPlatform/react/logging/NativeExceptionsManager.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#pragma once
99

1010
#include <FBReactNativeSpec/FBReactNativeSpecJSI.h>
11+
#include <React/Bridging.h>
1112
#include <folly/dynamic.h>
1213
#include <jserrorhandler/JsErrorHandler.h>
13-
#include <react/bridging/Base.h>
1414
#include <optional>
1515
#include <string>
1616
#include <utility>

‎packages/react-native/ReactCxxPlatform/react/renderer/uimanager/IMountingManager.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#pragma once
99

10+
#include <React/RendererCore.h>
1011
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
11-
#include <react/renderer/core/ComponentDescriptor.h>
1212
#include <react/renderer/mounting/MountingTransaction.h>
1313
#include <react/renderer/mounting/ShadowView.h>
1414

‎packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.h‎

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

1010
#include "ReactInstanceConfig.h"
1111

12-
#include <ReactCommon/CallInvoker.h>
13-
#include <ReactCommon/TurboModule.h>
12+
#include <React/CallInvoker.h>
13+
#include <React/NativeModuleCore.h>
1414
#include <cxxreact/MessageQueueThread.h>
1515
#include <react/logging/DefaultLogger.h>
1616
#include <react/nativemodule/JavaScriptModule.h>

0 commit comments

Comments
 (0)