add nicer debug messaging in trace level for hydration

This commit is contained in:
Evan Almloff 2023-07-14 16:16:13 -07:00
parent f2cd6b8af6
commit fa97f5450f

View file

@ -115,6 +115,12 @@ impl WebsysDom {
node: &TemplateNode,
last_node_was_static_text: &mut bool,
) -> Result<(), RehydrationError> {
log::trace!("rehydrate template node: {:?}", node);
if let Ok(current_child) = current_child {
if log::log_enabled!(log::Level::Trace) {
web_sys::console::log_1(&current_child.clone().into());
}
}
match node {
TemplateNode::Element {
children, attrs, ..
@ -198,6 +204,12 @@ impl WebsysDom {
dynamic: &DynamicNode,
last_node_was_static_text: &mut bool,
) -> Result<(), RehydrationError> {
log::trace!("rehydrate dynamic node: {:?}", dynamic);
if let Ok(current_child) = current_child {
if log::log_enabled!(log::Level::Trace) {
web_sys::console::log_1(&current_child.clone().into());
}
}
match dynamic {
dioxus_core::DynamicNode::Text(VText { id, .. }) => {
// skip comment separator before node