Skip to content

Commit 5a4ed2d

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] [B] (facebook#53970)
Summary: Pull Request resolved: facebook#53970 Reviewed By: rshest Differential Revision: D83404453 fbshipit-source-id: 852d553b9c70a00c8493f8f0ad2d55df0a6093ea
1 parent 0a3bcc9 commit 5a4ed2d

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ StubViewTree buildStubViewTreeWithoutUsingDifferentiator(
8383
sliceChildShadowNodeViewPairs(rootShadowNodePair, scope, false, {}, {}));
8484

8585
auto emptyRootShadowNode = rootShadowNode.clone(ShadowNodeFragment{
86-
ShadowNodeFragment::propsPlaceholder(),
87-
ShadowNode::emptySharedShadowNodeSharedList()});
86+
.props = ShadowNodeFragment::propsPlaceholder(),
87+
.children = ShadowNode::emptySharedShadowNodeSharedList()});
8888

8989
auto stubViewTree = StubViewTree(ShadowView(*emptyRootShadowNode));
9090
stubViewTree.mutate(mutations);
@@ -94,8 +94,8 @@ StubViewTree buildStubViewTreeWithoutUsingDifferentiator(
9494
StubViewTree buildStubViewTreeUsingDifferentiator(
9595
const ShadowNode& rootShadowNode) {
9696
auto emptyRootShadowNode = rootShadowNode.clone(ShadowNodeFragment{
97-
ShadowNodeFragment::propsPlaceholder(),
98-
ShadowNode::emptySharedShadowNodeSharedList()});
97+
.props = ShadowNodeFragment::propsPlaceholder(),
98+
.children = ShadowNode::emptySharedShadowNodeSharedList()});
9999

100100
auto mutations =
101101
calculateShadowViewMutations(*emptyRootShadowNode, rootShadowNode);

packages/react-native/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class OrderIndexTest : public ::testing::Test {
8484
node->getFamily(), [&](const ShadowNode& oldShadowNode) {
8585
auto viewProps = std::make_shared<ViewShadowNodeProps>();
8686
callback(*viewProps);
87-
return oldShadowNode.clone(ShadowNodeFragment{viewProps});
87+
return oldShadowNode.clone(
88+
ShadowNodeFragment{.props = viewProps});
8889
}));
8990
}
9091

packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ static void testShadowNodeTreeLifeCycle(
3535

3636
auto eventDispatcher = EventDispatcher::Shared{};
3737
auto contextContainer = std::make_shared<ContextContainer>();
38-
auto componentDescriptorParameters =
39-
ComponentDescriptorParameters{eventDispatcher, contextContainer, nullptr};
38+
auto componentDescriptorParameters = ComponentDescriptorParameters{
39+
.eventDispatcher = eventDispatcher,
40+
.contextContainer = contextContainer,
41+
.flavor = nullptr};
4042
auto viewComponentDescriptor =
4143
ViewComponentDescriptor(componentDescriptorParameters);
4244
auto rootComponentDescriptor =
@@ -49,21 +51,26 @@ static void testShadowNodeTreeLifeCycle(
4951
for (int i = 0; i < repeats; i++) {
5052
allNodes.clear();
5153

52-
auto family =
53-
rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr});
54+
auto family = rootComponentDescriptor.createFamily(
55+
{.tag = Tag(1), .surfaceId = SurfaceId(1), .instanceHandle = nullptr});
5456

5557
// Creating an initial root shadow node.
5658
auto emptyRootNode = std::const_pointer_cast<RootShadowNode>(
5759
std::static_pointer_cast<const RootShadowNode>(
5860
rootComponentDescriptor.createShadowNode(
59-
ShadowNodeFragment{RootShadowNode::defaultSharedProps()},
61+
ShadowNodeFragment{
62+
.props = RootShadowNode::defaultSharedProps()},
6063
family)));
6164

6265
// Applying size constraints.
6366
emptyRootNode = emptyRootNode->clone(
6467
parserContext,
6568
LayoutConstraints{
66-
Size{512, 0}, Size{512, std::numeric_limits<Float>::infinity()}},
69+
.minimumSize = Size{.width = 512, .height = 0},
70+
.maximumSize =
71+
Size{
72+
.width = 512,
73+
.height = std::numeric_limits<Float>::infinity()}},
6774
LayoutContext{});
6875

6976
// Generation of a random tree.
@@ -73,8 +80,9 @@ static void testShadowNodeTreeLifeCycle(
7380
// Injecting a tree into the root node.
7481
auto currentRootNode = std::static_pointer_cast<const RootShadowNode>(
7582
emptyRootNode->ShadowNode::clone(ShadowNodeFragment{
76-
ShadowNodeFragment::propsPlaceholder(),
77-
std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(
83+
.props = ShadowNodeFragment::propsPlaceholder(),
84+
.children = std::make_shared<
85+
std::vector<std::shared_ptr<const ShadowNode>>>(
7886
std::vector<std::shared_ptr<const ShadowNode>>{
7987
singleRootChildNode})}));
8088

@@ -184,8 +192,10 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening(
184192
auto eventDispatcher = EventDispatcher::Shared{};
185193
auto contextContainer = std::make_shared<ContextContainer>();
186194

187-
auto componentDescriptorParameters =
188-
ComponentDescriptorParameters{eventDispatcher, contextContainer, nullptr};
195+
auto componentDescriptorParameters = ComponentDescriptorParameters{
196+
.eventDispatcher = eventDispatcher,
197+
.contextContainer = contextContainer,
198+
.flavor = nullptr};
189199
auto viewComponentDescriptor =
190200
ViewComponentDescriptor(componentDescriptorParameters);
191201
auto rootComponentDescriptor =
@@ -198,21 +208,26 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening(
198208
for (int i = 0; i < repeats; i++) {
199209
allNodes.clear();
200210

201-
auto family =
202-
rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr});
211+
auto family = rootComponentDescriptor.createFamily(
212+
{.tag = Tag(1), .surfaceId = SurfaceId(1), .instanceHandle = nullptr});
203213

204214
// Creating an initial root shadow node.
205215
auto emptyRootNode = std::const_pointer_cast<RootShadowNode>(
206216
std::static_pointer_cast<const RootShadowNode>(
207217
rootComponentDescriptor.createShadowNode(
208-
ShadowNodeFragment{RootShadowNode::defaultSharedProps()},
218+
ShadowNodeFragment{
219+
.props = RootShadowNode::defaultSharedProps()},
209220
family)));
210221

211222
// Applying size constraints.
212223
emptyRootNode = emptyRootNode->clone(
213224
parserContext,
214225
LayoutConstraints{
215-
Size{512, 0}, Size{512, std::numeric_limits<Float>::infinity()}},
226+
.minimumSize = Size{.width = 512, .height = 0},
227+
.maximumSize =
228+
Size{
229+
.width = 512,
230+
.height = std::numeric_limits<Float>::infinity()}},
216231
LayoutContext{});
217232

218233
// Generation of a random tree.
@@ -222,8 +237,9 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening(
222237
// Injecting a tree into the root node.
223238
auto currentRootNode = std::static_pointer_cast<const RootShadowNode>(
224239
emptyRootNode->ShadowNode::clone(ShadowNodeFragment{
225-
ShadowNodeFragment::propsPlaceholder(),
226-
std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(
240+
.props = ShadowNodeFragment::propsPlaceholder(),
241+
.children = std::make_shared<
242+
std::vector<std::shared_ptr<const ShadowNode>>>(
227243
std::vector<std::shared_ptr<const ShadowNode>>{
228244
singleRootChildNode})}));
229245

0 commit comments

Comments
 (0)