|
@@ -4,7 +4,7 @@
|
|
|
//! cheap and *very* fast to construct - building a full tree should be quick.
|
|
|
|
|
|
use crate::{
|
|
|
- innerlude::{Element, Properties, Scope, ScopeId, ScopeState},
|
|
|
+ innerlude::{ComponentPtr, Element, Properties, Scope, ScopeId, ScopeState},
|
|
|
lazynodes::LazyNodes,
|
|
|
AnyEvent, Component,
|
|
|
};
|
|
@@ -177,11 +177,18 @@ impl Debug for VNode<'_> {
|
|
|
.field("children", &el.children)
|
|
|
.finish(),
|
|
|
VNode::Text(t) => write!(s, "VNode::VText {{ text: {} }}", t.text),
|
|
|
- VNode::Placeholder(_) => write!(s, "VNode::VPlaceholder"),
|
|
|
+ VNode::Placeholder(t) => write!(s, "VNode::VPlaceholder {{ id: {:?} }}", t.id),
|
|
|
VNode::Fragment(frag) => {
|
|
|
write!(s, "VNode::VFragment {{ children: {:?} }}", frag.children)
|
|
|
}
|
|
|
- VNode::Component(comp) => write!(s, "VNode::VComponent {{ fc: {:?}}}", comp.user_fc),
|
|
|
+ VNode::Component(comp) => s
|
|
|
+ .debug_struct("VNode::VComponent")
|
|
|
+ .field("name", &comp.fn_name)
|
|
|
+ .field("fnptr", &comp.user_fc)
|
|
|
+ .field("key", &comp.key)
|
|
|
+ .field("scope", &comp.scope)
|
|
|
+ .field("originator", &comp.originator)
|
|
|
+ .finish(),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -384,7 +391,7 @@ pub struct VComponent<'src> {
|
|
|
pub originator: ScopeId,
|
|
|
pub scope: Cell<Option<ScopeId>>,
|
|
|
pub can_memoize: bool,
|
|
|
- pub user_fc: *const (),
|
|
|
+ pub user_fc: ComponentPtr,
|
|
|
pub fn_name: &'static str,
|
|
|
pub props: RefCell<Option<Box<dyn AnyProps + 'src>>>,
|
|
|
}
|
|
@@ -559,7 +566,7 @@ impl<'a> NodeFactory<'a> {
|
|
|
key: key.map(|f| self.raw_text(f).0),
|
|
|
scope: Default::default(),
|
|
|
can_memoize: P::IS_STATIC,
|
|
|
- user_fc: component as *const (),
|
|
|
+ user_fc: component as ComponentPtr,
|
|
|
originator: self.scope.scope_id(),
|
|
|
fn_name,
|
|
|
props: RefCell::new(Some(Box::new(VComponentProps {
|