Clean up merge comments
This commit is contained in:
3 files changed
+2
-67
No files matched your search
@@ -348,49 +348,8 @@ impl<'src> ScopeState {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn render(&'src self, rsx: LazyNodes<'src, '_>) -> Element<'src> {
|
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
|
// 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))
|
Some(rsx.call(self))
|
||||||
// >>>>>>> 9fe172e9 (Fix leak in render macro)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a [`crate::VNode`] from the component parts
|
/// Create a [`crate::VNode`] from the component parts
|
||||||
|
|||||||
@@ -171,27 +171,16 @@ fn create_random_dynamic_node(cx: &ScopeState, depth: usize) -> DynamicNode {
|
|||||||
match rand::random::<u8>() % range {
|
match rand::random::<u8>() % range {
|
||||||
0 => DynamicNode::Placeholder(Default::default()),
|
0 => DynamicNode::Placeholder(Default::default()),
|
||||||
1 => cx.make_node((0..(rand::random::<u8>() % 5)).map(|_| {
|
1 => cx.make_node((0..(rand::random::<u8>() % 5)).map(|_| {
|
||||||
// <<<<<<< HEAD
|
|
||||||
// VNode::new(
|
|
||||||
// None,
|
|
||||||
// Template {
|
|
||||||
// =======
|
|
||||||
cx.vnode(
|
cx.vnode(
|
||||||
None.into(),
|
None.into(),
|
||||||
Default::default(),
|
Default::default(),
|
||||||
Cell::new(Template {
|
Cell::new(Template {
|
||||||
// >>>>>>> 9fe172e9 (Fix leak in render macro)
|
|
||||||
name: concat!(file!(), ":", line!(), ":", column!(), ":0"),
|
name: concat!(file!(), ":", line!(), ":", column!(), ":0"),
|
||||||
roots: &[TemplateNode::Dynamic { id: 0 }],
|
roots: &[TemplateNode::Dynamic { id: 0 }],
|
||||||
node_paths: &[&[0]],
|
node_paths: &[&[0]],
|
||||||
attr_paths: &[],
|
attr_paths: &[],
|
||||||
// <<<<<<< HEAD
|
|
||||||
// },
|
|
||||||
// bumpalo::collections::Vec::new_in(cx.bump()),
|
|
||||||
// =======
|
|
||||||
}),
|
}),
|
||||||
bumpalo::collections::Vec::new_in(cx.bump()).into(),
|
bumpalo::collections::Vec::new_in(cx.bump()).into(),
|
||||||
// >>>>>>> 9fe172e9 (Fix leak in render macro)
|
|
||||||
cx.bump().alloc([cx.component(
|
cx.bump().alloc([cx.component(
|
||||||
create_random_element,
|
create_random_element,
|
||||||
DepthProps { depth, root: false },
|
DepthProps { depth, root: false },
|
||||||
@@ -285,19 +274,12 @@ fn create_random_element(cx: Scope<DepthProps>) -> Element {
|
|||||||
)
|
)
|
||||||
.into_boxed_str(),
|
.into_boxed_str(),
|
||||||
));
|
));
|
||||||
// <<<<<<< HEAD
|
println!("{template:#?}");
|
||||||
// let node = VNode::new(
|
|
||||||
// None,
|
|
||||||
// template,
|
|
||||||
// bumpalo::collections::Vec::new_in(cx.bump()),
|
|
||||||
// =======
|
|
||||||
// println!("{template:#?}");
|
|
||||||
let node = cx.vnode(
|
let node = cx.vnode(
|
||||||
None.into(),
|
None.into(),
|
||||||
None,
|
None,
|
||||||
Cell::new(template),
|
Cell::new(template),
|
||||||
bumpalo::collections::Vec::new_in(cx.bump()).into(),
|
bumpalo::collections::Vec::new_in(cx.bump()).into(),
|
||||||
// >>>>>>> 9fe172e9 (Fix leak in render macro)
|
|
||||||
{
|
{
|
||||||
let dynamic_nodes: Vec<_> = dynamic_node_types
|
let dynamic_nodes: Vec<_> = dynamic_node_types
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
@@ -254,18 +254,12 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
|||||||
node_paths: &[ #(#node_paths),* ],
|
node_paths: &[ #(#node_paths),* ],
|
||||||
attr_paths: &[ #(#attr_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(
|
__cx.vnode(
|
||||||
None.into(),
|
None.into(),
|
||||||
#key_tokens,
|
#key_tokens,
|
||||||
std::cell::Cell::new(TEMPLATE),
|
std::cell::Cell::new(TEMPLATE),
|
||||||
dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()).into(),
|
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([ #( #node_printer ),* ]),
|
||||||
__cx.bump().alloc([ #( #dyn_attr_printer ),* ]),
|
__cx.bump().alloc([ #( #dyn_attr_printer ),* ]),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user