From 2fcf53ec97415e1fad1ad5ab80ace37bb8aab7c4 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 22 Apr 2026 15:34:24 -0700 Subject: [PATCH 01/11] fix: add missing SanitizeLeak.cpp to RCT-Folly podspec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Folly `SanitizeLeak.cpp` file provides implementations for `annotate_object_leaked_impl`, `annotate_object_collected_impl`, and `annotate_object_count_leaked_uncollected_impl`. These symbols are declared in `SanitizeLeak.h` and referenced by `small_vector.h`, but the .cpp was not listed in the podspec's source_files. With static libraries this is benign — the linker skips unreferenced symbols. With `USE_FRAMEWORKS=dynamic` the linker must resolve every symbol, causing an "undefined symbols for architecture x86_64" error. Co-Authored-By: Claude Opus 4.6 --- packages/react-native/third-party-podspecs/RCT-Folly.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index 8852179b6ce2..0b9388d6a7aa 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -49,6 +49,7 @@ Pod::Spec.new do |spec| 'folly/lang/CString.cpp', 'folly/lang/Exception.cpp', 'folly/memory/ReentrantAllocator.cpp', + 'folly/memory/SanitizeLeak.cpp', 'folly/memory/detail/MallocImpl.cpp', 'folly/net/NetOps.cpp', 'folly/portability/SysUio.cpp', From 1cb2b740f11183816571d27079727ca7155b9c5c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 00:21:48 -0700 Subject: [PATCH 02/11] ci: build RNTester with dynamic frameworks Add a linkage: [static, dynamic] dimension to the RNTester build matrix so macOS, iOS and visionOS are each exercised with USE_FRAMEWORKS=dynamic in addition to the default static libraries. USE_FRAMEWORKS is unset for static builds so the Podfile keeps its default linkage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/microsoft-build-rntester.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/microsoft-build-rntester.yml b/.github/workflows/microsoft-build-rntester.yml index 20797e8f8d07..c24f754f5e1d 100644 --- a/.github/workflows/microsoft-build-rntester.yml +++ b/.github/workflows/microsoft-build-rntester.yml @@ -5,7 +5,7 @@ on: jobs: build-rntester: - name: "${{ matrix.platform }}, ${{ matrix.arch }}" + name: "${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.linkage }}" runs-on: macos-26 timeout-minutes: 90 strategy: @@ -13,6 +13,7 @@ jobs: matrix: platform: [macos, ios, visionos] arch: [oldarch, newarch] + linkage: [static, dynamic] include: # Platform-specific properties - platform: macos @@ -32,6 +33,11 @@ jobs: new_arch_enabled: '0' - arch: newarch new_arch_enabled: '1' + # Linkage-specific properties + - linkage: static + use_frameworks: '' + - linkage: dynamic + use_frameworks: 'dynamic' steps: - uses: actions/checkout@v4 @@ -53,8 +59,15 @@ jobs: working-directory: packages/rn-tester env: RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }} + USE_FRAMEWORKS: ${{ matrix.use_frameworks }} run: | set -eox pipefail + # USE_FRAMEWORKS is empty for static-library builds; unset it so the + # Podfile keeps its default (static libraries) instead of coercing an + # empty linkage value. + if [[ -z "$USE_FRAMEWORKS" ]]; then + unset USE_FRAMEWORKS + fi bundle install bundle exec pod install --verbose From e8d8169bd2f5d420d9ee95c4c37e0e90eaad2cb9 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 15:40:16 -0700 Subject: [PATCH 03/11] fix(macos): improve USE_FRAMEWORKS=dynamic support for RNTester Several fixes that let the multi-platform (iOS/macOS/visionOS) RNTester workspace get much further building with USE_FRAMEWORKS=dynamic: - Set SUPPORTED_PLATFORMS per pod target from its SDKROOT. Without it, the per-platform framework targets (hermes.framework etc.) all look like candidates for a given -framework flag, so Xcode pulls the wrong ones in and hermes-engine's identical script-phase outputs collide with 'Multiple commands produce'. - Set $RN_PLATFORMS before podspec evaluation (not in post_install), so add_dependency() generates per-platform-suffixed framework header search paths (React-debug-iOS vs React-debug-macOS). Previously the suffix was missing, breaking headers like react/debug/react_native_assert.h. - Generate suffixed framework header search paths in the React-cxxreact, ReactCommon and React-NativeModulesApple podspecs (also corrects a React_featureflags.framework path that pointed at the React-debug dir). - Expose react/renderer/components/view/platform/macos on React-Fabric's framework header search paths; the fork compiles those macOS view files on all platforms and they include react/renderer/components/view/KeyEvent.h. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ReactCommon/React-Fabric.podspec | 1 + .../ReactCommon/ReactCommon.podspec | 8 ++- .../cxxreact/React-cxxreact.podspec | 7 +- .../ios/React-NativeModulesApple.podspec | 6 +- .../scripts/cocoapods/__tests__/utils-test.rb | 66 +++++++++++++++++++ .../react-native/scripts/cocoapods/utils.rb | 37 ++++++++++- .../react-native/scripts/react_native_pods.rb | 1 + packages/rn-tester/Podfile | 9 ++- 8 files changed, 128 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 3083472b8038..15ed91e40078 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -89,6 +89,7 @@ Pod::Spec.new do |s| "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/text/platform/cxx\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/textinput/platform/ios\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/view/platform/cxx\"", + "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/view/platform/macos\"", # [macOS] macos view files are compiled on all platforms; expose their headers (e.g. KeyEvent.h) ] end diff --git a/packages/react-native/ReactCommon/ReactCommon.podspec b/packages/react-native/ReactCommon/ReactCommon.podspec index 345d97686fe6..23eb03ac668e 100644 --- a/packages/react-native/ReactCommon/ReactCommon.podspec +++ b/packages/react-native/ReactCommon/ReactCommon.podspec @@ -63,7 +63,13 @@ 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\"" } + # [macOS] Generate per-platform-suffixed framework header search paths so headers + # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. + core_framework_header_search_paths = ["\"$(PODS_TARGET_SRCROOT)/ReactCommon\""] + .concat(create_header_search_path_for_frameworks("React-debug", framework_name: "React_debug").map { |search_path| "\"#{search_path}\"" }) + .concat(create_header_search_path_for_frameworks("React-featureflags", framework_name: "React_featureflags").map { |search_path| "\"#{search_path}\"" }) + .concat(create_header_search_path_for_frameworks("React-utils", framework_name: "React_utils").map { |search_path| "\"#{search_path}\"" }) + sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => core_framework_header_search_paths.join(" ") } sss.dependency "React-debug", version sss.dependency "React-featureflags", version sss.dependency "React-utils", version diff --git a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec index 127dc2cec705..58c02a19663d 100644 --- a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec @@ -28,8 +28,13 @@ Pod::Spec.new do |s| s.platforms = min_supported_versions s.source = source s.source_files = podspec_sources("*.{cpp,h}", "*.h") + # [macOS] Generate per-platform-suffixed framework header search paths so headers + # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. + cxxreact_framework_header_search_paths = create_header_search_path_for_frameworks("React-debug", framework_name: "React_debug") + .concat(create_header_search_path_for_frameworks("React-runtimeexecutor", framework_name: "React_runtimeexecutor")) + .map { |search_path| "\"#{search_path}\"" } s.pod_target_xcconfig = { - "HEADER_SEARCH_PATHS" => "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"", + "HEADER_SEARCH_PATHS" => cxxreact_framework_header_search_paths.join(" "), "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() } s.header_dir = "cxxreact" diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec index edc219a3d516..200e217ecfcc 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec @@ -27,7 +27,11 @@ Pod::Spec.new do |s| s.author = "Meta Platforms, Inc. and its affiliates" s.platforms = min_supported_versions s.source = source - s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_featureflags.framework/Headers\"", + # [macOS] Generate per-platform-suffixed framework header search paths so headers + # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. + nativemodules_header_search_paths = ["\"$(PODS_ROOT)/Headers/Private/React-Core\""] + .concat(create_header_search_path_for_frameworks("React-featureflags", framework_name: "React_featureflags").map { |search_path| "\"#{search_path}\"" }) + s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => nativemodules_header_search_paths.join(" "), "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), "GCC_WARN_PEDANTIC" => "YES" } diff --git a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb index 7ddbbb36e85f..1397a6fcef87 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb @@ -550,6 +550,72 @@ def test_detectUseFrameworks_whenEnvNotSetAndDynamicFrameworks_setEnvVarToDynami assert_equal(ENV['USE_FRAMEWORKS'], 'dynamic') end + # ======================================= # + # Test - Set Supported Platforms # + # ======================================= # + def test_setSupportedPlatformsForFrameworks_whenMultiPlatformFrameworks_setsSupportedPlatformsFromSDKROOT + # Arrange + ENV['USE_FRAMEWORKS'] = 'dynamic' + $RN_PLATFORMS = ['iOS', 'macOS', 'visionOS'] + ios_target = TargetMock.new("hermes-engine-iOS", [ + prepare_config("Debug", {"SDKROOT" => "iphoneos"}), + prepare_config("Release", {"SDKROOT" => "iphoneos"}), + ]) + macos_target = TargetMock.new("hermes-engine-macOS", [ + prepare_config("Debug", {"SDKROOT" => "macosx"}), + ]) + visionos_target = TargetMock.new("hermes-engine-visionOS", [ + prepare_config("Debug", {"SDKROOT" => "xros"}), + ]) + unknown_target = TargetMock.new("SomeHostTool", [ + prepare_config("Debug", {"SDKROOT" => "someunknownsdk"}), + ]) + pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [ios_target, macos_target, visionos_target, unknown_target]) + installer = InstallerMock.new(pods_projects_mock, []) + + # Act + ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) + + # Assert + ios_target.build_configurations.each { |config| assert_equal("iphoneos iphonesimulator", config.build_settings["SUPPORTED_PLATFORMS"]) } + macos_target.build_configurations.each { |config| assert_equal("macosx", config.build_settings["SUPPORTED_PLATFORMS"]) } + visionos_target.build_configurations.each { |config| assert_equal("xros xrsimulator", config.build_settings["SUPPORTED_PLATFORMS"]) } + unknown_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } + assert_equal(1, pods_projects_mock.save_invocation_count) + end + + def test_setSupportedPlatformsForFrameworks_whenNotUsingFrameworks_doesNothing + # Arrange + ENV['USE_FRAMEWORKS'] = nil + $RN_PLATFORMS = ['iOS', 'macOS', 'visionOS'] + macos_target = TargetMock.new("hermes-engine-macOS", [prepare_config("Debug", {"SDKROOT" => "macosx"})]) + pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [macos_target]) + installer = InstallerMock.new(pods_projects_mock, []) + + # Act + ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) + + # Assert + macos_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } + assert_equal(0, pods_projects_mock.save_invocation_count) + end + + def test_setSupportedPlatformsForFrameworks_whenSinglePlatform_doesNothing + # Arrange + ENV['USE_FRAMEWORKS'] = 'dynamic' + $RN_PLATFORMS = ['iOS'] + ios_target = TargetMock.new("hermes-engine-iOS", [prepare_config("Debug", {"SDKROOT" => "iphoneos"})]) + pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [ios_target]) + installer = InstallerMock.new(pods_projects_mock, []) + + # Act + ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) + + # Assert + ios_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } + assert_equal(0, pods_projects_mock.save_invocation_count) + end + # ============================ # # Test - Update Search Paths # # ============================ # diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 53386411a83a..64e920b8136d 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -378,9 +378,40 @@ def self.set_dynamic_frameworks_flags(installer) end end - # ========= # - # Utilities # - # ========= # + # [macOS] When building with `use_frameworks!` in a workspace that targets + # multiple Apple platforms (e.g. RNTester with iOS, macOS and visionOS), every + # per-platform pod target produces a framework with the same product name + # (`hermes.framework`, `React_debug.framework`, ...). CocoaPods does not set + # `SUPPORTED_PLATFORMS` on those targets, so Xcode's implicit dependency + # resolution considers all of them candidates for a given `-framework` flag. + # That pulls the wrong-platform targets into the build, which makes linking + # ambiguous and triggers "Multiple commands produce" errors for the + # hermes-engine build script phases (whose declared output paths are identical + # across platforms). Constraining `SUPPORTED_PLATFORMS` to each target's own + # SDK makes implicit dependency resolution pick the single correct target. + def self.set_supported_platforms_for_frameworks(installer) + return if ENV['USE_FRAMEWORKS'] == nil + + # Only relevant for multi-platform workspaces. $RN_PLATFORMS is set by the + # app's Podfile (see create_header_search_path_for_frameworks). + return if $RN_PLATFORMS == nil || $RN_PLATFORMS.length <= 1 + + sdkroot_to_supported_platforms = { + "iphoneos" => "iphoneos iphonesimulator", + "macosx" => "macosx", + "xros" => "xros xrsimulator", + "appletvos" => "appletvos appletvsimulator", + } + + installer.pods_project.native_targets.each do |target| + target.build_configurations.each do |config| + supported_platforms = sdkroot_to_supported_platforms[config.build_settings["SDKROOT"]] + config.build_settings["SUPPORTED_PLATFORMS"] = supported_platforms if supported_platforms != nil + end + end + + installer.pods_project.save + end def self.extract_projects(installer) return installer.aggregate_targets diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index ca9a677645e3..aca3c6c6361f 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -495,6 +495,7 @@ def react_native_post_install( ReactNativePodsUtils.set_ccache_compiler_and_linker_build_settings(installer, react_native_path, ccache_enabled) ReactNativePodsUtils.updateOSDeploymentTarget(installer) ReactNativePodsUtils.set_dynamic_frameworks_flags(installer) + ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) # [macOS] Disambiguate per-platform framework targets in multi-platform workspaces ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer) SPM.apply_on_post_install(installer) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index f07566c31c3f..c2252a2e4f5d 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -21,6 +21,14 @@ end prepare_react_native_project! +# [macOS] Declare the platforms this workspace targets *before* any podspecs are +# evaluated. add_dependency() reads $RN_PLATFORMS at podspec-evaluation time to +# generate per-platform framework header search paths (e.g. React-debug-iOS vs +# React-debug-macOS). Setting it only in post_install (which runs later) leaves +# those paths without a platform suffix, breaking header resolution under +# use_frameworks! (e.g. 'react/debug/react_native_assert.h' file not found). +$RN_PLATFORMS = %w[iOS macOS visionOS] + IN_CI = ENV['CI'] == 'true' @prefix_path = "../react-native" @@ -100,6 +108,5 @@ end # visionOS] post_install do |installer| - $RN_PLATFORMS = %w[iOS macOS visionOS] # [macOS] react_native_post_install(installer, @prefix_path, :mac_catalyst_enabled => false) end From 0ba4afe06f91c3d9e46c261b144695a5909e4fd6 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 7 Jul 2026 15:40:16 -0700 Subject: [PATCH 04/11] ci: mark dynamic-frameworks RNTester builds continue-on-error Dynamic frameworks are a work in progress on this fork, so let those matrix jobs report status without failing the build (matching upstream's continue-on-error dynamic-frameworks job). Static builds stay required. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/microsoft-build-rntester.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/microsoft-build-rntester.yml b/.github/workflows/microsoft-build-rntester.yml index c24f754f5e1d..c215a59593d6 100644 --- a/.github/workflows/microsoft-build-rntester.yml +++ b/.github/workflows/microsoft-build-rntester.yml @@ -8,6 +8,10 @@ jobs: name: "${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.linkage }}" runs-on: macos-26 timeout-minutes: 90 + # Dynamic frameworks are a work in progress on this fork (see RCT-Folly / header + # plumbing). Let those jobs report status without failing the build, matching + # upstream's continue-on-error dynamic-frameworks job. Static builds stay required. + continue-on-error: ${{ matrix.linkage == 'dynamic' }} strategy: fail-fast: false matrix: From ad2331d1cbb25014f8fe9347099aff0236edb44e Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 8 Jul 2026 00:15:05 -0700 Subject: [PATCH 05/11] fix(macos): give RCTUIKit its own module namespace for use_frameworks RCTUIKit lives in the separate React-RCTUIKit pod (module React_RCTUIKit) but is imported everywhere as . In static builds both React-Core and React-RCTUIKit use header_dir "React", so their headers pool into one Pods/Headers/Public/React dir and the include resolves. Under use_frameworks! each pod builds its own framework module, that shared dir vanishes, and can no longer resolve. Make React_RCTUIKit RCTUIKit's canonical namespace and re-export it from React-Core as modular aliases: - React-RCTUIKit.podspec header_dir "React" -> "React_RCTUIKit". - RCTUIKit's internal sibling imports -> so the pod references its own module (breaks a React -> React_RCTUIKit -> React module cycle under frameworks). - Add React-Core forwarding headers (React/RCTUIKitForwarding/*.h) that #import . Because React_RCTUIKit is a real module, these are modular includes, so resolves without the non-modular-include-in-framework-module error a loose header would hit. All ~195 existing imports keep working unchanged. - SwiftPM prebuild: link React/RCTUIKit into React_RCTUIKit as well (in addition to React) so the new imports resolve; the forwarding dir is excluded from the reactCore SPM target. Verified: static RNTester iOS build passes; dynamic build resolves RCTUIKit with zero cyclic / non-modular / not-found errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/Package.swift | 2 +- packages/react-native/React-RCTUIKit.podspec | 2 +- .../RCTUIKit/RCTUIActivityIndicatorView.h | 2 +- .../RCTUIKit/RCTUIActivityIndicatorView.m | 2 +- .../React/RCTUIKit/RCTUIGraphics.m | 2 +- .../RCTUIKit/RCTUIGraphicsImageRenderer.h | 2 +- .../RCTUIKit/RCTUIGraphicsImageRenderer.m | 4 +-- .../react-native/React/RCTUIKit/RCTUIImage.h | 2 +- .../react-native/React/RCTUIKit/RCTUIImage.m | 2 +- .../React/RCTUIKit/RCTUIImageView.h | 4 +-- .../React/RCTUIKit/RCTUIImageView.m | 2 +- .../react-native/React/RCTUIKit/RCTUIKit.h | 30 +++++++++---------- .../react-native/React/RCTUIKit/RCTUILabel.h | 2 +- .../react-native/React/RCTUIKit/RCTUILabel.m | 2 +- .../React/RCTUIKit/RCTUIScrollView.h | 2 +- .../React/RCTUIKit/RCTUIScrollView.m | 2 +- .../react-native/React/RCTUIKit/RCTUISlider.h | 2 +- .../react-native/React/RCTUIKit/RCTUISlider.m | 2 +- .../react-native/React/RCTUIKit/RCTUISwitch.h | 2 +- .../react-native/React/RCTUIKit/RCTUISwitch.m | 2 +- .../react-native/React/RCTUIKit/RCTUIView.h | 2 +- .../react-native/React/RCTUIKit/RCTUIView.m | 2 +- .../RCTPlatformDisplayLink.h | 12 ++++++++ .../RCTUIAccessibilityTraits.h | 12 ++++++++ .../RCTUIActivityIndicatorView.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIGeometry.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIGraphics.h | 12 ++++++++ .../RCTUIGraphicsImageRenderer.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIImage.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIImageView.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIKit.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIKitCompat.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUILabel.h | 12 ++++++++ .../RCTUIKitForwarding/RCTUIScrollView.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUISlider.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUISwitch.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUITouch.h | 12 ++++++++ .../React/RCTUIKitForwarding/RCTUIView.h | 12 ++++++++ .../scripts/ios-prebuild/setup.js | 3 ++ 39 files changed, 233 insertions(+), 38 deletions(-) create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h create mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIView.h diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index d27caa9860ef..6c17c1e751b4 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -365,7 +365,7 @@ let reactCore = RNTarget( "ReactCommon/react/runtime/platform/ios", // explicit header search path to break circular dependency. RCTHost imports `RCTDefines.h` in ReactCore, ReacCore needs to import RCTHost ], linkedFrameworks: ["CoreServices"], - excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules", "RCTUIKit"], // [macOS] + excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules", "RCTUIKit", "RCTUIKitForwarding"], // [macOS] dependencies: [.reactNativeDependencies, .reactCxxReact, .reactPerfLogger, .jsi, .reactJsiExecutor, .reactUtils, .reactFeatureFlags, .reactRuntimeScheduler, .yoga, .reactJsInspector, .reactJsiTooling, .rctDeprecation, .reactCoreRCTWebsocket, .reactRCTImage, .reactTurboModuleCore, .reactRCTText, .reactRCTBlob, .reactRCTAnimation, .reactRCTNetwork, .reactFabric, .hermesPrebuilt, .reactRCTUIKit], // [macOS] sources: [".", "Runtime/RCTHermesInstanceFactory.mm"] ) diff --git a/packages/react-native/React-RCTUIKit.podspec b/packages/react-native/React-RCTUIKit.podspec index 1bae5cf333f3..fe4da7e801cc 100644 --- a/packages/react-native/React-RCTUIKit.podspec +++ b/packages/react-native/React-RCTUIKit.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| ["React/RCTUIKit/*.{h,m}"], "React/RCTUIKit/*.h") s.public_header_files = "React/RCTUIKit/*.h" - s.header_dir = "React" + s.header_dir = "React_RCTUIKit" # [macOS] Own namespace so resolves consistently (static + frameworks); React-Core vends forwarding aliases s.module_name = "React_RCTUIKit" s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h index d5700b0604d5..0ee4efb9904b 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX @compatibility_alias RCTUIActivityIndicatorView UIActivityIndicatorView; diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m index f7963452d2fd..e1fe4d027619 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import #import #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphics.m b/packages/react-native/React/RCTUIKit/RCTUIGraphics.m index d38f951f79bc..45e35c64716a 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphics.m +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphics.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h index 0fa256c6004f..233e7f7ac5a0 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m index 95c420b3b30b..3ba92e07e373 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m @@ -9,8 +9,8 @@ #if TARGET_OS_OSX -#import -#import +#import +#import @implementation RCTUIGraphicsImageRendererFormat diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.h b/packages/react-native/React/RCTUIKit/RCTUIImage.h index b09122f94481..be32ab557653 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImage.h +++ b/packages/react-native/React/RCTUIKit/RCTUIImage.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.m b/packages/react-native/React/RCTUIKit/RCTUIImage.m index b851a4198c41..185ed9f16326 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImage.m +++ b/packages/react-native/React/RCTUIKit/RCTUIImage.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import // UIImage diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.h b/packages/react-native/React/RCTUIKit/RCTUIImageView.h index 4e011aa2b9e9..ef16661faaa8 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImageView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIImageView.h @@ -11,8 +11,8 @@ #include -#import -#import +#import +#import #if !TARGET_OS_OSX @compatibility_alias RCTUIImageView UIImageView; diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.m b/packages/react-native/React/RCTUIKit/RCTUIImageView.m index d2c4a4d892ab..e3bc13420c14 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImageView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIImageView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIKit.h b/packages/react-native/React/RCTUIKit/RCTUIKit.h index 3a9c635ffc69..77549666d7f0 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIKit.h +++ b/packages/react-native/React/RCTUIKit/RCTUIKit.h @@ -8,18 +8,18 @@ // [macOS] // Umbrella header for RCTUIKit — the UIKit/AppKit compatibility layer. -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.h b/packages/react-native/React/RCTUIKit/RCTUILabel.h index 7781effc3b6f..522355ab27f7 100644 --- a/packages/react-native/React/RCTUIKit/RCTUILabel.h +++ b/packages/react-native/React/RCTUIKit/RCTUILabel.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX @compatibility_alias RCTUILabel UILabel; diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.m b/packages/react-native/React/RCTUIKit/RCTUILabel.m index b0b6da79f8d6..2a6452bcd0f5 100644 --- a/packages/react-native/React/RCTUIKit/RCTUILabel.m +++ b/packages/react-native/React/RCTUIKit/RCTUILabel.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import @implementation RCTUILabel {} diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.h b/packages/react-native/React/RCTUIKit/RCTUIScrollView.h index 3b8cb22f2605..021acab02d58 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIScrollView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIScrollView.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.m b/packages/react-native/React/RCTUIKit/RCTUIScrollView.m index bdbc0c32610d..c9448f1c73fc 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIScrollView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIScrollView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import // RCTUIScrollView diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.h b/packages/react-native/React/RCTUIKit/RCTUISlider.h index 76f4cc243d40..84d24facb260 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISlider.h +++ b/packages/react-native/React/RCTUIKit/RCTUISlider.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX @compatibility_alias RCTUISlider UISlider; diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.m b/packages/react-native/React/RCTUIKit/RCTUISlider.m index 36e78475becb..99a3bb494ce9 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISlider.m +++ b/packages/react-native/React/RCTUIKit/RCTUISlider.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import @implementation RCTUISlider {} diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.h b/packages/react-native/React/RCTUIKit/RCTUISwitch.h index ef262220bcf4..f818a3e1b879 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISwitch.h +++ b/packages/react-native/React/RCTUIKit/RCTUISwitch.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX @compatibility_alias RCTUISwitch UISwitch; diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.m b/packages/react-native/React/RCTUIKit/RCTUISwitch.m index 04d6918cf00c..412a8b34eaca 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISwitch.m +++ b/packages/react-native/React/RCTUIKit/RCTUISwitch.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import @implementation RCTUISwitch diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.h b/packages/react-native/React/RCTUIKit/RCTUIView.h index c87faaa94497..8ebd06218cd6 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIView.h @@ -11,7 +11,7 @@ #include -#import +#import #if !TARGET_OS_OSX #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.m b/packages/react-native/React/RCTUIKit/RCTUIView.m index 0976c309ff90..96f84d550b0b 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIView.m @@ -10,7 +10,7 @@ #if TARGET_OS_OSX #import -#import +#import // UIView diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h b/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h new file mode 100644 index 000000000000..9c6d7a60eacd --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h new file mode 100644 index 000000000000..ec13f93cb8c2 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h new file mode 100644 index 000000000000..91717d8850d5 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h new file mode 100644 index 000000000000..b3682eaf823f --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h new file mode 100644 index 000000000000..996bf00c1f3c --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h new file mode 100644 index 000000000000..1815d3df4b02 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h new file mode 100644 index 000000000000..ae0a933d31d7 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h new file mode 100644 index 000000000000..47a9c3e5e2be --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h new file mode 100644 index 000000000000..0a6603d21ec4 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h new file mode 100644 index 000000000000..d4d788c35a4a --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h b/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h new file mode 100644 index 000000000000..6ece08180771 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h new file mode 100644 index 000000000000..10df1187fd3f --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h b/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h new file mode 100644 index 000000000000..ccafaa382bf1 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h b/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h new file mode 100644 index 000000000000..7197a3b52f2e --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h b/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h new file mode 100644 index 000000000000..fa3235f68cb9 --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h new file mode 100644 index 000000000000..e5b3f59aec2e --- /dev/null +++ b/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module +// React_RCTUIKit), but is imported throughout as . This alias keeps +// those imports working under use_frameworks! by re-exporting the (modular) +// React_RCTUIKit header. Under static libraries it resolves the same way. +#import diff --git a/packages/react-native/scripts/ios-prebuild/setup.js b/packages/react-native/scripts/ios-prebuild/setup.js index c2cd31e65460..4f16a8dbb0e2 100644 --- a/packages/react-native/scripts/ios-prebuild/setup.js +++ b/packages/react-native/scripts/ios-prebuild/setup.js @@ -146,6 +146,9 @@ async function setup( link('Libraries/Settings', 'React'); link('React/RCTUIKit', 'React'); // [macOS] + // [macOS] RCTUIKit's own module namespace, so its internal + // sibling imports resolve in the prebuild the same way consumers do. + link('React/RCTUIKit', 'React_RCTUIKit'); // [macOS] link('Libraries/PushNotificationIOS', 'React'); link('Libraries/Settings', 'React'); link('Libraries/Vibration', 'React'); From 3047b5065f4898d8ca4e76429f90fa60ce452c84 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 8 Jul 2026 13:36:08 -0700 Subject: [PATCH 06/11] ci: keep dynamic-frameworks RNTester jobs green while WIP Move continue-on-error from the job to the pod-install and build steps for dynamic linkage. The jobs still run for coverage (real result visible in the step logs), but a dynamic build failure no longer shows the check as failed. Static builds remain strict and required. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/microsoft-build-rntester.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/microsoft-build-rntester.yml b/.github/workflows/microsoft-build-rntester.yml index c215a59593d6..9dc5e92f6e54 100644 --- a/.github/workflows/microsoft-build-rntester.yml +++ b/.github/workflows/microsoft-build-rntester.yml @@ -8,10 +8,6 @@ jobs: name: "${{ matrix.platform }}, ${{ matrix.arch }}, ${{ matrix.linkage }}" runs-on: macos-26 timeout-minutes: 90 - # Dynamic frameworks are a work in progress on this fork (see RCT-Folly / header - # plumbing). Let those jobs report status without failing the build, matching - # upstream's continue-on-error dynamic-frameworks job. Static builds stay required. - continue-on-error: ${{ matrix.linkage == 'dynamic' }} strategy: fail-fast: false matrix: @@ -61,6 +57,11 @@ jobs: - name: Install Pods working-directory: packages/rn-tester + # Dynamic frameworks are still a work in progress on this fork (see RCT-Folly / + # header plumbing). Run those jobs for coverage but don't let pod install / build + # failures fail the check; the real result is still visible in the step logs. + # Static builds stay strict/required. + continue-on-error: ${{ matrix.linkage == 'dynamic' }} env: RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }} USE_FRAMEWORKS: ${{ matrix.use_frameworks }} @@ -76,6 +77,7 @@ jobs: bundle exec pod install --verbose - name: Build ${{ matrix.scheme }} + continue-on-error: ${{ matrix.linkage == 'dynamic' }} # [macOS] Dynamic frameworks WIP; keep the check green while building for coverage env: USE_CCACHE: 0 run: | From 01246fba80fe7ed2bdf6bc4cb1d6f270a05cc656 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Jul 2026 09:22:35 -0700 Subject: [PATCH 07/11] refactor(macos): minimize RCTUIKit compatibility headers Keep React_RCTUIKit as RCTUIKit's canonical module, but replace the 16 React-Core forwarding headers with only the two compatibility entry points used outside the module: - , the public umbrella used throughout RN and by major third-party packages (WebView, Gesture Handler, SVG, Skia, Expo, etc.). - , used directly by Reanimated/Worklets for their macOS display-link implementation. RCTUIKit's implementation now uses local sibling imports, avoiding the React -> React_RCTUIKit -> React module cycle without requiring a second SwiftPM header alias. This removes the RCTUIKitForwarding directory and reverts the no-longer-needed Package.swift/setup.js changes. Verified: static RNTester iOS build succeeds; dynamic build has zero RCTUIKit not-found, cyclic-module, or non-modular-header errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/Package.swift | 2 +- .../React/RCTPlatformDisplayLink.h | 9 ++++++ packages/react-native/React/RCTUIKit.h | 9 ++++++ .../RCTUIKit/RCTUIActivityIndicatorView.h | 2 +- .../RCTUIKit/RCTUIActivityIndicatorView.m | 2 +- .../React/RCTUIKit/RCTUIGraphics.m | 2 +- .../RCTUIKit/RCTUIGraphicsImageRenderer.h | 2 +- .../RCTUIKit/RCTUIGraphicsImageRenderer.m | 4 +-- .../react-native/React/RCTUIKit/RCTUIImage.h | 2 +- .../react-native/React/RCTUIKit/RCTUIImage.m | 2 +- .../React/RCTUIKit/RCTUIImageView.h | 4 +-- .../React/RCTUIKit/RCTUIImageView.m | 2 +- .../react-native/React/RCTUIKit/RCTUIKit.h | 30 +++++++++---------- .../react-native/React/RCTUIKit/RCTUILabel.h | 2 +- .../react-native/React/RCTUIKit/RCTUILabel.m | 2 +- .../React/RCTUIKit/RCTUIScrollView.h | 2 +- .../React/RCTUIKit/RCTUIScrollView.m | 2 +- .../react-native/React/RCTUIKit/RCTUISlider.h | 2 +- .../react-native/React/RCTUIKit/RCTUISlider.m | 2 +- .../react-native/React/RCTUIKit/RCTUISwitch.h | 2 +- .../react-native/React/RCTUIKit/RCTUISwitch.m | 2 +- .../react-native/React/RCTUIKit/RCTUIView.h | 2 +- .../react-native/React/RCTUIKit/RCTUIView.m | 2 +- .../RCTPlatformDisplayLink.h | 12 -------- .../RCTUIAccessibilityTraits.h | 12 -------- .../RCTUIActivityIndicatorView.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIGeometry.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIGraphics.h | 12 -------- .../RCTUIGraphicsImageRenderer.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIImage.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIImageView.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIKit.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIKitCompat.h | 12 -------- .../React/RCTUIKitForwarding/RCTUILabel.h | 12 -------- .../RCTUIKitForwarding/RCTUIScrollView.h | 12 -------- .../React/RCTUIKitForwarding/RCTUISlider.h | 12 -------- .../React/RCTUIKitForwarding/RCTUISwitch.h | 12 -------- .../React/RCTUIKitForwarding/RCTUITouch.h | 12 -------- .../React/RCTUIKitForwarding/RCTUIView.h | 12 -------- .../scripts/ios-prebuild/setup.js | 3 -- 40 files changed, 55 insertions(+), 232 deletions(-) create mode 100644 packages/react-native/React/RCTPlatformDisplayLink.h create mode 100644 packages/react-native/React/RCTUIKit.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h delete mode 100644 packages/react-native/React/RCTUIKitForwarding/RCTUIView.h diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index 6c17c1e751b4..d27caa9860ef 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -365,7 +365,7 @@ let reactCore = RNTarget( "ReactCommon/react/runtime/platform/ios", // explicit header search path to break circular dependency. RCTHost imports `RCTDefines.h` in ReactCore, ReacCore needs to import RCTHost ], linkedFrameworks: ["CoreServices"], - excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules", "RCTUIKit", "RCTUIKitForwarding"], // [macOS] + excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules", "RCTUIKit"], // [macOS] dependencies: [.reactNativeDependencies, .reactCxxReact, .reactPerfLogger, .jsi, .reactJsiExecutor, .reactUtils, .reactFeatureFlags, .reactRuntimeScheduler, .yoga, .reactJsInspector, .reactJsiTooling, .rctDeprecation, .reactCoreRCTWebsocket, .reactRCTImage, .reactTurboModuleCore, .reactRCTText, .reactRCTBlob, .reactRCTAnimation, .reactRCTNetwork, .reactFabric, .hermesPrebuilt, .reactRCTUIKit], // [macOS] sources: [".", "Runtime/RCTHermesInstanceFactory.mm"] ) diff --git a/packages/react-native/React/RCTPlatformDisplayLink.h b/packages/react-native/React/RCTPlatformDisplayLink.h new file mode 100644 index 000000000000..4ce00189fafc --- /dev/null +++ b/packages/react-native/React/RCTPlatformDisplayLink.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Compatibility header for existing consumers. +#import diff --git a/packages/react-native/React/RCTUIKit.h b/packages/react-native/React/RCTUIKit.h new file mode 100644 index 000000000000..f3493874b12d --- /dev/null +++ b/packages/react-native/React/RCTUIKit.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// [macOS] Compatibility umbrella for existing consumers. +#import diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h index 0ee4efb9904b..cde8c42aa013 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX @compatibility_alias RCTUIActivityIndicatorView UIActivityIndicatorView; diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m index e1fe4d027619..c5361f69db83 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUIActivityIndicatorView.h" #import #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphics.m b/packages/react-native/React/RCTUIKit/RCTUIGraphics.m index 45e35c64716a..0d70952634e2 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphics.m +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphics.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUIGraphics.h" #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h index 233e7f7ac5a0..2b199656d571 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIImage.h" #if !TARGET_OS_OSX diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m index 3ba92e07e373..54e82e756504 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m +++ b/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m @@ -9,8 +9,8 @@ #if TARGET_OS_OSX -#import -#import +#import "RCTUIGraphicsImageRenderer.h" +#import "RCTUIImage.h" @implementation RCTUIGraphicsImageRendererFormat diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.h b/packages/react-native/React/RCTUIKit/RCTUIImage.h index be32ab557653..017828dbca8a 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImage.h +++ b/packages/react-native/React/RCTUIKit/RCTUIImage.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.m b/packages/react-native/React/RCTUIKit/RCTUIImage.m index 185ed9f16326..b6e7cce97f68 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImage.m +++ b/packages/react-native/React/RCTUIKit/RCTUIImage.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUIImage.h" // UIImage diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.h b/packages/react-native/React/RCTUIKit/RCTUIImageView.h index ef16661faaa8..10bce6d413a2 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImageView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIImageView.h @@ -11,8 +11,8 @@ #include -#import -#import +#import "RCTUIKitCompat.h" +#import "RCTUIImage.h" #if !TARGET_OS_OSX @compatibility_alias RCTUIImageView UIImageView; diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.m b/packages/react-native/React/RCTUIKit/RCTUIImageView.m index e3bc13420c14..e9899e969acd 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIImageView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIImageView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUIImageView.h" #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIKit.h b/packages/react-native/React/RCTUIKit/RCTUIKit.h index 77549666d7f0..eccebc648400 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIKit.h +++ b/packages/react-native/React/RCTUIKit/RCTUIKit.h @@ -8,18 +8,18 @@ // [macOS] // Umbrella header for RCTUIKit — the UIKit/AppKit compatibility layer. -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "RCTUIKitCompat.h" +#import "RCTUIAccessibilityTraits.h" +#import "RCTUIGeometry.h" +#import "RCTUIGraphics.h" +#import "RCTUIImage.h" +#import "RCTUIView.h" +#import "RCTUIScrollView.h" +#import "RCTUISlider.h" +#import "RCTUILabel.h" +#import "RCTUISwitch.h" +#import "RCTUIActivityIndicatorView.h" +#import "RCTUITouch.h" +#import "RCTUIImageView.h" +#import "RCTUIGraphicsImageRenderer.h" +#import "RCTPlatformDisplayLink.h" diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.h b/packages/react-native/React/RCTUIKit/RCTUILabel.h index 522355ab27f7..963bf771d464 100644 --- a/packages/react-native/React/RCTUIKit/RCTUILabel.h +++ b/packages/react-native/React/RCTUIKit/RCTUILabel.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX @compatibility_alias RCTUILabel UILabel; diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.m b/packages/react-native/React/RCTUIKit/RCTUILabel.m index 2a6452bcd0f5..919eb5641868 100644 --- a/packages/react-native/React/RCTUIKit/RCTUILabel.m +++ b/packages/react-native/React/RCTUIKit/RCTUILabel.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUILabel.h" @implementation RCTUILabel {} diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.h b/packages/react-native/React/RCTUIKit/RCTUIScrollView.h index 021acab02d58..ae7f5b972cf1 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIScrollView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIScrollView.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.m b/packages/react-native/React/RCTUIKit/RCTUIScrollView.m index c9448f1c73fc..d55eac9995d8 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIScrollView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIScrollView.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUIScrollView.h" // RCTUIScrollView diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.h b/packages/react-native/React/RCTUIKit/RCTUISlider.h index 84d24facb260..91f5c0557071 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISlider.h +++ b/packages/react-native/React/RCTUIKit/RCTUISlider.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX @compatibility_alias RCTUISlider UISlider; diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.m b/packages/react-native/React/RCTUIKit/RCTUISlider.m index 99a3bb494ce9..69dce14cae41 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISlider.m +++ b/packages/react-native/React/RCTUIKit/RCTUISlider.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUISlider.h" @implementation RCTUISlider {} diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.h b/packages/react-native/React/RCTUIKit/RCTUISwitch.h index f818a3e1b879..18f139f4f4f4 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISwitch.h +++ b/packages/react-native/React/RCTUIKit/RCTUISwitch.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX @compatibility_alias RCTUISwitch UISwitch; diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.m b/packages/react-native/React/RCTUIKit/RCTUISwitch.m index 412a8b34eaca..6fb9acae34bb 100644 --- a/packages/react-native/React/RCTUIKit/RCTUISwitch.m +++ b/packages/react-native/React/RCTUIKit/RCTUISwitch.m @@ -9,7 +9,7 @@ #if TARGET_OS_OSX -#import +#import "RCTUISwitch.h" @implementation RCTUISwitch diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.h b/packages/react-native/React/RCTUIKit/RCTUIView.h index 8ebd06218cd6..76a97c0994da 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIView.h +++ b/packages/react-native/React/RCTUIKit/RCTUIView.h @@ -11,7 +11,7 @@ #include -#import +#import "RCTUIKitCompat.h" #if !TARGET_OS_OSX #import diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.m b/packages/react-native/React/RCTUIKit/RCTUIView.m index 96f84d550b0b..19528853dd6e 100644 --- a/packages/react-native/React/RCTUIKit/RCTUIView.m +++ b/packages/react-native/React/RCTUIKit/RCTUIView.m @@ -10,7 +10,7 @@ #if TARGET_OS_OSX #import -#import +#import "RCTUIView.h" // UIView diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h b/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h deleted file mode 100644 index 9c6d7a60eacd..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTPlatformDisplayLink.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h deleted file mode 100644 index ec13f93cb8c2..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIAccessibilityTraits.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h deleted file mode 100644 index 91717d8850d5..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIActivityIndicatorView.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h deleted file mode 100644 index b3682eaf823f..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIGeometry.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h deleted file mode 100644 index 996bf00c1f3c..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphics.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h deleted file mode 100644 index 1815d3df4b02..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIGraphicsImageRenderer.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h deleted file mode 100644 index ae0a933d31d7..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIImage.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h deleted file mode 100644 index 47a9c3e5e2be..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIImageView.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h deleted file mode 100644 index 0a6603d21ec4..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIKit.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h deleted file mode 100644 index d4d788c35a4a..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIKitCompat.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h b/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h deleted file mode 100644 index 6ece08180771..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUILabel.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h deleted file mode 100644 index 10df1187fd3f..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIScrollView.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h b/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h deleted file mode 100644 index ccafaa382bf1..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUISlider.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h b/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h deleted file mode 100644 index 7197a3b52f2e..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUISwitch.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h b/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h deleted file mode 100644 index fa3235f68cb9..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUITouch.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h b/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h deleted file mode 100644 index e5b3f59aec2e..000000000000 --- a/packages/react-native/React/RCTUIKitForwarding/RCTUIView.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// [macOS] Forwarding header: RCTUIKit lives in the React-RCTUIKit pod (module -// React_RCTUIKit), but is imported throughout as . This alias keeps -// those imports working under use_frameworks! by re-exporting the (modular) -// React_RCTUIKit header. Under static libraries it resolves the same way. -#import diff --git a/packages/react-native/scripts/ios-prebuild/setup.js b/packages/react-native/scripts/ios-prebuild/setup.js index 4f16a8dbb0e2..c2cd31e65460 100644 --- a/packages/react-native/scripts/ios-prebuild/setup.js +++ b/packages/react-native/scripts/ios-prebuild/setup.js @@ -146,9 +146,6 @@ async function setup( link('Libraries/Settings', 'React'); link('React/RCTUIKit', 'React'); // [macOS] - // [macOS] RCTUIKit's own module namespace, so its internal - // sibling imports resolve in the prebuild the same way consumers do. - link('React/RCTUIKit', 'React_RCTUIKit'); // [macOS] link('Libraries/PushNotificationIOS', 'React'); link('Libraries/Settings', 'React'); link('Libraries/Vibration', 'React'); From 264140696519a274ab9dd4140d1b95b799bea130 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Jul 2026 14:15:06 -0700 Subject: [PATCH 08/11] refactor(macos): move RCTUIKit into ReactApple Move the UIKit/AppKit compatibility layer and its podspec from React/ into ReactApple/Libraries/RCTUIKit, matching ReactApple's ownership convention for Apple-framework libraries. Preserve the existing React-RCTUIKit pod and React_RCTUIKit module names so this commit is path-only from a consumer's perspective. Update CocoaPods discovery, SwiftPM target path, prebuild header staging, React-Core exclusions, and macOS prebuild cache inputs. The two existing compatibility headers remain in React-Core. Verified: static RNTester iOS build succeeds; dynamic build reports zero RCTUIKit missing-header, cyclic-module, or non-modular-header errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/microsoft-prebuild-macos-core.yml | 8 ++++---- packages/react-native/Package.swift | 4 ++-- packages/react-native/React-Core.podspec | 1 - .../Libraries}/RCTUIKit/RCTPlatformDisplayLink.h | 0 .../Libraries}/RCTUIKit/RCTPlatformDisplayLink.m | 0 .../Libraries}/RCTUIKit/RCTUIAccessibilityTraits.h | 0 .../Libraries}/RCTUIKit/RCTUIActivityIndicatorView.h | 0 .../Libraries}/RCTUIKit/RCTUIActivityIndicatorView.m | 0 .../Libraries}/RCTUIKit/RCTUIGeometry.h | 0 .../Libraries}/RCTUIKit/RCTUIGraphics.h | 0 .../Libraries}/RCTUIKit/RCTUIGraphics.m | 0 .../Libraries}/RCTUIKit/RCTUIGraphicsImageRenderer.h | 0 .../Libraries}/RCTUIKit/RCTUIGraphicsImageRenderer.m | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUIImage.h | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUIImage.m | 0 .../Libraries}/RCTUIKit/RCTUIImageView.h | 0 .../Libraries}/RCTUIKit/RCTUIImageView.m | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUIKit.h | 0 .../Libraries}/RCTUIKit/RCTUIKitCompat.h | 0 .../Libraries}/RCTUIKit/RCTUIKitCompat.m | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUILabel.h | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUILabel.m | 0 .../Libraries}/RCTUIKit/RCTUIScrollView.h | 0 .../Libraries}/RCTUIKit/RCTUIScrollView.m | 0 .../Libraries}/RCTUIKit/RCTUISlider.h | 0 .../Libraries}/RCTUIKit/RCTUISlider.m | 0 .../Libraries}/RCTUIKit/RCTUISwitch.h | 0 .../Libraries}/RCTUIKit/RCTUISwitch.m | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUITouch.h | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUIView.h | 0 .../{React => ReactApple/Libraries}/RCTUIKit/RCTUIView.m | 0 .../{React => ReactApple/Libraries}/RCTUIKit/README.md | 0 .../Libraries/RCTUIKit}/React-RCTUIKit.podspec | 8 +++----- packages/react-native/scripts/ios-prebuild/setup.js | 2 +- packages/react-native/scripts/react_native_pods.rb | 2 +- 35 files changed, 11 insertions(+), 14 deletions(-) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTPlatformDisplayLink.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTPlatformDisplayLink.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIAccessibilityTraits.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIActivityIndicatorView.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIActivityIndicatorView.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIGeometry.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIGraphics.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIGraphics.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIGraphicsImageRenderer.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIGraphicsImageRenderer.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIImage.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIImage.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIImageView.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIImageView.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIKit.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIKitCompat.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIKitCompat.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUILabel.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUILabel.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIScrollView.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIScrollView.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUISlider.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUISlider.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUISwitch.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUISwitch.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUITouch.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIView.h (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/RCTUIView.m (100%) rename packages/react-native/{React => ReactApple/Libraries}/RCTUIKit/README.md (100%) rename packages/react-native/{ => ReactApple/Libraries/RCTUIKit}/React-RCTUIKit.podspec (84%) diff --git a/.github/workflows/microsoft-prebuild-macos-core.yml b/.github/workflows/microsoft-prebuild-macos-core.yml index 878678e7efef..14c249919ebf 100644 --- a/.github/workflows/microsoft-prebuild-macos-core.yml +++ b/.github/workflows/microsoft-prebuild-macos-core.yml @@ -27,7 +27,7 @@ jobs: id: cache-slice uses: actions/cache/restore@v4 with: - key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} + key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactApple/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} path: | packages/react-native/.build/output/spm/Debug/Build/Products packages/react-native/.build/headers @@ -72,7 +72,7 @@ jobs: if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/') && endsWith(github.ref, '-stable') }} uses: actions/cache/save@v4 with: - key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} + key: v1-macos-core-${{ matrix.platform }}-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactApple/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} path: | packages/react-native/.build/output/spm/Debug/Build/Products packages/react-native/.build/headers @@ -104,7 +104,7 @@ jobs: id: cache-xcframework uses: actions/cache/restore@v4 with: - key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} + key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactApple/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} path: | packages/react-native/.build/output/xcframeworks/ReactCoreDebug.xcframework.tar.gz packages/react-native/.build/output/xcframeworks/ReactCoreDebug.framework.dSYM.tar.gz @@ -165,7 +165,7 @@ jobs: if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/') && endsWith(github.ref, '-stable') }} uses: actions/cache/save@v4 with: - key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} + key: v1-macos-core-xcframework-Debug-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactApple/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }} path: | packages/react-native/.build/output/xcframeworks/ReactCoreDebug.xcframework.tar.gz packages/react-native/.build/output/xcframeworks/ReactCoreDebug.framework.dSYM.tar.gz diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index d27caa9860ef..9d71bf93db8a 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -365,7 +365,7 @@ let reactCore = RNTarget( "ReactCommon/react/runtime/platform/ios", // explicit header search path to break circular dependency. RCTHost imports `RCTDefines.h` in ReactCore, ReacCore needs to import RCTHost ], linkedFrameworks: ["CoreServices"], - excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules", "RCTUIKit"], // [macOS] + excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules"], // [macOS] dependencies: [.reactNativeDependencies, .reactCxxReact, .reactPerfLogger, .jsi, .reactJsiExecutor, .reactUtils, .reactFeatureFlags, .reactRuntimeScheduler, .yoga, .reactJsInspector, .reactJsiTooling, .rctDeprecation, .reactCoreRCTWebsocket, .reactRCTImage, .reactTurboModuleCore, .reactRCTText, .reactRCTBlob, .reactRCTAnimation, .reactRCTNetwork, .reactFabric, .hermesPrebuilt, .reactRCTUIKit], // [macOS] sources: [".", "Runtime/RCTHermesInstanceFactory.mm"] ) @@ -543,7 +543,7 @@ let reactSettings = RNTarget( /// UIKit/AppKit compatibility layer for React Native macOS. let reactRCTUIKit = RNTarget( name: .reactRCTUIKit, - path: "React/RCTUIKit", + path: "ReactApple/Libraries/RCTUIKit", // [macOS: UIKit on iOS/visionOS, AppKit on macOS platformLinkerSettings: [ .linkedFramework("UIKit", .when(platforms: [.iOS, .visionOS])), diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index a6c86283454a..0f9bd6d34914 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -75,7 +75,6 @@ Pod::Spec.new do |s| "React/Tests/**/*", "React/Inspector/**/*", "React/Runtime/**/*", - "React/RCTUIKit/**/*", # [macOS] ] # The default is use hermes, we don't have jsc installed diff --git a/packages/react-native/React/RCTUIKit/RCTPlatformDisplayLink.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTPlatformDisplayLink.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTPlatformDisplayLink.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTPlatformDisplayLink.h diff --git a/packages/react-native/React/RCTUIKit/RCTPlatformDisplayLink.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTPlatformDisplayLink.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTPlatformDisplayLink.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTPlatformDisplayLink.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIAccessibilityTraits.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIAccessibilityTraits.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIAccessibilityTraits.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIAccessibilityTraits.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIActivityIndicatorView.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIActivityIndicatorView.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIActivityIndicatorView.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIActivityIndicatorView.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIActivityIndicatorView.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIGeometry.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGeometry.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIGeometry.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGeometry.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphics.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphics.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIGraphics.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphics.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphics.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphics.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIGraphics.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphics.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphicsImageRenderer.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphicsImageRenderer.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphicsImageRenderer.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIGraphicsImageRenderer.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIGraphicsImageRenderer.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImage.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIImage.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImage.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIImage.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImage.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIImage.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImage.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImageView.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIImageView.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImageView.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIImageView.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImageView.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIImageView.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIImageView.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIKit.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKit.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIKit.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKit.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIKitCompat.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIKitCompat.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIKitCompat.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIKitCompat.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.m diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUILabel.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUILabel.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUILabel.h diff --git a/packages/react-native/React/RCTUIKit/RCTUILabel.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUILabel.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUILabel.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUILabel.m diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIScrollView.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIScrollView.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIScrollView.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIScrollView.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIScrollView.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIScrollView.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIScrollView.m diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISlider.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUISlider.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISlider.h diff --git a/packages/react-native/React/RCTUIKit/RCTUISlider.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISlider.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUISlider.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISlider.m diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISwitch.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUISwitch.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISwitch.h diff --git a/packages/react-native/React/RCTUIKit/RCTUISwitch.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISwitch.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUISwitch.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUISwitch.m diff --git a/packages/react-native/React/RCTUIKit/RCTUITouch.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUITouch.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUITouch.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUITouch.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIView.h similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIView.h rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIView.h diff --git a/packages/react-native/React/RCTUIKit/RCTUIView.m b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIView.m similarity index 100% rename from packages/react-native/React/RCTUIKit/RCTUIView.m rename to packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIView.m diff --git a/packages/react-native/React/RCTUIKit/README.md b/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md similarity index 100% rename from packages/react-native/React/RCTUIKit/README.md rename to packages/react-native/ReactApple/Libraries/RCTUIKit/README.md diff --git a/packages/react-native/React-RCTUIKit.podspec b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec similarity index 84% rename from packages/react-native/React-RCTUIKit.podspec rename to packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec index fe4da7e801cc..4316882ea01f 100644 --- a/packages/react-native/React-RCTUIKit.podspec +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec @@ -5,7 +5,7 @@ require "json" -package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) version = package['version'] source = { :git => 'https://github.com/facebook/react-native.git' } @@ -25,10 +25,8 @@ Pod::Spec.new do |s| s.author = "Microsoft Corporation" s.platforms = min_supported_versions s.source = source - s.source_files = podspec_sources( - ["React/RCTUIKit/*.{h,m}"], - "React/RCTUIKit/*.h") - s.public_header_files = "React/RCTUIKit/*.h" + s.source_files = podspec_sources("*.{h,m}", "*.h") + s.public_header_files = "*.h" s.header_dir = "React_RCTUIKit" # [macOS] Own namespace so resolves consistently (static + frameworks); React-Core vends forwarding aliases s.module_name = "React_RCTUIKit" s.pod_target_xcconfig = { diff --git a/packages/react-native/scripts/ios-prebuild/setup.js b/packages/react-native/scripts/ios-prebuild/setup.js index c2cd31e65460..655e01c3bfe9 100644 --- a/packages/react-native/scripts/ios-prebuild/setup.js +++ b/packages/react-native/scripts/ios-prebuild/setup.js @@ -145,7 +145,7 @@ async function setup( link('Libraries/LinkingIOS', 'React'); link('Libraries/Settings', 'React'); - link('React/RCTUIKit', 'React'); // [macOS] + link('ReactApple/Libraries/RCTUIKit', 'React'); // [macOS] link('Libraries/PushNotificationIOS', 'React'); link('Libraries/Settings', 'React'); link('Libraries/Vibration', 'React'); diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index aca3c6c6361f..f7a278c3439a 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -132,7 +132,7 @@ def use_react_native! ( if !ReactNativeCoreUtils.build_rncore_from_source() pod 'React-Core-prebuilt', :podspec => "#{prefix}/React-Core-prebuilt.podspec", :modular_headers => true end - pod 'React-RCTUIKit', :path => "#{prefix}/" + pod 'React-RCTUIKit', :path => "#{prefix}/ReactApple/Libraries/RCTUIKit" pod 'React-Core', :path => "#{prefix}/" pod 'React-CoreModules', :path => "#{prefix}/React/CoreModules" pod 'React-RCTRuntime', :path => "#{prefix}/React/Runtime" From 19d51ca33625455087635bc5de3e39b716854925 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Jul 2026 14:27:24 -0700 Subject: [PATCH 09/11] refactor(macos): rename the RCTUIKit module Rename the canonical CocoaPods and SwiftPM module from React_RCTUIKit to RCTUIKit, matching Apple framework casing and the new ReactApple ownership. Keep the React-RCTUIKit pod name unchanged for dependency compatibility. Update the two established React compatibility entry points to forward to , and stage headers under both React (legacy) and RCTUIKit (canonical) in the prebuild header layout. Document the canonical import in the library README. Verified: static RNTester iOS build succeeds; dynamic builds expose RCTUIKit.framework/Headers/RCTUIKit.h with zero RCTUIKit missing-header, cyclic-module, or non-modular-header errors. Direct SwiftPM validation is deferred to required prebuild CI because local binary artifacts are absent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/Package.swift | 2 +- packages/react-native/React/RCTPlatformDisplayLink.h | 2 +- packages/react-native/React/RCTUIKit.h | 2 +- .../react-native/ReactApple/Libraries/RCTUIKit/README.md | 6 +++++- .../ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec | 4 ++-- packages/react-native/scripts/ios-prebuild/setup.js | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index 9d71bf93db8a..a100a553830c 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -786,7 +786,7 @@ extension String { static let reactNativeModuleDom = "React-domnativemodule" static let reactAppDelegate = "React-RCTAppDelegate" static let reactSettings = "React-RCTSettings" - static let reactRCTUIKit = "React-RCTUIKit" // [macOS] + static let reactRCTUIKit = "RCTUIKit" // [macOS] } func relativeSearchPath(_ depth: Int, _ path: String) -> String { diff --git a/packages/react-native/React/RCTPlatformDisplayLink.h b/packages/react-native/React/RCTPlatformDisplayLink.h index 4ce00189fafc..414c4c5ad726 100644 --- a/packages/react-native/React/RCTPlatformDisplayLink.h +++ b/packages/react-native/React/RCTPlatformDisplayLink.h @@ -6,4 +6,4 @@ */ // [macOS] Compatibility header for existing consumers. -#import +#import diff --git a/packages/react-native/React/RCTUIKit.h b/packages/react-native/React/RCTUIKit.h index f3493874b12d..fa1e198bf5cb 100644 --- a/packages/react-native/React/RCTUIKit.h +++ b/packages/react-native/React/RCTUIKit.h @@ -6,4 +6,4 @@ */ // [macOS] Compatibility umbrella for existing consumers. -#import +#import diff --git a/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md b/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md index 2831f17949f5..80dd8f080f1e 100644 --- a/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md @@ -11,6 +11,10 @@ codebase use UIKit-style types and APIs on both iOS and macOS by providing: - **UIKit → AppKit shims** — Constants, enums, notifications, and font defines that let code written against UIKit compile on macOS without `#if` guards everywhere. +The canonical module is `RCTUIKit`; import its umbrella as ``. Existing +`` and `` imports remain available as +compatibility entry points. + ## Naming convention: `RCTUI` vs `RCTPlatform` There are two prefixes used in this layer, and the distinction matters: @@ -41,4 +45,4 @@ For backward compatibility, the old `RCTUI` names still exist as aliases for the that were moved to `RCTPlatform`: `RCTUIColor`, `RCTUIPanGestureRecognizer`, `RCTUIApplication`. The `.m` files are wrapped in `#if TARGET_OS_OSX ... #endif` since they only contain macOS -implementations. \ No newline at end of file +implementations. diff --git a/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec index 4316882ea01f..5ecb507da30c 100644 --- a/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec @@ -27,8 +27,8 @@ Pod::Spec.new do |s| s.source = source s.source_files = podspec_sources("*.{h,m}", "*.h") s.public_header_files = "*.h" - s.header_dir = "React_RCTUIKit" # [macOS] Own namespace so resolves consistently (static + frameworks); React-Core vends forwarding aliases - s.module_name = "React_RCTUIKit" + s.header_dir = "RCTUIKit" + s.module_name = "RCTUIKit" s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), diff --git a/packages/react-native/scripts/ios-prebuild/setup.js b/packages/react-native/scripts/ios-prebuild/setup.js index 655e01c3bfe9..6c6bed31481c 100644 --- a/packages/react-native/scripts/ios-prebuild/setup.js +++ b/packages/react-native/scripts/ios-prebuild/setup.js @@ -146,6 +146,7 @@ async function setup( link('Libraries/Settings', 'React'); link('ReactApple/Libraries/RCTUIKit', 'React'); // [macOS] + link('ReactApple/Libraries/RCTUIKit', 'RCTUIKit'); // [macOS] link('Libraries/PushNotificationIOS', 'React'); link('Libraries/Settings', 'React'); link('Libraries/Vibration', 'React'); From 05db3d73f94589eab1b3fe00847cc8dca8e46c6c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Fri, 10 Jul 2026 17:57:39 -0700 Subject: [PATCH 10/11] refactor(macos): minimize dynamic-framework fork diffs Remove the broad ReactCommon podspec and shared CocoaPods utility changes from this PR. They restructured upstream-owned code to make the nonblocking dynamic canary progress further, but are not required for the core fixes. Keep the multi-platform framework workaround local to RNTester: declare RN_PLATFORMS before podspec evaluation and set SUPPORTED_PLATFORMS on generated pod targets in its post_install hook. This still prevents Hermes duplicate-output collisions without adding fork behavior to shared React Native CocoaPods code. Also add the required macOS diff tags to the Folly source addition, moved RCTUIKit podspec/README, RNTester block, and moved pod path. Verified: static RNTester iOS succeeds; dynamic has no duplicate-output or RCTUIKit missing/cyclic/non-modular errors (remaining gaps stay nonblocking). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ReactApple/Libraries/RCTUIKit/README.md | 2 + .../Libraries/RCTUIKit/React-RCTUIKit.podspec | 2 + .../ReactCommon/React-Fabric.podspec | 1 - .../ReactCommon/ReactCommon.podspec | 8 +-- .../cxxreact/React-cxxreact.podspec | 7 +- .../ios/React-NativeModulesApple.podspec | 6 +- .../scripts/cocoapods/__tests__/utils-test.rb | 66 ------------------- .../react-native/scripts/cocoapods/utils.rb | 37 +---------- .../react-native/scripts/react_native_pods.rb | 3 +- .../third-party-podspecs/RCT-Folly.podspec | 2 +- packages/rn-tester/Podfile | 30 +++++++-- 11 files changed, 36 insertions(+), 128 deletions(-) diff --git a/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md b/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md index 80dd8f080f1e..aff6fba6eeb4 100644 --- a/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/README.md @@ -1,5 +1,7 @@ # RCTUIKit + + RCTUIKit is a UIKit/AppKit compatibility layer for React Native macOS. It lets the rest of the codebase use UIKit-style types and APIs on both iOS and macOS by providing: diff --git a/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec index 5ecb507da30c..8c5f0e5a2186 100644 --- a/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/React-RCTUIKit.podspec @@ -3,6 +3,8 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# [macOS] + require "json" package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 15ed91e40078..3083472b8038 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -89,7 +89,6 @@ Pod::Spec.new do |s| "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/text/platform/cxx\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/textinput/platform/ios\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/view/platform/cxx\"", - "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/view/platform/macos\"", # [macOS] macos view files are compiled on all platforms; expose their headers (e.g. KeyEvent.h) ] end diff --git a/packages/react-native/ReactCommon/ReactCommon.podspec b/packages/react-native/ReactCommon/ReactCommon.podspec index 23eb03ac668e..345d97686fe6 100644 --- a/packages/react-native/ReactCommon/ReactCommon.podspec +++ b/packages/react-native/ReactCommon/ReactCommon.podspec @@ -63,13 +63,7 @@ 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") - # [macOS] Generate per-platform-suffixed framework header search paths so headers - # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. - core_framework_header_search_paths = ["\"$(PODS_TARGET_SRCROOT)/ReactCommon\""] - .concat(create_header_search_path_for_frameworks("React-debug", framework_name: "React_debug").map { |search_path| "\"#{search_path}\"" }) - .concat(create_header_search_path_for_frameworks("React-featureflags", framework_name: "React_featureflags").map { |search_path| "\"#{search_path}\"" }) - .concat(create_header_search_path_for_frameworks("React-utils", framework_name: "React_utils").map { |search_path| "\"#{search_path}\"" }) - sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => core_framework_header_search_paths.join(" ") } + 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.dependency "React-debug", version sss.dependency "React-featureflags", version sss.dependency "React-utils", version diff --git a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec index 58c02a19663d..127dc2cec705 100644 --- a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec @@ -28,13 +28,8 @@ Pod::Spec.new do |s| s.platforms = min_supported_versions s.source = source s.source_files = podspec_sources("*.{cpp,h}", "*.h") - # [macOS] Generate per-platform-suffixed framework header search paths so headers - # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. - cxxreact_framework_header_search_paths = create_header_search_path_for_frameworks("React-debug", framework_name: "React_debug") - .concat(create_header_search_path_for_frameworks("React-runtimeexecutor", framework_name: "React_runtimeexecutor")) - .map { |search_path| "\"#{search_path}\"" } s.pod_target_xcconfig = { - "HEADER_SEARCH_PATHS" => cxxreact_framework_header_search_paths.join(" "), + "HEADER_SEARCH_PATHS" => "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"", "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() } s.header_dir = "cxxreact" diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec index 200e217ecfcc..edc219a3d516 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec @@ -27,11 +27,7 @@ Pod::Spec.new do |s| s.author = "Meta Platforms, Inc. and its affiliates" s.platforms = min_supported_versions s.source = source - # [macOS] Generate per-platform-suffixed framework header search paths so headers - # resolve in multi-platform (iOS/macOS/visionOS) use_frameworks! workspaces. - nativemodules_header_search_paths = ["\"$(PODS_ROOT)/Headers/Private/React-Core\""] - .concat(create_header_search_path_for_frameworks("React-featureflags", framework_name: "React_featureflags").map { |search_path| "\"#{search_path}\"" }) - s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => nativemodules_header_search_paths.join(" "), + s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_featureflags.framework/Headers\"", "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), "GCC_WARN_PEDANTIC" => "YES" } diff --git a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb index 1397a6fcef87..7ddbbb36e85f 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb @@ -550,72 +550,6 @@ def test_detectUseFrameworks_whenEnvNotSetAndDynamicFrameworks_setEnvVarToDynami assert_equal(ENV['USE_FRAMEWORKS'], 'dynamic') end - # ======================================= # - # Test - Set Supported Platforms # - # ======================================= # - def test_setSupportedPlatformsForFrameworks_whenMultiPlatformFrameworks_setsSupportedPlatformsFromSDKROOT - # Arrange - ENV['USE_FRAMEWORKS'] = 'dynamic' - $RN_PLATFORMS = ['iOS', 'macOS', 'visionOS'] - ios_target = TargetMock.new("hermes-engine-iOS", [ - prepare_config("Debug", {"SDKROOT" => "iphoneos"}), - prepare_config("Release", {"SDKROOT" => "iphoneos"}), - ]) - macos_target = TargetMock.new("hermes-engine-macOS", [ - prepare_config("Debug", {"SDKROOT" => "macosx"}), - ]) - visionos_target = TargetMock.new("hermes-engine-visionOS", [ - prepare_config("Debug", {"SDKROOT" => "xros"}), - ]) - unknown_target = TargetMock.new("SomeHostTool", [ - prepare_config("Debug", {"SDKROOT" => "someunknownsdk"}), - ]) - pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [ios_target, macos_target, visionos_target, unknown_target]) - installer = InstallerMock.new(pods_projects_mock, []) - - # Act - ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) - - # Assert - ios_target.build_configurations.each { |config| assert_equal("iphoneos iphonesimulator", config.build_settings["SUPPORTED_PLATFORMS"]) } - macos_target.build_configurations.each { |config| assert_equal("macosx", config.build_settings["SUPPORTED_PLATFORMS"]) } - visionos_target.build_configurations.each { |config| assert_equal("xros xrsimulator", config.build_settings["SUPPORTED_PLATFORMS"]) } - unknown_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } - assert_equal(1, pods_projects_mock.save_invocation_count) - end - - def test_setSupportedPlatformsForFrameworks_whenNotUsingFrameworks_doesNothing - # Arrange - ENV['USE_FRAMEWORKS'] = nil - $RN_PLATFORMS = ['iOS', 'macOS', 'visionOS'] - macos_target = TargetMock.new("hermes-engine-macOS", [prepare_config("Debug", {"SDKROOT" => "macosx"})]) - pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [macos_target]) - installer = InstallerMock.new(pods_projects_mock, []) - - # Act - ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) - - # Assert - macos_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } - assert_equal(0, pods_projects_mock.save_invocation_count) - end - - def test_setSupportedPlatformsForFrameworks_whenSinglePlatform_doesNothing - # Arrange - ENV['USE_FRAMEWORKS'] = 'dynamic' - $RN_PLATFORMS = ['iOS'] - ios_target = TargetMock.new("hermes-engine-iOS", [prepare_config("Debug", {"SDKROOT" => "iphoneos"})]) - pods_projects_mock = PodsProjectMock.new([], {}, native_targets: [ios_target]) - installer = InstallerMock.new(pods_projects_mock, []) - - # Act - ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) - - # Assert - ios_target.build_configurations.each { |config| assert_nil(config.build_settings["SUPPORTED_PLATFORMS"]) } - assert_equal(0, pods_projects_mock.save_invocation_count) - end - # ============================ # # Test - Update Search Paths # # ============================ # diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 64e920b8136d..53386411a83a 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -378,40 +378,9 @@ def self.set_dynamic_frameworks_flags(installer) end end - # [macOS] When building with `use_frameworks!` in a workspace that targets - # multiple Apple platforms (e.g. RNTester with iOS, macOS and visionOS), every - # per-platform pod target produces a framework with the same product name - # (`hermes.framework`, `React_debug.framework`, ...). CocoaPods does not set - # `SUPPORTED_PLATFORMS` on those targets, so Xcode's implicit dependency - # resolution considers all of them candidates for a given `-framework` flag. - # That pulls the wrong-platform targets into the build, which makes linking - # ambiguous and triggers "Multiple commands produce" errors for the - # hermes-engine build script phases (whose declared output paths are identical - # across platforms). Constraining `SUPPORTED_PLATFORMS` to each target's own - # SDK makes implicit dependency resolution pick the single correct target. - def self.set_supported_platforms_for_frameworks(installer) - return if ENV['USE_FRAMEWORKS'] == nil - - # Only relevant for multi-platform workspaces. $RN_PLATFORMS is set by the - # app's Podfile (see create_header_search_path_for_frameworks). - return if $RN_PLATFORMS == nil || $RN_PLATFORMS.length <= 1 - - sdkroot_to_supported_platforms = { - "iphoneos" => "iphoneos iphonesimulator", - "macosx" => "macosx", - "xros" => "xros xrsimulator", - "appletvos" => "appletvos appletvsimulator", - } - - installer.pods_project.native_targets.each do |target| - target.build_configurations.each do |config| - supported_platforms = sdkroot_to_supported_platforms[config.build_settings["SDKROOT"]] - config.build_settings["SUPPORTED_PLATFORMS"] = supported_platforms if supported_platforms != nil - end - end - - installer.pods_project.save - end + # ========= # + # Utilities # + # ========= # def self.extract_projects(installer) return installer.aggregate_targets diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index f7a278c3439a..34a7287a4e6a 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -132,7 +132,7 @@ def use_react_native! ( if !ReactNativeCoreUtils.build_rncore_from_source() pod 'React-Core-prebuilt', :podspec => "#{prefix}/React-Core-prebuilt.podspec", :modular_headers => true end - pod 'React-RCTUIKit', :path => "#{prefix}/ReactApple/Libraries/RCTUIKit" + pod 'React-RCTUIKit', :path => "#{prefix}/ReactApple/Libraries/RCTUIKit" # [macOS] pod 'React-Core', :path => "#{prefix}/" pod 'React-CoreModules', :path => "#{prefix}/React/CoreModules" pod 'React-RCTRuntime', :path => "#{prefix}/React/Runtime" @@ -495,7 +495,6 @@ def react_native_post_install( ReactNativePodsUtils.set_ccache_compiler_and_linker_build_settings(installer, react_native_path, ccache_enabled) ReactNativePodsUtils.updateOSDeploymentTarget(installer) ReactNativePodsUtils.set_dynamic_frameworks_flags(installer) - ReactNativePodsUtils.set_supported_platforms_for_frameworks(installer) # [macOS] Disambiguate per-platform framework targets in multi-platform workspaces ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer) SPM.apply_on_post_install(installer) diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index 0b9388d6a7aa..b2037aa3ebb0 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -49,7 +49,7 @@ Pod::Spec.new do |spec| 'folly/lang/CString.cpp', 'folly/lang/Exception.cpp', 'folly/memory/ReentrantAllocator.cpp', - 'folly/memory/SanitizeLeak.cpp', + 'folly/memory/SanitizeLeak.cpp', # [macOS] 'folly/memory/detail/MallocImpl.cpp', 'folly/net/NetOps.cpp', 'folly/portability/SysUio.cpp', diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index c2252a2e4f5d..1e4f26472004 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -21,13 +21,11 @@ end prepare_react_native_project! -# [macOS] Declare the platforms this workspace targets *before* any podspecs are -# evaluated. add_dependency() reads $RN_PLATFORMS at podspec-evaluation time to -# generate per-platform framework header search paths (e.g. React-debug-iOS vs -# React-debug-macOS). Setting it only in post_install (which runs later) leaves -# those paths without a platform suffix, breaking header resolution under -# use_frameworks! (e.g. 'react/debug/react_native_assert.h' file not found). +# [macOS +# add_dependency() reads this while evaluating podspecs to generate +# per-platform framework header search paths for this multi-platform workspace. $RN_PLATFORMS = %w[iOS macOS visionOS] +# macOS] IN_CI = ENV['CI'] == 'true' @@ -109,4 +107,24 @@ end post_install do |installer| react_native_post_install(installer, @prefix_path, :mac_catalyst_enabled => false) + + # [macOS + # Disambiguate same-named per-platform framework targets. Without + # SUPPORTED_PLATFORMS, Xcode can pull multiple Hermes targets into one build + # and their script phases declare duplicate outputs. + if USE_FRAMEWORKS + supported_platforms_by_sdk = { + "iphoneos" => "iphoneos iphonesimulator", + "macosx" => "macosx", + "xros" => "xros xrsimulator", + } + installer.pods_project.native_targets.each do |target| + target.build_configurations.each do |config| + supported_platforms = supported_platforms_by_sdk[config.build_settings["SDKROOT"]] + config.build_settings["SUPPORTED_PLATFORMS"] = supported_platforms if supported_platforms + end + end + installer.pods_project.save + end + # macOS] end From 84519500e62fba1aa5b8792cb54d66bef426aed6 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Sat, 11 Jul 2026 02:15:20 -0700 Subject: [PATCH 11/11] chore(macos): remove stale Package.swift diff tag After moving RCTUIKit out of the React target, excludedPaths matches upstream again and no longer needs a macOS diff tag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-native/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index a100a553830c..abc9e915dff0 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -365,7 +365,7 @@ let reactCore = RNTarget( "ReactCommon/react/runtime/platform/ios", // explicit header search path to break circular dependency. RCTHost imports `RCTDefines.h` in ReactCore, ReacCore needs to import RCTHost ], linkedFrameworks: ["CoreServices"], - excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules"], // [macOS] + excludedPaths: ["Fabric", "Tests", "Resources", "Runtime/RCTJscInstanceFactory.mm", "I18n/strings", "CxxBridge/JSCExecutorFactory.mm", "CoreModules"], dependencies: [.reactNativeDependencies, .reactCxxReact, .reactPerfLogger, .jsi, .reactJsiExecutor, .reactUtils, .reactFeatureFlags, .reactRuntimeScheduler, .yoga, .reactJsInspector, .reactJsiTooling, .rctDeprecation, .reactCoreRCTWebsocket, .reactRCTImage, .reactTurboModuleCore, .reactRCTText, .reactRCTBlob, .reactRCTAnimation, .reactRCTNetwork, .reactFabric, .hermesPrebuilt, .reactRCTUIKit], // [macOS] sources: [".", "Runtime/RCTHermesInstanceFactory.mm"] )