diff --git a/packages/core/src/childiter.rs b/packages/core/src/childiter.rs
index 3b762c547..2f5ffde96 100644
--- a/packages/core/src/childiter.rs
+++ b/packages/core/src/childiter.rs
@@ -74,7 +74,8 @@ impl<'a> Iterator for RealChildIterator<'a> {
// For components, we load their root and push them onto the stack
VNode::Component(sc) => {
let scope =
- unsafe { self.scopes.get_scope(sc.ass_scope.get().unwrap()) }.unwrap();
+ unsafe { self.scopes.get_scope(sc.associated_scope.get().unwrap()) }
+ .unwrap();
// let scope = self.scopes.get(sc.ass_scope.get().unwrap()).unwrap();
// Simply swap the current node on the stack with the root of the component
diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs
index 3c8b3ebb9..59011301e 100644
--- a/packages/core/src/diff.rs
+++ b/packages/core/src/diff.rs
@@ -341,7 +341,7 @@ impl<'bump> DiffMachine<'bump> {
});
// Actually initialize the caller's slot with the right address
- vcomponent.ass_scope.set(Some(new_idx));
+ vcomponent.associated_scope.set(Some(new_idx));
if !vcomponent.can_memoize {
let cur_scope = self.vdom.get_scope_mut(parent_idx).unwrap();
@@ -357,7 +357,7 @@ impl<'bump> DiffMachine<'bump> {
let new_component = self.vdom.get_scope_mut(new_idx).unwrap();
// Run the scope for one iteration to initialize it
- if new_component.run_scope() {
+ if new_component.run_scope(self.vdom) {
// Take the node that was just generated from running the component
let nextnode = new_component.frames.fin_head();
self.stack.create_component(new_idx, nextnode);
@@ -505,7 +505,7 @@ impl<'bump> DiffMachine<'bump> {
old: &'bump VComponent<'bump>,
new: &'bump VComponent<'bump>,
) {
- let scope_addr = old.ass_scope.get().unwrap();
+ let scope_addr = old.associated_scope.get().unwrap();
// Make sure we're dealing with the same component (by function pointer)
if old.user_fc == new.user_fc {
@@ -513,7 +513,7 @@ impl<'bump> DiffMachine<'bump> {
self.stack.scope_stack.push(scope_addr);
// Make sure the new component vnode is referencing the right scope id
- new.ass_scope.set(Some(scope_addr));
+ new.associated_scope.set(Some(scope_addr));
// make sure the component's caller function is up to date
let scope = self.vdom.get_scope_mut(scope_addr).unwrap();
@@ -529,7 +529,7 @@ impl<'bump> DiffMachine<'bump> {
}
false => {
// the props are different...
- if scope.run_scope() {
+ if scope.run_scope(self.vdom) {
self.diff_node(scope.frames.wip_head(), scope.frames.fin_head());
}
}
@@ -967,7 +967,7 @@ impl<'bump> DiffMachine<'bump> {
search_node = frag.children.last();
}
VNode::Component(el) => {
- let scope_id = el.ass_scope.get().unwrap();
+ let scope_id = el.associated_scope.get().unwrap();
let scope = self.vdom.get_scope(scope_id).unwrap();
search_node = Some(scope.root());
}
@@ -985,7 +985,7 @@ impl<'bump> DiffMachine<'bump> {
search_node = Some(&frag.children[0]);
}
VNode::Component(el) => {
- let scope_id = el.ass_scope.get().unwrap();
+ let scope_id = el.associated_scope.get().unwrap();
let scope = self.vdom.get_scope(scope_id).unwrap();
search_node = Some(scope.root());
}
@@ -1043,7 +1043,7 @@ impl<'bump> DiffMachine<'bump> {
}
VNode::Component(c) => {
- let scope_id = c.ass_scope.get().unwrap();
+ let scope_id = c.associated_scope.get().unwrap();
let scope = self.vdom.get_scope(scope_id).unwrap();
let root = scope.root();
self.remove_nodes(Some(root));
diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs
index 5e2db6ef8..a66e96727 100644
--- a/packages/core/src/nodes.rs
+++ b/packages/core/src/nodes.rs
@@ -13,7 +13,6 @@ use std::{
cell::{Cell, RefCell},
fmt::{Arguments, Debug, Formatter},
marker::PhantomData,
- mem::ManuallyDrop,
rc::Rc,
};
@@ -43,8 +42,8 @@ impl<'src> VNode<'src> {
VNode::Component(c) => c.key,
VNode::Fragment(f) => f.key,
VNode::Text(_t) => None,
- VNode::Suspended(s) => None,
- VNode::Anchor(f) => None,
+ VNode::Suspended(_s) => None,
+ VNode::Anchor(_f) => None,
}
}
pub fn direct_id(&self) -> ElementId {
@@ -68,16 +67,36 @@ pub struct VAnchor {
pub struct VText<'src> {
pub text: &'src str,
+
pub dom_id: Cell