fix release mode

This commit is contained in:
Evan Almloff committed 2024-01-09 10:24:02 -06:00
1 parent 8af39e0f1e
commit d1b9703ee7
4 files changed
+4 -13

No files matched your search

+2 -10
View File
@@ -518,16 +518,8 @@ impl VNode {
}
Element { .. } => {
#[cfg(not(debug_assertions))]
let id = self.write_element_root(
mount,
node,
idx,
&mut attrs,
&mut nodes,
&[],
dom,
to,
);
let id =
self.write_element_root(mount, idx, &mut attrs, &mut nodes, &[], dom, to);
#[cfg(debug_assertions)]
let id = self.write_element_root(
mount,
+1
View File
@@ -57,6 +57,7 @@ impl Properties for () {
true
}
}
// We allow components to use the () generic parameter if they have no props. This impl enables the "build" method
// that the macros use to anonymously complete prop construction.
pub struct EmptyBuilder;
+1 -1
View File
@@ -271,7 +271,7 @@ impl VirtualDom {
};
let root = dom.new_scope(
BoxedAnyProps::new(VProps::new(root, |_, _| unreachable!(), root_props, "root")),
BoxedAnyProps::new(VProps::new(root, |_, _| true, root_props, "root")),
"app",
);
-2
View File
@@ -240,7 +240,6 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
// Render and release the mutable borrow on context
let roots = quote! { #( #root_printer ),* };
let root_count = self.roots.len();
let node_printer = &context.dynamic_nodes;
let dyn_attr_printer = &context.dynamic_attributes;
let node_paths = context.node_paths.iter().map(|it| quote!(&[#(#it),*]));
@@ -256,7 +255,6 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
::dioxus::core::VNode::new(
#key_tokens,
TEMPLATE,
Box::new([Default::default();#root_count]),
Box::new([ #( #node_printer ),* ]),
Box::new([ #( #dyn_attr_printer ),* ]),
)