fix hot reloading rsx with nested rsx calls

This commit is contained in:
Evan Almloff committed 2022-12-22 16:38:07 -06:00
1 parent 21ca1599eb
commit 1530445972
5 files changed
+59 -10

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ pub struct IfmtInput {
impl IfmtInput {
pub fn is_static(&self) -> bool {
matches!(self.segments.as_slice(), &[Segment::Literal(_)])
matches!(self.segments.as_slice(), &[Segment::Literal(_)] | &[])
}
}
+5
View File
@@ -187,6 +187,9 @@ impl<'a, Ctx: HotReloadingContext> ToTokens for TemplateRenderer<'a, Ctx> {
out
});
let spndbg = format!("{:?}", self.roots[0].span());
let root_col = spndbg[9..].split("..").next().unwrap();
// Render and release the mutable borrow on context
let roots = quote! { #( #root_printer ),* };
let node_printer = &context.dynamic_nodes;
@@ -202,6 +205,8 @@ impl<'a, Ctx: HotReloadingContext> ToTokens for TemplateRenderer<'a, Ctx> {
line!(),
":",
column!(),
":",
#root_col
),
roots: &[ #roots ],
node_paths: &[ #(#node_paths),* ],