wip: fix rebuild

This commit is contained in:
Jonathan Kelley committed 2021-11-07 22:36:57 -05:00
1 parent 2559740463
commit 15c31d545a
5 files changed
+207 -120

No files matched your search

+13 -11
View File
@@ -125,11 +125,13 @@ impl<'bump> DiffState<'bump> {
impl<'bump> ScopeArena {
pub fn diff_scope(&'bump self, state: &mut DiffState<'bump>, id: &ScopeId) {
if let Some(component) = self.get_scope(id) {
let (old, new) = (component.wip_head(), component.fin_head());
state.stack.push(DiffInstruction::Diff { new, old });
self.work(state, || false);
}
// if let Some(component) = self.get_scope(id) {
let (old, new) = (self.wip_head(id), self.fin_head(id));
state.stack.push(DiffInstruction::Diff { old, new });
self.work(state, || false);
// }
}
/// Progress the diffing for this "fiber"
@@ -1146,8 +1148,8 @@ impl<'bump> ScopeArena {
}
VNode::Component(el) => {
let scope_id = el.associated_scope.get().unwrap();
let scope = self.get_scope(&scope_id).unwrap();
search_node = Some(scope.root_node());
// let scope = self.get_scope(&scope_id).unwrap();
search_node = Some(self.root_node(&scope_id));
}
}
}
@@ -1164,8 +1166,8 @@ impl<'bump> ScopeArena {
}
VNode::Component(el) => {
let scope_id = el.associated_scope.get().unwrap();
let scope = self.get_scope(&scope_id).unwrap();
search_node = Some(scope.root_node());
// let scope = self.get_scope(&scope_id).unwrap();
search_node = Some(self.root_node(&scope_id));
}
VNode::Linked(link) => {
todo!("linked")
@@ -1249,8 +1251,8 @@ impl<'bump> ScopeArena {
VNode::Component(c) => {
let scope_id = c.associated_scope.get().unwrap();
let scope = self.get_scope(&scope_id).unwrap();
let root = scope.root_node();
// let scope = self.get_scope(&scope_id).unwrap();
let root = self.root_node(&scope_id);
self.remove_nodes(state, Some(root), gen_muts);
log::debug!("Destroying scope {:?}", scope_id);