mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +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),
|
||||
instanceHandle_(instanceHandle),
|
||||
props_(props),
|
||||
children_(children) {}
|
||||
children_(children),
|
||||
revision_(1) {}
|
||||
|
||||
ShadowNode::ShadowNode(
|
||||
SharedShadowNode shadowNode,
|
||||
@ -43,7 +44,8 @@ ShadowNode::ShadowNode(
|
||||
instanceHandle_(shadowNode->instanceHandle_),
|
||||
props_(props ? props : shadowNode->props_),
|
||||
children_(children ? children : shadowNode->children_),
|
||||
sourceNode_(shadowNode) {}
|
||||
sourceNode_(shadowNode),
|
||||
revision_(shadowNode->revision_ + 1) {}
|
||||
|
||||
#pragma mark - Getters
|
||||
|
||||
@ -121,7 +123,7 @@ std::string ShadowNode::getDebugName() const {
|
||||
}
|
||||
|
||||
std::string ShadowNode::getDebugValue() const {
|
||||
return getSealed() ? "sealed" : "";
|
||||
return "r" + std::to_string(revision_) + (getSealed() ? "/sealed" : "");
|
||||
}
|
||||
|
||||
SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
|
||||
|
@ -81,6 +81,7 @@ protected:
|
||||
SharedProps props_;
|
||||
SharedShadowNodeSharedList children_;
|
||||
WeakShadowNode sourceNode_;
|
||||
int revision_;
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
Loading…
x
Reference in New Issue
Block a user