Skip to content

Commit 6359bb6

Browse files
j-piaseckimeta-codesync[bot]
authored andcommitted
Retier react/utils headers (#58842)
Summary: Pull Request resolved: #58842 Make `Base64.h`, `Uuid.h`, `MoveWrapper.h` and `jsi-utils.h` private, and `SimpleThreadSafeCache.h`, `OnScopeExit.h`, `FloatComparison.h`, `RunLoopObserver.h`, `LowPriorityExecutor.h`, `PackTraits.h`, `TemplateStringLiteral.h` and `iequals.h` for frameworks; drop them from `<React/Utils.h>` and include them directly where they were reached through it. Guard `FollyConvert.h` as public and add it to the umbrella for Objective-C++. Changelog: [Internal] Differential Revision: D123383902
1 parent 185910a commit 6359bb6

18 files changed

Lines changed: 26 additions & 20 deletions

File tree

‎packages/react-native/ReactCommon/jsinspector-modern/ScopedExecutor.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <react/cxxstableapi/FrameworksGuard.h>
1111

1212
#include <React/Utils.h>
13+
#include <react/utils/OnScopeExit.h>
1314
#include <cassert>
1415
#include <functional>
1516
#include <memory>

‎packages/react-native/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <react/renderer/core/graphicsConversions.h>
1414
#include <react/renderer/core/propsConversions.h>
1515
#include <react/renderer/debug/debugStringConvertibleUtils.h>
16+
#include <react/utils/FloatComparison.h>
1617

1718
#include <glog/logging.h>
1819

‎packages/react-native/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <string>
1515

1616
#include <React/Utils.h>
17+
#include <react/utils/FloatComparison.h>
1718
#include <react/renderer/debug/DebugStringConvertible.h>
1819
#include <react/renderer/debug/DebugStringConvertibleItem.h>
1920

‎packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h‎

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

1212
#include <React/RendererCore.h>
1313
#include <React/Utils.h>
14+
#include <react/utils/FloatComparison.h>
15+
#include <react/utils/SimpleThreadSafeCache.h>
1416
#include <react/renderer/attributedstring/AttributedString.h>
1517
#include <react/renderer/attributedstring/ParagraphAttributes.h>
1618

‎packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <React/RendererCore.h>
1313
#include <React/Utils.h>
14+
#include <react/utils/SimpleThreadSafeCache.h>
1415
#include <react/jni/SafeReleaseJniRef.h>
1516
#include <react/renderer/attributedstring/AttributedStringBox.h>
1617
#include <react/renderer/attributedstring/ParagraphAttributes.h>

‎packages/react-native/ReactCommon/react/utils/Base64.h‎

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

88
#pragma once
99

10-
#include <react/cxxstableapi/UmbrellaGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <string>
1313
#include <string_view>

‎packages/react-native/ReactCommon/react/utils/FloatComparison.h‎

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

88
#pragma once
99

10-
#include <react/cxxstableapi/UmbrellaGuard.h>
10+
#include <react/cxxstableapi/FrameworksGuard.h>
1111

1212
#include <cmath>
1313

‎packages/react-native/ReactCommon/react/utils/MoveWrapper.h‎

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

88
#pragma once
99

10-
#include <react/cxxstableapi/UmbrellaGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <memory>
1313

‎packages/react-native/ReactCommon/react/utils/OnScopeExit.h‎

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

88
#pragma once
99

10-
#include <react/cxxstableapi/UmbrellaGuard.h>
10+
#include <react/cxxstableapi/FrameworksGuard.h>
1111

1212
#include <utility>
1313

‎packages/react-native/ReactCommon/react/utils/React/Utils.h‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,23 @@
3030
#undef RN_UMBRELLA_CONTEXT
3131
#define RN_UMBRELLA_CONTEXT 1
3232

33-
#include <react/utils/Base64.h>
3433
#include <react/utils/ContextContainer.h>
35-
#include <react/utils/FloatComparison.h>
36-
#include <react/utils/LowPriorityExecutor.h>
3734
#include <react/utils/ManagedObjectWrapper.h>
38-
#include <react/utils/MoveWrapper.h>
39-
#include <react/utils/OnScopeExit.h>
4035
#include <react/utils/PackTraits.h>
4136
#include <react/utils/ReactNativeVersion.h>
42-
#include <react/utils/RunLoopObserver.h>
4337
#include <react/utils/SharedFunction.h>
44-
#include <react/utils/SimpleThreadSafeCache.h>
4538
#include <react/utils/Telemetry.h>
4639
#include <react/utils/TemplateStringLiteral.h>
47-
#include <react/utils/Uuid.h>
4840
#include <react/utils/fnv1a.h>
4941
#include <react/utils/hash_combine.h>
5042
#include <react/utils/iequals.h>
51-
#include <react/utils/jsi-utils.h>
5243
#include <react/utils/toLower.h>
5344
#include <react/utils/to_underlying.h>
5445

46+
// Only shipped on Apple platforms, and only usable from Objective-C++.
47+
#if defined(__OBJC__) && defined(__cplusplus) && __has_include(<react/utils/FollyConvert.h>)
48+
#include <react/utils/FollyConvert.h>
49+
#endif
50+
5551
#undef RN_UMBRELLA_CONTEXT
5652
#pragma pop_macro("RN_UMBRELLA_CONTEXT")

0 commit comments

Comments
 (0)