Merge pull request #1196 from Demonthos/log-hydration-errors
Add nicer debug messaging in trace level for hydration
This commit is contained in:
1 file changed
+12
@@ -115,6 +115,12 @@ impl WebsysDom {
|
|||||||
node: &TemplateNode,
|
node: &TemplateNode,
|
||||||
last_node_was_static_text: &mut bool,
|
last_node_was_static_text: &mut bool,
|
||||||
) -> Result<(), RehydrationError> {
|
) -> 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(¤t_child.clone().into());
|
||||||
|
}
|
||||||
|
}
|
||||||
match node {
|
match node {
|
||||||
TemplateNode::Element {
|
TemplateNode::Element {
|
||||||
children, attrs, ..
|
children, attrs, ..
|
||||||
@@ -198,6 +204,12 @@ impl WebsysDom {
|
|||||||
dynamic: &DynamicNode,
|
dynamic: &DynamicNode,
|
||||||
last_node_was_static_text: &mut bool,
|
last_node_was_static_text: &mut bool,
|
||||||
) -> Result<(), RehydrationError> {
|
) -> 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(¤t_child.clone().into());
|
||||||
|
}
|
||||||
|
}
|
||||||
match dynamic {
|
match dynamic {
|
||||||
dioxus_core::DynamicNode::Text(VText { id, .. }) => {
|
dioxus_core::DynamicNode::Text(VText { id, .. }) => {
|
||||||
// skip comment separator before node
|
// skip comment separator before node
|
||||||
|
|||||||
Reference in new issue
Block a user