Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ val preparePrefab by
Pair("../ReactCommon/jserrorhandler/", "jserrorhandler/"),
Pair("../ReactCommon/react/bridging/", "react/bridging/"),
Pair("../ReactCommon/react/nativemodule/core/", ""),
Pair("../ReactCommon/react/nativemodule/core/React/", "React/"),
Pair("../ReactCommon/react/nativemodule/core/platform/android/", ""),
Pair(
"../ReactCommon/react/renderer/componentregistry/",
Expand Down
10 changes: 9 additions & 1 deletion packages/react-native/ReactCommon/ReactCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,22 @@ Pod::Spec.new do |s|

ss.subspec "core" do |sss|
sss.source_files = podspec_sources("react/nativemodule/core/ReactCommon/**/*.{cpp,h}", "react/nativemodule/core/ReactCommon/**/*.h")
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_featureflags.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"" }
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_featureflags.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"" }
sss.dependency "React-bridging"
sss.dependency "React-cxxreact", version
sss.dependency "React-debug", version
sss.dependency "React-featureflags", version
sss.dependency "React-utils", version
end

ss.subspec "coreUmbrella" do |sss|
sss.source_files = "react/nativemodule/core/React/*.h"
sss.header_dir = ""
sss.header_mappings_dir = "react/nativemodule/core"
end
end

s.dependency "React-cxxstableapi"

mark_as_react_native_build(s)
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target_include_directories(react_nativemodule_core
${CMAKE_CURRENT_SOURCE_DIR}
${platform_DIR}
)
target_include_directories(react_nativemodule_core INTERFACE ${REACT_COMMON_DIR}/react/nativemodule/core)

react_native_android_selector(fbjni fbjni "")
react_native_android_selector(reactnativejni reactnativejni "")
Expand All @@ -31,6 +32,7 @@ target_link_libraries(react_nativemodule_core
glog
jsi
react_bridging
react_cxxstableapi
react_debug
react_utils
react_featureflags
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.
*/

#pragma once

// =============================================================================
// Umbrella header for the `react/nativemodule/core` module - public entry
// point.
//
// #include <React/NativeModuleCore.h>
//
// Re-exports the module's public interface headers. React Native's own code
// should keep using the fine-grained `<ReactCommon/...>` includes; only outside
// consumers use this umbrella.
// =============================================================================

// Marks that the following headers are pulled in through the umbrella, so their
// shared guard (<react/cxxstableapi/UmbrellaGuard.h>) accepts them. The marker
// is saved and restored rather than defined and undefined: the scope ends at
// this block, so later *direct* includes in the same TU are still caught, and
// it nests inside an enclosing umbrella rather than disarming it.
#pragma push_macro("RN_UMBRELLA_CONTEXT")
#undef RN_UMBRELLA_CONTEXT
#define RN_UMBRELLA_CONTEXT 1

#include <ReactCommon/CxxTurboModuleUtils.h>
#include <ReactCommon/TurboModule.h>
#include <ReactCommon/TurboModuleBinding.h>
#include <ReactCommon/TurboModulePerfLogger.h>
#include <ReactCommon/TurboModuleUtils.h>
#include <ReactCommon/TurboModuleWithJSIBindings.h>

#ifdef ANDROID
#include <ReactCommon/JavaInteropTurboModule.h>
#include <ReactCommon/JavaTurboModule.h>
#endif

#undef RN_UMBRELLA_CONTEXT
#pragma pop_macro("RN_UMBRELLA_CONTEXT")
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <ReactCommon/CallInvoker.h>
#include <ReactCommon/TurboModule.h>
#include <functional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <memory>
#include <string>
#include <unordered_map>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <string>

#include <jsi/jsi.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <reactperflogger/NativeModulePerfLogger.h>
#include <memory>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <jsi/jsi.h>
#include <react/bridging/LongLivedObject.h>
#include <cassert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <ReactCommon/CallInvoker.h>
#include <jsi/jsi.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP

#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <string>

#include <ReactCommon/CallInvoker.h>
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/scripts/ios-prebuild/headers-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ const PodspecExceptions /*: {[key: string]: PodSpecConfiguration} */ = {
headerPatterns: ['react/nativemodule/core/ReactCommon/**/*.h'],
headerDir: 'ReactCommon',
},
{
name: 'coreUmbrella',
headerPatterns: ['react/nativemodule/core/React/*.h'],
headerDir: 'React',
},
],
},

Expand Down
Loading