Răsfoiți Sursa

fix release mode

Evan Almloff 1 an în urmă
părinte
comite
d1b9703ee7

+ 2 - 10
packages/core/src/diff/node.rs

@@ -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 - 0
packages/core/src/properties.rs

@@ -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
packages/core/src/virtual_dom.rs

@@ -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",
         );
 

+ 0 - 2
packages/rsx/src/lib.rs

@@ -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 ),* ]),
             )