mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 14:13:26 +00:00
Fabric: Collecting and printing ShadowNode's revision/generation
Summary: It drastically simplifies reading logs. Reviewed By: fkgozali Differential Revision: D7388963 fbshipit-source-id: 7849c803f295719918c20ddf8c082e5a5780116f
This commit is contained in:
parent
cb7a7f3b93
commit
99e9c6e798
@ -31,7 +31,8 @@ ShadowNode::ShadowNode(
|
|||||||
rootTag_(rootTag),
|
rootTag_(rootTag),
|
||||||
instanceHandle_(instanceHandle),
|
instanceHandle_(instanceHandle),
|
||||||
props_(props),
|
props_(props),
|
||||||
children_(children) {}
|
children_(children),
|
||||||
|
revision_(1) {}
|
||||||
|
|
||||||
ShadowNode::ShadowNode(
|
ShadowNode::ShadowNode(
|
||||||
SharedShadowNode shadowNode,
|
SharedShadowNode shadowNode,
|
||||||
@ -43,7 +44,8 @@ ShadowNode::ShadowNode(
|
|||||||
instanceHandle_(shadowNode->instanceHandle_),
|
instanceHandle_(shadowNode->instanceHandle_),
|
||||||
props_(props ? props : shadowNode->props_),
|
props_(props ? props : shadowNode->props_),
|
||||||
children_(children ? children : shadowNode->children_),
|
children_(children ? children : shadowNode->children_),
|
||||||
sourceNode_(shadowNode) {}
|
sourceNode_(shadowNode),
|
||||||
|
revision_(shadowNode->revision_ + 1) {}
|
||||||
|
|
||||||
#pragma mark - Getters
|
#pragma mark - Getters
|
||||||
|
|
||||||
@ -121,7 +123,7 @@ std::string ShadowNode::getDebugName() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ShadowNode::getDebugValue() const {
|
std::string ShadowNode::getDebugValue() const {
|
||||||
return getSealed() ? "sealed" : "";
|
return "r" + std::to_string(revision_) + (getSealed() ? "/sealed" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
|
SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
|
||||||
|
@ -81,6 +81,7 @@ protected:
|
|||||||
SharedProps props_;
|
SharedProps props_;
|
||||||
SharedShadowNodeSharedList children_;
|
SharedShadowNodeSharedList children_;
|
||||||
WeakShadowNode sourceNode_;
|
WeakShadowNode sourceNode_;
|
||||||
|
int revision_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace react
|
} // namespace react
|
||||||
|
Loading…
x
Reference in New Issue
Block a user