Skip to content

Commit e82a8e4

Browse files
j-piaseckimeta-codesync[bot]
authored andcommitted
Use umbrellas instead of direct includes in nativemodule/core module (#58711)
Summary: Pull Request resolved: #58711 Changelog: [Internal] Part of the C++ stable API migration to umbrella includes. The `nativemodule/core` headers included other public modules through their fine-grained, `UmbrellaGuard`-protected headers. They now include those modules' umbrellas instead: `<React/CallInvoker.h>`, `<React/Bridging.h>` and `<React/RuntimeExecutor.h>`. This matters most for the iOS `RCTTurboModule*.h` headers, which are exported, have no guard, and are not reached through `<React/NativeModuleCore.h>`. Includes of the module's own headers and all `.cpp`/`.mm` files are unchanged. No functional change. Reviewed By: cortinico Differential Revision: D122123056 fbshipit-source-id: 2fcb2fa2e73c3adf5b5317f3e700b19f35a449e8
1 parent bbf5143 commit e82a8e4

13 files changed

Lines changed: 18 additions & 14 deletions

File tree

‎packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@ Pod::Spec.new do |s|
4949
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
5050
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
5151

52+
add_rn_third_party_dependencies(s)
53+
5254
mark_as_react_native_build(s)
5355
end

‎packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Pod::Spec.new do |s|
4949
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
5050
add_dependency(s, "React-NativeModulesApple")
5151

52+
add_rn_third_party_dependencies(s)
5253
add_rncore_dependency(s)
5354

5455
mark_as_react_native_build(s)

‎packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/CxxTurboModuleUtils.h‎

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

1010
#include <react/cxxstableapi/UmbrellaGuard.h>
1111

12-
#include <ReactCommon/CallInvoker.h>
12+
#include <React/CallInvoker.h>
1313
#include <ReactCommon/TurboModule.h>
1414
#include <functional>
1515
#include <memory>

‎packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h‎

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

1616
#include <jsi/jsi.h>
1717

18-
#include <ReactCommon/CallInvoker.h>
19-
#include <react/bridging/EventEmitter.h>
18+
#include <React/Bridging.h>
19+
#include <React/CallInvoker.h>
2020

2121
namespace facebook::react {
2222

‎packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.h‎

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

1212
#include <string>
1313

14+
#include <React/Bridging.h>
1415
#include <jsi/jsi.h>
15-
#include <react/bridging/LongLivedObject.h>
1616

1717
#include <ReactCommon/TurboModule.h>
1818

‎packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h‎

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

1010
#include <react/cxxstableapi/UmbrellaGuard.h>
1111

12+
#include <React/Bridging.h>
1213
#include <jsi/jsi.h>
13-
#include <react/bridging/LongLivedObject.h>
1414
#include <cassert>
1515
#include <functional>
1616
#include <string>

‎packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleWithJSIBindings.h‎

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

1010
#include <react/cxxstableapi/UmbrellaGuard.h>
1111

12-
#include <ReactCommon/CallInvoker.h>
12+
#include <React/CallInvoker.h>
1313
#include <jsi/jsi.h>
1414

1515
namespace facebook::react {

‎packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
#include <string>
1313

14-
#include <ReactCommon/CallInvoker.h>
14+
#include <React/Bridging.h>
15+
#include <React/CallInvoker.h>
1516
#include <ReactCommon/TurboModule.h>
1617
#include <jsi/jsi.h>
17-
#include <react/bridging/CallbackWrapper.h>
1818
#include <react/jni/JCallback.h>
1919

2020
namespace facebook::react {

‎packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Pod::Spec.new do |s|
3737
s.source_files = podspec_sources("ReactCommon/**/*.{mm,cpp,h}", "ReactCommon/**/*.{h}")
3838

3939
s.dependency "ReactCommon/turbomodule/core"
40+
s.dependency "ReactCommon/turbomodule/coreUmbrella"
4041
s.dependency "React-bridging"
4142
s.dependency "React-callinvoker"
4243
s.dependency "React-Core"

‎packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#import <string>
1313
#import <vector>
1414

15-
#import <ReactCommon/TurboModule.h>
15+
#import <React/NativeModuleCore.h>
1616
#import <jsi/jsi.h>
1717

1818
#import "RCTTurboModule.h"

0 commit comments

Comments
 (0)