From 592d01078479d9e5f193cf861bb29a622d639a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 29 Sep 2026 07:07:00 -0700 Subject: [PATCH 1/2] Use public umbrellas in UIManager headers (#58709) Summary: Migrate React-Fabric mounting headers to consume the RendererCore, Graphics, and Utils stable umbrellas instead of guarded leaf headers. Add the coreUmbrella dependency to the mounting subspec so dynamic-framework consumers receive the owning header. Avoid RendererDebug.h because its eager utility-template exports change downstream overload lookup; RendererCore already provides the debug flags and declaration types used by mounting. Drop the `#ifdef ANDROID` include of `configurePlatformColorCacheInvalidationHook.h` from the Graphics umbrella. The Android `PlatformColorParser.h` already includes it, and the explicit include broke Android builds that use the cxx graphics platform headers, where that header does not exist. Changelog: [Internal] Differential Revision: D121790104 --- packages/react-native/ReactCommon/React-Fabric.podspec | 1 + .../ReactCommon/react/renderer/mounting/Differentiator.h | 2 +- .../react/renderer/mounting/MountingCoordinator.h | 2 +- .../ReactCommon/react/renderer/mounting/ShadowTree.h | 6 ++---- .../react/renderer/mounting/ShadowTreeRegistry.h | 2 +- .../ReactCommon/react/renderer/mounting/ShadowView.h | 9 ++------- .../react/renderer/mounting/internal/CullingContext.h | 3 +-- .../renderer/mounting/internal/ShadowViewNodePair.h | 4 ++-- .../ReactCommon/react/renderer/mounting/stubs/StubView.h | 4 +--- .../ReactCommon/react/renderer/mounting/stubs/stubs.h | 2 +- .../react/renderer/mounting/updateMountedFlag.h | 2 +- 11 files changed, 14 insertions(+), 23 deletions(-) diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 8b84f704eef5..a5033590847d 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -209,6 +209,7 @@ Pod::Spec.new do |s| end s.subspec "mounting" do |ss| + ss.dependency "React-Fabric/coreUmbrella" ss.dependency "React-jsinspectortracing" ss.source_files = podspec_sources("react/renderer/mounting/**/*.{m,mm,cpp,h}", "react/renderer/mounting/**/*.h") ss.exclude_files = "react/renderer/mounting/tests" diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h index e0ecb4cfca52..8ba9f99c64d0 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h @@ -9,7 +9,7 @@ #include -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h index 561a74b8292b..c520508cb06b 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h index 4eeb85abceea..457f9a56e3a2 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h @@ -13,14 +13,12 @@ #include #include +#include +#include #include -#include -#include -#include #include #include #include -#include #include "MountingOverrideDelegate.h" namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.h b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.h index bfe843ebf8f4..d65974423565 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowView.h b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowView.h index e9a51fdf8363..e0dd7d4afc3a 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowView.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowView.h @@ -9,13 +9,8 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/internal/CullingContext.h b/packages/react-native/ReactCommon/react/renderer/mounting/internal/CullingContext.h index 1057b7ab5384..30cc5f4792b1 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/internal/CullingContext.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/internal/CullingContext.h @@ -9,8 +9,7 @@ #include -#include -#include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h b/packages/react-native/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h index 899deb527034..a5904bb32f8d 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/internal/ShadowViewNodePair.h @@ -9,8 +9,8 @@ #include -#include -#include +#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubView.h b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubView.h index ffd166a0b0dc..c6507521e5ec 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubView.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubView.h @@ -12,9 +12,7 @@ #include #include -#include -#include -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.h b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.h index cd5199c03b34..3948aa4eefcd 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.h @@ -9,7 +9,7 @@ #include -#include +#include #include #include diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/updateMountedFlag.h b/packages/react-native/ReactCommon/react/renderer/mounting/updateMountedFlag.h index 0f8f8b968758..4ce08d2288a3 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/updateMountedFlag.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/updateMountedFlag.h @@ -9,7 +9,7 @@ #include -#include +#include #include namespace facebook::react { From 67b07f8c1293238a7962c4a7f196e18db5ca5151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 29 Sep 2026 07:07:00 -0700 Subject: [PATCH 2/2] Use public umbrellas in attributedstring headers Summary: Migrate React-Fabric attributedstring headers to consume stable Debug, FeatureFlags, CSS, Graphics, MapBuffer, RendererCore, Utils, and View umbrellas instead of guarded leaf headers. Add the direct Buck and CocoaPods dependencies required by those public imports. Avoid RendererDebug.h because its current utility-template export changes downstream overload lookup; RendererCore already provides the debug declaration types used by attributedstring. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D121793359 --- packages/react-native/React/Base/RCTUtils.mm | 9 +++++---- .../ReactCommon/React-Fabric.podspec | 3 +++ .../attributedstring/AttributedString.h | 5 ++--- .../attributedstring/AttributedStringBox.h | 1 + .../attributedstring/ParagraphAttributes.h | 6 +++--- .../attributedstring/TextAttributes.h | 12 ++++------- .../renderer/attributedstring/conversions.h | 20 ++++++------------- .../renderer/graphics/HostPlatformColor.mm | 8 +++++--- .../textlayoutmanager/RCTTextLayoutManager.mm | 5 +++-- 9 files changed, 32 insertions(+), 37 deletions(-) diff --git a/packages/react-native/React/Base/RCTUtils.mm b/packages/react-native/React/Base/RCTUtils.mm index 04f4e4ed3911..21ddfb6ff1f2 100644 --- a/packages/react-native/React/Base/RCTUtils.mm +++ b/packages/react-native/React/Base/RCTUtils.mm @@ -13,6 +13,7 @@ #import #import #import +#import #import #import @@ -437,20 +438,20 @@ CGSize RCTSwitchSize(void) CGFloat RCTRoundPixelValue(CGFloat value) { CGFloat scale = RCTScreenScale(); - return round(value * scale) / scale; + return std::round(value * scale) / scale; } CGFloat RCTCeilPixelValue(CGFloat value) { CGFloat scale = RCTScreenScale(); - return ceil(value * scale) / scale; + return std::ceil(value * scale) / scale; } CGSize RCTSizeInPixels(CGSize pointSize, CGFloat scale) { return (CGSize){ - ceil(pointSize.width * scale), - ceil(pointSize.height * scale), + std::ceil(pointSize.width * scale), + std::ceil(pointSize.height * scale), }; } diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index a5033590847d..81971b33ae6b 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -77,6 +77,9 @@ Pod::Spec.new do |s| end s.subspec "attributedstring" do |ss| + ss.dependency "React-Fabric/coreUmbrella" + ss.dependency "React-Fabric/components/viewUmbrella" + ss.dependency "React-renderercss" ss.source_files = podspec_sources("react/renderer/attributedstring/**/*.{m,mm,cpp,h}", "react/renderer/attributedstring/**/*.{h}") ss.exclude_files = "react/renderer/attributedstring/tests" ss.header_dir = "react/renderer/attributedstring" diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedString.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedString.h index f1cdbe4181cb..4913f3583704 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedString.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedString.h @@ -9,11 +9,10 @@ #include +#include +#include #include -#include -#include #include -#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h index 4c9471bde5cf..077bf846c34d 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/AttributedStringBox.h @@ -11,6 +11,7 @@ #include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h index 7cd8252d7c8f..f9385bebe811 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h @@ -11,10 +11,10 @@ #include +#include +#include +#include #include -#include -#include -#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h index bcf902f9093a..9f9fdb02b824 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h @@ -14,16 +14,12 @@ #include #include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h index e77b21d33653..bdc5258a8664 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h @@ -9,28 +9,20 @@ #include -#include -#include +#include +#include +#include +#include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #ifdef RN_SERIALIZABLE_STATE +#include #include -#include -#include #endif #include diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm b/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm index e47deaa95cf6..1fc1a37068bf 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +++ b/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm @@ -12,6 +12,7 @@ #import #import #import +#import #import using namespace facebook::react; @@ -86,9 +87,10 @@ bool UIColorIsP3ColorSpace(const std::shared_ptr &uiColor) int32_t ColorFromColorComponents(const facebook::react::ColorComponents &components) { float ratio = 255; - auto color = ((int32_t)round((float)components.alpha * ratio) & 0xff) << 24 | - ((int)round((float)components.red * ratio) & 0xff) << 16 | - ((int)round((float)components.green * ratio) & 0xff) << 8 | ((int)round((float)components.blue * ratio) & 0xff); + auto color = ((int32_t)std::round((float)components.alpha * ratio) & 0xff) << 24 | + ((int)std::round((float)components.red * ratio) & 0xff) << 16 | + ((int)std::round((float)components.green * ratio) & 0xff) << 8 | + ((int)std::round((float)components.blue * ratio) & 0xff); return color; } diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm index af5b225e8e7e..3e5bfd528320 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm @@ -8,6 +8,7 @@ #import "RCTTextLayoutManager.h" #import +#import #import "RCTAttributedTextUtils.h" @@ -186,8 +187,8 @@ - (void)drawAttributedString:(AttributedString)attributedString // remains visible at small sizes and proportionate at // large ones. ~`fontSize / 12` plus a 1.5pt floor. CGFloat thickness = MAX(fontSize / 12.0f, 1.5f); - CGFloat wavyWavelength = 1.0f + 2.0f * round(2.0f * thickness + 0.5f); - CGFloat wavyCpDistance = 0.5f + round(3.0f * thickness + 0.5f); + CGFloat wavyWavelength = 1.0f + 2.0f * std::round(2.0f * thickness + 0.5f); + CGFloat wavyCpDistance = 0.5f + std::round(3.0f * thickness + 0.5f); NSRange targetGlyphRange = [layoutManager glyphRangeForCharacterRange:attrRange actualCharacterRange:nullptr];