Compare commits

...
1 Commits
Author SHA1 Message Date
CodemodService BotandFacebook GitHub Bot 934a76aeb0 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [A] [B]
Reviewed By: rshest

Differential Revision: D83405113
2025-09-29 01:35:17 -07:00
3 changed files with 34 additions and 22 deletions
@@ -27,7 +27,7 @@ class ImageSource {
std::string uri{};
std::string bundle{};
Float scale{3};
Size size{0};
Size size{.width = 0};
std::string body{};
std::string method{};
CacheStategy cache = CacheStategy::Default;
@@ -69,13 +69,14 @@ static std::shared_ptr<ShadowNode> progressState(const ShadowNode& shadowNode) {
}
return shadowNode.clone({
ShadowNodeFragment::propsPlaceholder(),
areChildrenChanged
.props = ShadowNodeFragment::propsPlaceholder(),
.children = areChildrenChanged
? std::make_shared<
const std::vector<std::shared_ptr<const ShadowNode>>>(
std::move(newChildren))
: ShadowNodeFragment::childrenPlaceholder(),
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
.state =
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
});
}
@@ -158,13 +159,14 @@ static std::shared_ptr<ShadowNode> progressState(
}
return shadowNode.clone({
ShadowNodeFragment::propsPlaceholder(),
areChildrenChanged
.props = ShadowNodeFragment::propsPlaceholder(),
.children = areChildrenChanged
? std::make_shared<
const std::vector<std::shared_ptr<const ShadowNode>>>(
std::move(newChildren))
: ShadowNodeFragment::childrenPlaceholder(),
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
.state =
isStateChanged ? newState : ShadowNodeFragment::statePlaceholder(),
});
}
@@ -177,7 +179,9 @@ ShadowTree::ShadowTree(
: surfaceId_(surfaceId), delegate_(delegate) {
static RootComponentDescriptor globalRootComponentDescriptor(
ComponentDescriptorParameters{
EventDispatcher::Shared{}, nullptr, nullptr});
.eventDispatcher = EventDispatcher::Shared{},
.contextContainer = nullptr,
.flavor = nullptr});
const auto props = std::make_shared<const RootProps>(
PropsParserContext{surfaceId, contextContainer},
@@ -186,17 +190,19 @@ ShadowTree::ShadowTree(
layoutContext);
auto family = globalRootComponentDescriptor.createFamily(
{surfaceId, surfaceId, nullptr});
{.tag = surfaceId, .surfaceId = surfaceId, .instanceHandle = nullptr});
auto rootShadowNode = std::static_pointer_cast<const RootShadowNode>(
globalRootComponentDescriptor.createShadowNode(
ShadowNodeFragment{
/* .props = */ props,
/* .props = */ .props = props,
},
family));
currentRevision_ = ShadowTreeRevision{
rootShadowNode, INITIAL_REVISION, TransactionTelemetry{}};
.rootShadowNode = rootShadowNode,
.number = INITIAL_REVISION,
.telemetry = TransactionTelemetry{}};
mountingCoordinator_ =
std::make_shared<const MountingCoordinator>(currentRevision_);
@@ -354,7 +360,9 @@ CommitStatus ShadowTree::tryCommit(
newRootShadowNode->sealRecursive();
newRevision = ShadowTreeRevision{
std::move(newRootShadowNode), newRevisionNumber, telemetry};
.rootShadowNode = std::move(newRootShadowNode),
.number = newRevisionNumber,
.telemetry = telemetry};
currentRevision_ = newRevision;
}
@@ -387,8 +395,9 @@ void ShadowTree::commitEmptyTree() const {
return std::make_shared<RootShadowNode>(
oldRootShadowNode,
ShadowNodeFragment{
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .children = */ ShadowNode::emptySharedShadowNodeSharedList(),
/* .props = */ .props = ShadowNodeFragment::propsPlaceholder(),
/* .children = */ .children =
ShadowNode::emptySharedShadowNodeSharedList(),
});
},
{/* default commit options */});
@@ -64,14 +64,17 @@ std::vector<DebugStringConvertibleObject> getDebugProps(
const ShadowView& object,
DebugStringConvertibleOptions options) {
return {
{"surfaceId", getDebugDescription(object.surfaceId, options)},
{"tag", getDebugDescription(object.tag, options)},
{"traits", getDebugDescription(object.traits, options)},
{"componentName", object.componentName},
{"props", getDebugDescription(object.props, options)},
{"eventEmitter", getDebugDescription(object.eventEmitter, options)},
{"layoutMetrics", getDebugDescription(object.layoutMetrics, options)},
{"state", getDebugDescription(object.state, options)},
{.name = "surfaceId",
.value = getDebugDescription(object.surfaceId, options)},
{.name = "tag", .value = getDebugDescription(object.tag, options)},
{.name = "traits", .value = getDebugDescription(object.traits, options)},
{.name = "componentName", .value = object.componentName},
{.name = "props", .value = getDebugDescription(object.props, options)},
{.name = "eventEmitter",
.value = getDebugDescription(object.eventEmitter, options)},
{.name = "layoutMetrics",
.value = getDebugDescription(object.layoutMetrics, options)},
{.name = "state", .value = getDebugDescription(object.state, options)},
};
}