Skip to content
Closed
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 @@ -285,6 +285,7 @@ val preparePrefab by
),
// react_timing
Pair("../ReactCommon/react/timing/", "react/timing/"),
Pair("../ReactCommon/react/timing/React/", "React/"),
// yoga
Pair("../ReactCommon/yoga/", ""),
Pair("src/main/jni/first-party/yogajni/jni", ""),
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/ReactCommon/react/timing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake)
add_library(react_timing INTERFACE)

target_include_directories(react_timing INTERFACE ${REACT_COMMON_DIR})
target_include_directories(react_timing INTERFACE ${REACT_COMMON_DIR}/react/timing)

target_link_libraries(react_timing INTERFACE
react_cxxstableapi
react_debug)
target_compile_reactnative_options(react_timing INTERFACE)
target_compile_options(react_timing INTERFACE -Wpedantic)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
header_search_paths = []

if ENV['USE_FRAMEWORKS']
header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../..\"" # this is needed to allow the target access its own files
header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../..\"" # ReactCommon, for the target's own files and <react/cxxstableapi/...>
end

Pod::Spec.new do |s|
Expand All @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.source = source
s.source_files = podspec_sources("*.{cpp,h}", "**/*.h")
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
s.header_dir = "react/timing"
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
Expand All @@ -40,6 +40,13 @@ Pod::Spec.new do |s|
resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_timing")

add_dependency(s, "React-debug")
s.dependency "React-cxxstableapi"

s.subspec "timingUmbrella" do |ss|
ss.source_files = "React/*.h"
ss.header_dir = "React"
ss.header_mappings_dir = "React"
end

s.resource_bundles = {'React-timing_privacy' => 'PrivacyInfo.xcprivacy'}

Expand Down
27 changes: 27 additions & 0 deletions packages/react-native/ReactCommon/react/timing/React/Timing.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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/timing` module - public entry point.
//
// #include <React/Timing.h>
//
// Re-exports the module's public interface headers. React Native's own code
// should keep using the fine-grained `<react/timing/...>` 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. Scoped to
// this block so later *direct* includes in the same TU are still caught.
#define RN_UMBRELLA_CONTEXT

#include <react/timing/primitives.h>

#undef RN_UMBRELLA_CONTEXT
2 changes: 2 additions & 0 deletions packages/react-native/ReactCommon/react/timing/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <react/cxxstableapi/UmbrellaGuard.h>

#include <react/debug/flags.h>
#include <chrono>
#include <cmath>
Expand Down
17 changes: 17 additions & 0 deletions packages/react-native/scripts/ios-prebuild/headers-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,23 @@ const PodspecExceptions /*: {[key: string]: PodSpecConfiguration} */ = {
],
},
'React.podspec': {disabled: true},
'ReactCommon/react/timing/React-timing.podspec': {
name: 'React-timing',
headerPatterns: [],
headerDir: '',
subSpecs: [
{
name: 'timing',
headerPatterns: ['*.h'],
headerDir: 'react/timing',
},
{
name: 'timingUmbrella',
headerPatterns: ['React/*.h'],
headerDir: 'React',
},
],
},
'Libraries/PushNotificationIOS/React-RCTPushNotification.podspec': {
disabled: true,
},
Expand Down
Loading