فهرست منبع

Clean up merge comments

Jonathan Kelley 1 سال پیش
والد
کامیت
b8fac44537
3فایلهای تغییر یافته به همراه2 افزوده شده و 67 حذف شده
  1. 0 41
      packages/core/src/scopes.rs
  2. 1 19
      packages/core/tests/fuzzing.rs
  3. 1 7
      packages/rsx/src/lib.rs

+ 0 - 41
packages/core/src/scopes.rs

@@ -348,49 +348,8 @@ impl<'src> ScopeState {
     /// }
     /// ```
     pub fn render(&'src self, rsx: LazyNodes<'src, '_>) -> Element<'src> {
-        // <<<<<<< HEAD
-        //         let element = rsx.call(self);
-
-        //         let mut listeners = self.attributes_to_drop_before_render.borrow_mut();
-        //         for attr in element.dynamic_attrs {
-        //             attr.ty.for_each(|attr| {
-        //                 match attr.value {
-        //                     // We need to drop listeners before the next render because they may borrow data from the borrowed props which will be dropped
-        //                     AttributeValue::Listener(_) => {
-        //                         let unbounded = unsafe { std::mem::transmute(attr as *const Attribute) };
-        //                         listeners.push(unbounded);
-        //                     }
-        //                     // We need to drop any values manually to make sure that their drop implementation is called before the next render
-        //                     AttributeValue::Any(_) => {
-        //                         let unbounded = unsafe { std::mem::transmute(attr as *const Attribute) };
-        //                         self.previous_frame().add_attribute_to_drop(unbounded);
-        //                     }
-
-        //                     _ => (),
-        //                 }
-        //             })
-        //         }
-
-        //         let mut props = self.borrowed_props.borrow_mut();
-        //         let mut drop_props = self
-        //             .previous_frame()
-        //             .props_to_drop_before_reset
-        //             .borrow_mut();
-        //         for node in element.dynamic_nodes {
-        //             if let DynamicNode::Component(comp) = node {
-        //                 let unbounded = unsafe { std::mem::transmute(comp as *const VComponent) };
-        //                 if !comp.static_props {
-        //                     props.push(unbounded);
-        //                 }
-        //                 drop_props.push(unbounded);
-        //             }
-        //         }
-
-        //         Some(element)
-        // =======
         // Note: We can't do anything in this function related to safety because the user could always circumvent it by creating a VNode manually and return it without calling this function
         Some(rsx.call(self))
-        // >>>>>>> 9fe172e9 (Fix leak in render macro)
     }
 
     /// Create a [`crate::VNode`] from the component parts

+ 1 - 19
packages/core/tests/fuzzing.rs

@@ -171,27 +171,16 @@ fn create_random_dynamic_node(cx: &ScopeState, depth: usize) -> DynamicNode {
     match rand::random::<u8>() % range {
         0 => DynamicNode::Placeholder(Default::default()),
         1 => cx.make_node((0..(rand::random::<u8>() % 5)).map(|_| {
-            // <<<<<<< HEAD
-            //             VNode::new(
-            //                 None,
-            //                 Template {
-            // =======
             cx.vnode(
                 None.into(),
                 Default::default(),
                 Cell::new(Template {
-                    // >>>>>>> 9fe172e9 (Fix leak in render macro)
                     name: concat!(file!(), ":", line!(), ":", column!(), ":0"),
                     roots: &[TemplateNode::Dynamic { id: 0 }],
                     node_paths: &[&[0]],
                     attr_paths: &[],
-                    // <<<<<<< HEAD
-                    //                 },
-                    //                 bumpalo::collections::Vec::new_in(cx.bump()),
-                    // =======
                 }),
                 bumpalo::collections::Vec::new_in(cx.bump()).into(),
-                // >>>>>>> 9fe172e9 (Fix leak in render macro)
                 cx.bump().alloc([cx.component(
                     create_random_element,
                     DepthProps { depth, root: false },
@@ -285,19 +274,12 @@ fn create_random_element(cx: Scope<DepthProps>) -> Element {
                 )
                 .into_boxed_str(),
             ));
-            // <<<<<<< HEAD
-            //             let node = VNode::new(
-            //                 None,
-            //                 template,
-            //                 bumpalo::collections::Vec::new_in(cx.bump()),
-            // =======
-            // println!("{template:#?}");
+            println!("{template:#?}");
             let node = cx.vnode(
                 None.into(),
                 None,
                 Cell::new(template),
                 bumpalo::collections::Vec::new_in(cx.bump()).into(),
-                // >>>>>>> 9fe172e9 (Fix leak in render macro)
                 {
                     let dynamic_nodes: Vec<_> = dynamic_node_types
                         .iter()

+ 1 - 7
packages/rsx/src/lib.rs

@@ -254,18 +254,12 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
                 node_paths: &[ #(#node_paths),* ],
                 attr_paths: &[ #(#attr_paths),* ],
             };
-// <<<<<<< HEAD
-//             ::dioxus::core::VNode::new(
-//                 #key_tokens,
-//                 TEMPLATE,
-//                 dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()),
-// =======
+
             __cx.vnode(
                 None.into(),
                 #key_tokens,
                 std::cell::Cell::new(TEMPLATE),
                 dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()).into(),
-// >>>>>>> 9fe172e9 (Fix leak in render macro)
                 __cx.bump().alloc([ #( #node_printer ),* ]),
                 __cx.bump().alloc([ #( #dyn_attr_printer ),* ]),
             )