From 57aa798dc2f8e375a5701fca5d888c5eaf516e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nishan=20=28o=5E=E2=96=BD=5Eo=29?= Date: Fri, 4 Sep 2026 03:11:30 -0700 Subject: [PATCH] Fix per-node memory regression caused by Grid styles (#58311) Summary: # Why Currently, grid style properties are stored in yoga style (`gridTemplateRows_`, `gridAutoColumns_` etc). These properties increase the size of style object from `152` bytes to `280` bytes (84% increase). The cost is added even when a node is not a grid container or a grid item. # How Move grid style properties behind a pointer that is lazily allocated, on the first grid property set. A node that doesn't use grid only adds the cost of this pointer (8 bytes). So style now costs 160 bytes (5% increase). The public API remains unchanged. # Tests A test is added to catch the style size regression and `tests/GridStyleTest.cpp` includes additional cases to assert unset style, copy and move behaviour. X-link: https://github.com/react/yoga/pull/2018 Reviewed By: rubennorte Differential Revision: D118628661 Pulled By: javache --- .../ReactCommon/yoga/yoga/style/GridStyle.h | 80 +++++++++++++++++++ .../ReactCommon/yoga/yoga/style/Style.h | 69 +++++++--------- .../api-snapshots/ReactAndroidDebugCxx.api | 23 ++++++ .../api-snapshots/ReactAndroidNewarchCxx.api | 23 ++++++ .../api-snapshots/ReactAndroidReleaseCxx.api | 23 ++++++ .../api-snapshots/ReactAppleDebugCxx.api | 23 ++++++ .../api-snapshots/ReactAppleNewarchCxx.api | 23 ++++++ .../api-snapshots/ReactAppleReleaseCxx.api | 23 ++++++ .../api-snapshots/ReactCommonDebugCxx.api | 23 ++++++ .../api-snapshots/ReactCommonNewarchCxx.api | 23 ++++++ .../api-snapshots/ReactCommonReleaseCxx.api | 23 ++++++ 11 files changed, 315 insertions(+), 41 deletions(-) create mode 100644 packages/react-native/ReactCommon/yoga/yoga/style/GridStyle.h diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/GridStyle.h b/packages/react-native/ReactCommon/yoga/yoga/style/GridStyle.h new file mode 100644 index 000000000000..f1cf9d7b11bf --- /dev/null +++ b/packages/react-native/ReactCommon/yoga/yoga/style/GridStyle.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include + +namespace facebook::yoga { + +/** + * The CSS Grid properties of a single node. + */ +struct GridStyle { + // Grid container properties + GridTrackList templateColumns{}; + GridTrackList templateRows{}; + GridTrackList autoColumns{}; + GridTrackList autoRows{}; + + // Grid item properties + GridLine columnStart{}; + GridLine columnEnd{}; + GridLine rowStart{}; + GridLine rowEnd{}; + + bool operator==(const GridStyle& other) const = default; +}; + +/** + * Storage for a GridStyle which stays empty until the first grid property is + * set. + */ +class GridStyleStorage { + public: + GridStyleStorage() = default; + GridStyleStorage(GridStyleStorage&&) noexcept = default; + GridStyleStorage& operator=(GridStyleStorage&&) noexcept = default; + + GridStyleStorage(const GridStyleStorage& other) { + *this = other; + } + + GridStyleStorage& operator=(const GridStyleStorage& other) { + grid_ = other.grid_ == nullptr ? nullptr + : std::make_unique(*other.grid_); + return *this; + } + + const GridStyle& get() const { + return grid_ == nullptr ? defaults() : *grid_; + } + + GridStyle& ensure() { + if (grid_ == nullptr) { + grid_ = std::make_unique(); + } + return *grid_; + } + + bool operator==(const GridStyleStorage& other) const { + return grid_ == other.grid_ || get() == other.get(); + } + + private: + static const GridStyle& defaults() { + static const GridStyle kDefaults{}; + return kDefaults; + } + + std::unique_ptr grid_{}; +}; + +} // namespace facebook::yoga diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/Style.h b/packages/react-native/ReactCommon/yoga/yoga/style/Style.h index a06bd246b456..00af38c692b4 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/Style.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/Style.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -209,84 +210,84 @@ class YG_EXPORT Style { // Grid Container Properties const GridTrackList& gridTemplateColumns() const { - return gridTemplateColumns_; + return grid_.get().templateColumns; } void setGridTemplateColumns(GridTrackList value) { - gridTemplateColumns_ = std::move(value); + grid_.ensure().templateColumns = std::move(value); } void resizeGridTemplateColumns(size_t count) { - gridTemplateColumns_.resize(count); + grid_.ensure().templateColumns.resize(count); } void setGridTemplateColumnAt(size_t index, GridTrackSize value) { - gridTemplateColumns_[index] = value; + grid_.ensure().templateColumns[index] = value; } const GridTrackList& gridTemplateRows() const { - return gridTemplateRows_; + return grid_.get().templateRows; } void setGridTemplateRows(GridTrackList value) { - gridTemplateRows_ = std::move(value); + grid_.ensure().templateRows = std::move(value); } void resizeGridTemplateRows(size_t count) { - gridTemplateRows_.resize(count); + grid_.ensure().templateRows.resize(count); } void setGridTemplateRowAt(size_t index, GridTrackSize value) { - gridTemplateRows_[index] = value; + grid_.ensure().templateRows[index] = value; } const GridTrackList& gridAutoColumns() const { - return gridAutoColumns_; + return grid_.get().autoColumns; } void setGridAutoColumns(GridTrackList value) { - gridAutoColumns_ = std::move(value); + grid_.ensure().autoColumns = std::move(value); } void resizeGridAutoColumns(size_t count) { - gridAutoColumns_.resize(count); + grid_.ensure().autoColumns.resize(count); } void setGridAutoColumnAt(size_t index, GridTrackSize value) { - gridAutoColumns_[index] = value; + grid_.ensure().autoColumns[index] = value; } const GridTrackList& gridAutoRows() const { - return gridAutoRows_; + return grid_.get().autoRows; } void setGridAutoRows(GridTrackList value) { - gridAutoRows_ = std::move(value); + grid_.ensure().autoRows = std::move(value); } void resizeGridAutoRows(size_t count) { - gridAutoRows_.resize(count); + grid_.ensure().autoRows.resize(count); } void setGridAutoRowAt(size_t index, GridTrackSize value) { - gridAutoRows_[index] = value; + grid_.ensure().autoRows[index] = value; } // Grid Item Properties const GridLine& gridColumnStart() const { - return gridColumnStart_; + return grid_.get().columnStart; } void setGridColumnStart(GridLine value) { - gridColumnStart_ = value; + grid_.ensure().columnStart = value; } const GridLine& gridColumnEnd() const { - return gridColumnEnd_; + return grid_.get().columnEnd; } void setGridColumnEnd(GridLine value) { - gridColumnEnd_ = value; + grid_.ensure().columnEnd = value; } const GridLine& gridRowStart() const { - return gridRowStart_; + return grid_.get().rowStart; } void setGridRowStart(GridLine value) { - gridRowStart_ = value; + grid_.ensure().rowStart = value; } const GridLine& gridRowEnd() const { - return gridRowEnd_; + return grid_.get().rowEnd; } void setGridRowEnd(GridLine value) { - gridRowEnd_ = value; + grid_.ensure().rowEnd = value; } FloatOptional resolvedMinDimension( @@ -667,14 +668,7 @@ class YG_EXPORT Style { sizeLengthsEqual( maxDimensions_, pool_, other.maxDimensions_, other.pool_) && numbersEqual(aspectRatio_, pool_, other.aspectRatio_, other.pool_) && - gridTemplateColumns_ == other.gridTemplateColumns_ && - gridTemplateRows_ == other.gridTemplateRows_ && - gridAutoColumns_ == other.gridAutoColumns_ && - gridAutoRows_ == other.gridAutoRows_ && - gridColumnStart_ == other.gridColumnStart_ && - gridColumnEnd_ == other.gridColumnEnd_ && - gridRowStart_ == other.gridRowStart_ && - gridRowEnd_ == other.gridRowEnd_; + grid_ == other.grid_; } private: @@ -929,15 +923,8 @@ class YG_EXPORT Style { Dimensions maxDimensions_{}; StyleValueHandle aspectRatio_{}; - // Grid properties - GridTrackList gridTemplateColumns_{}; - GridTrackList gridTemplateRows_{}; - GridTrackList gridAutoColumns_{}; - GridTrackList gridAutoRows_{}; - GridLine gridColumnStart_{}; - GridLine gridColumnEnd_{}; - GridLine gridRowStart_{}; - GridLine gridRowEnd_{}; + // Grid properties, allocated only when one of them is set + GridStyleStorage grid_{}; StyleValuePool pool_; }; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 9ec346522d04..14a1f6c441d2 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -13243,6 +13243,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -13806,6 +13817,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index 8982c7ac2684..7a629de6b499 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -12856,6 +12856,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -13419,6 +13430,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index f8c5b0af4c9a..ddcf53f5ce8e 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -13087,6 +13087,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -13650,6 +13661,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 0ef036bb8f2f..d6edfd5a7341 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -15043,6 +15043,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -15606,6 +15617,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 42dba9b418e7..237e3b494d74 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -14722,6 +14722,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -15285,6 +15296,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index e74932816f6f..dc15de02fb08 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -14897,6 +14897,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -15460,6 +15471,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 236a7ea1dba0..b7585d7851af 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -10144,6 +10144,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -10707,6 +10718,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 3ae1080cbfbd..f59f889b44ef 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -9968,6 +9968,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -10531,6 +10542,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 00ad636e3938..5de3379420de 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -10135,6 +10135,17 @@ class facebook::yoga::Config : public YGConfig { public void* getContext() const; } +class facebook::yoga::GridStyleStorage { + public GridStyleStorage() = default; + public GridStyleStorage(const facebook::yoga::GridStyleStorage& other); + public GridStyleStorage(facebook::yoga::GridStyleStorage&&) noexcept = default; + public bool operator==(const facebook::yoga::GridStyleStorage& other) const; + public const facebook::yoga::GridStyle& get() const; + public facebook::yoga::GridStyle& ensure(); + public facebook::yoga::GridStyleStorage& operator=(const facebook::yoga::GridStyleStorage& other); + public facebook::yoga::GridStyleStorage& operator=(facebook::yoga::GridStyleStorage&&) noexcept = default; +} + class facebook::yoga::Node : public YGNode { public Node(); public Node(const facebook::yoga::Config* config); @@ -10698,6 +10709,18 @@ struct facebook::yoga::GridLine { public static constexpr facebook::yoga::GridLine span(int32_t value); } +struct facebook::yoga::GridStyle { + public bool operator==(const facebook::yoga::GridStyle& other) const = default; + public facebook::yoga::GridLine columnEnd; + public facebook::yoga::GridLine columnStart; + public facebook::yoga::GridLine rowEnd; + public facebook::yoga::GridLine rowStart; + public facebook::yoga::GridTrackList autoColumns; + public facebook::yoga::GridTrackList autoRows; + public facebook::yoga::GridTrackList templateColumns; + public facebook::yoga::GridTrackList templateRows; +} + struct facebook::yoga::GridTrackSize { public bool infinitelyGrowable; public bool operator==(const facebook::yoga::GridTrackSize& other) const = default;