Skip to content

Commit bbe3fd7

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Remove deprecated ShadowNode type aliases (#55687)
Summary: ## Changelog: [General] [Breaking]: Removing deprecated type aliases. Use the type directly. Remove deprecated type aliases from ShadowNode that were scheduled for deletion in 0.84: - `ShadowNode::Shared` → use `std::shared_ptr<const ShadowNode>` - `ShadowNode::Weak` → use `std::weak_ptr<const ShadowNode>` - `ShadowNode::Unshared` → use `std::shared_ptr<ShadowNode>` - `ShadowNode::ListOfShared` → use `std::vector<std::shared_ptr<const ShadowNode>>` - `ShadowNode::ListOfWeak` → use `std::vector<std::weak_ptr<const ShadowNode>>` Reviewed By: lenaic Differential Revision: D90331085
1 parent 5b07fc1 commit bbe3fd7

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ struct ShadowNodeWrapper;
3030

3131
class ShadowNode : public Sealable, public DebugStringConvertible, public jsi::NativeState {
3232
public:
33-
// TODO(T223558094): delete this in the next version.
34-
using Shared [[deprecated("Use std::shared_ptr<const ShadowNode> instead")]] = std::shared_ptr<const ShadowNode>;
35-
// TODO(T223558094): delete this in the next version.
36-
using Weak [[deprecated("Use std::weak_ptr<const ShadowNode> instead")]] = std::weak_ptr<const ShadowNode>;
37-
// TODO(T223558094): delete this in the next version.
38-
using Unshared [[deprecated("Use std::shared_ptr<ShadowNode> instead")]] = std::shared_ptr<ShadowNode>;
39-
// TODO(T223558094): delete this in the next version.
40-
using ListOfShared [[deprecated("Use std::vector<std::shared_ptr<const ShadowNode>> instead")]] =
41-
std::vector<std::shared_ptr<const ShadowNode>>;
42-
// TODO(T223558094): delete this in the next version.
43-
using ListOfWeak [[deprecated("Use std::vector<std::weak_ptr<const ShadowNode>> instead")]] =
44-
std::vector<std::weak_ptr<const ShadowNode>>;
4533
using SharedListOfShared = std::shared_ptr<const std::vector<std::shared_ptr<const ShadowNode>>>;
4634
using UnsharedListOfShared = std::shared_ptr<std::vector<std::shared_ptr<const ShadowNode>>>;
4735
using UnsharedListOfWeak = std::shared_ptr<std::vector<std::weak_ptr<const ShadowNode>>>;

packages/react-native/ReactCommon/react/test_utils/shadowTreeGeneration.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ static ShadowTreeEdge findRandomShadowNode(
8989
return findShadowNodeWithIndex(rootShadowNode, entropy.random<int>(1 /* Excluding a root node */, count - 1));
9090
}
9191

92-
static ShadowNode::ListOfShared cloneSharedShadowNodeList(const ShadowNode::ListOfShared &list)
92+
static std::vector<std::shared_ptr<const ShadowNode>> cloneSharedShadowNodeList(
93+
const std::vector<std::shared_ptr<const ShadowNode>> &list)
9394
{
94-
auto result = ShadowNode::ListOfShared{};
95+
auto result = std::vector<std::shared_ptr<const ShadowNode>>{};
9596
result.reserve(list.size());
9697
for (const auto &shadowNode : list) {
9798
result.push_back(shadowNode->clone({}));
@@ -105,7 +106,8 @@ static inline std::shared_ptr<ShadowNode> messWithChildren(const Entropy &entrop
105106
children = cloneSharedShadowNodeList(children);
106107
entropy.shuffle(children);
107108
return shadowNode.clone(
108-
{ShadowNodeFragment::propsPlaceholder(), std::make_shared<const ShadowNode::ListOfShared>(children)});
109+
{ShadowNodeFragment::propsPlaceholder(),
110+
std::make_shared<const std::vector<std::shared_ptr<const ShadowNode>>>(children)});
109111
}
110112

111113
static inline std::shared_ptr<ShadowNode> messWithLayoutableOnlyFlag(
@@ -280,7 +282,7 @@ static inline std::shared_ptr<const ShadowNode> generateShadowNodeTree(
280282
auto items = std::vector<int>(size);
281283
std::fill(items.begin(), items.end(), 1);
282284
auto chunks = entropy.distribute(items, deviation);
283-
auto children = ShadowNode::ListOfShared{};
285+
auto children = std::vector<std::shared_ptr<const ShadowNode>>{};
284286

285287
for (const auto &chunk : chunks) {
286288
children.push_back(generateShadowNodeTree(entropy, componentDescriptor, chunk.size()));
@@ -289,7 +291,8 @@ static inline std::shared_ptr<const ShadowNode> generateShadowNodeTree(
289291
auto family = componentDescriptor.createFamily({generateReactTag(), SurfaceId(1), nullptr});
290292
return componentDescriptor.createShadowNode(
291293
ShadowNodeFragment{
292-
generateDefaultProps(componentDescriptor), std::make_shared<const ShadowNode::ListOfShared>(children)},
294+
generateDefaultProps(componentDescriptor),
295+
std::make_shared<const std::vector<std::shared_ptr<const ShadowNode>>>(children)},
293296
family);
294297
}
295298

0 commit comments

Comments
 (0)