Skip to content

Commit 7b11d48

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Restore public parseUnprocessedTransformOriginString (#58893)
Summary: The Android `react-native-unistyles` job in the [nightly tests](https://github.com/react-native-community/nightly-tests/actions/runs/37455000546) has failed since the `20261003` nightly: ``` TransformOriginConverter.cpp:124:20: error: no member named 'parseUnprocessedTransformOriginString' in namespace 'facebook::react' ``` #58786 moved the transform-origin helpers from `react/renderer/components/view/conversions.h` into `conversions.cpp`. One of them, `parseUnprocessedTransformOriginString`, was an inline function in the public header, and it ended up in an anonymous namespace in the `.cpp`. Libraries can't call it anymore. Unistyles calls it on React Native 0.85 and newer (only when `RN_SERIALIZABLE_STATE` is defined, so in practice only on Android). This change declares `parseUnprocessedTransformOriginString(const std::string&, TransformOrigin&)` in `conversions.h` again and moves its definition out of the anonymous namespace. The implementation stays in `conversions.cpp`, and the signature uses only `std::string` and `TransformOrigin`, so no CSS headers leak back into the public header. The other helpers #58786 made private stay private. ## Changelog: [GENERAL] [FIXED] - Restore public `parseUnprocessedTransformOriginString` in `react/renderer/components/view/conversions.h` Pull Request resolved: #58893 Test Plan: - Regenerated the C++ API snapshots with Doxygen 1.16.1, the version CI uses: `python -m scripts.cxx-api.parser`. For the Common and Apple views, the only diff this change causes is one restored line: `void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);`. That is the same line #58786 removed. My local Apple output also had extra codegen entries for the sample TurboModule, so I left those out of the commit. - In my environment the Android views fail to generate even on clean `main` (`Identifier basic_appender already exists in scope v12`). I added the same line by hand to the three Android snapshots, at the position #58786 removed it from. The `validate-cxx-api-snapshots` job will confirm them. - `yarn format-check-cpp`: no violations in repository files. - I couldn't build the C++ locally, so I'm relying on CI for compilation. The change only moves an existing function definition out of an anonymous namespace and adds its declaration. - After this lands, the Android unistyles job in the nightly tests should compile `TransformOriginConverter.cpp` again. Reviewed By: christophpurrer Differential Revision: D123667938 Pulled By: cipolleschi fbshipit-source-id: 65460434bcf100b35149d077da18c42897e46bea
1 parent 0605e8e commit 7b11d48

11 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/react-native/ReactCommon/react/renderer/components/view/conversions.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ void parseProcessedTransformOrigin(
721721
result = transformOrigin;
722722
}
723723

724+
} // namespace
725+
724726
void parseUnprocessedTransformOriginString(
725727
const std::string& value,
726728
TransformOrigin& result) {
@@ -752,6 +754,8 @@ void parseUnprocessedTransformOriginString(
752754
result = transformOrigin;
753755
}
754756

757+
namespace {
758+
755759
void parseUnprocessedTransformOrigin(
756760
const PropsParserContext& context,
757761
const RawValue& value,

‎packages/react-native/ReactCommon/react/renderer/components/view/conversions.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ void fromRawValue(const PropsParserContext &context, const RawValue &value, Tran
458458

459459
void fromRawValue(const PropsParserContext &context, const RawValue &value, TransformOrigin &result);
460460

461+
void parseUnprocessedTransformOriginString(const std::string &value, TransformOrigin &result);
462+
461463
inline void fromRawValue(const PropsParserContext &context, const RawValue &value, PointerEventsMode &result)
462464
{
463465
result = PointerEventsMode::Auto;

‎scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
11471147
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
11481148
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
11491149
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
1150+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
11501151
void facebook::react::reactAndroidLoggingHook(const std::string& message, unsigned int logLevel);
11511152
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
11521153
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);

‎scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
11431143
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
11441144
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
11451145
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
1146+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
11461147
void facebook::react::reactAndroidLoggingHook(const std::string& message, unsigned int logLevel);
11471148
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
11481149
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);

‎scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
11471147
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
11481148
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
11491149
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
1150+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
11501151
void facebook::react::reactAndroidLoggingHook(const std::string& message, unsigned int logLevel);
11511152
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
11521153
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);

‎scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,6 +3947,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
39473947
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
39483948
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
39493949
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
3950+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
39503951
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
39513952
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);
39523953
void facebook::react::serializeTransformOperationValue(const std::string& operationName, const facebook::react::ValueUnit& valueUnit, folly::dynamic& resultArray);

‎scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3936,6 +3936,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
39363936
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
39373937
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
39383938
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
3939+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
39393940
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
39403941
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);
39413942
void facebook::react::serializeTransformOperationValue(const std::string& operationName, const facebook::react::ValueUnit& valueUnit, folly::dynamic& resultArray);

‎scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,6 +3947,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
39473947
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
39483948
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
39493949
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
3950+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
39503951
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
39513952
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);
39523953
void facebook::react::serializeTransformOperationValue(const std::string& operationName, const facebook::react::ValueUnit& valueUnit, folly::dynamic& resultArray);

‎scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
706706
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
707707
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
708708
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
709+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
709710
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
710711
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);
711712
void facebook::react::serializeTransformOperationValue(const std::string& operationName, const facebook::react::ValueUnit& valueUnit, folly::dynamic& resultArray);

‎scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ void facebook::react::parseUnprocessedBackgroundImageList(const facebook::react:
703703
void facebook::react::parseUnprocessedBackgroundImageString(const std::string& value, std::vector<facebook::react::BackgroundImage>& result);
704704
void facebook::react::parseUnprocessedFontVariant(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::FontVariant& result);
705705
void facebook::react::parseUnprocessedFontVariantString(const std::string& value, facebook::react::FontVariant& result);
706+
void facebook::react::parseUnprocessedTransformOriginString(const std::string& value, facebook::react::TransformOrigin& result);
706707
void facebook::react::registerCxxModuleToGlobalModuleMap(std::string name, std::function<std::shared_ptr<facebook::react::TurboModule>(std::shared_ptr<facebook::react::CallInvoker> jsInvoker)> moduleProviderFunc);
707708
void facebook::react::serializeTransformAxis(const facebook::react::TransformOperation& operation, const std::string& operationName, float defaultValue, folly::dynamic& resultTranslateArray);
708709
void facebook::react::serializeTransformOperationValue(const std::string& operationName, const facebook::react::ValueUnit& valueUnit, folly::dynamic& resultArray);

0 commit comments

Comments
 (0)