Partially Fix Hotreload (#2557)

* fix: template names

* fix: hot reload "resets" after reload

* revision: ensure all paths are split by `/`

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Miles MurgawandJonathan Kelley authored and GitHub committed 2024-07-02 21:45:12 -07:00
1 parent 9567674a63
commit 7f6f0de085
8 files changed
+26 -17

No files matched your search

+2
View File
@@ -91,3 +91,5 @@ pub mod prelude {
TemplateAttribute, TemplateNode, VNode, VNodeInner, VirtualDom,
};
}
pub use const_format;
+2 -1
View File
@@ -584,8 +584,9 @@ impl VirtualDom {
// Recurse into the dynamic nodes of the existing mounted node to see if the template is alive in the tree
fn check_node_for_templates(node: &crate::VNode, template: Template) -> bool {
let this_template_name = node.template.get().name.rsplit_once(':').unwrap().0;
let other_template_name = template.name.rsplit_once(':').unwrap().0;
if this_template_name == template.name.rsplit_once(':').unwrap().0 {
if this_template_name == other_template_name {
return true;
}