chore: add back template diffing

This commit is contained in:
Jonathan Kelley committed 2022-12-13 15:18:20 -08:00
1 parent 7e45f2aa04
commit b659f4d5d6
2 files changed
+7 -10

No files matched your search

+7 -9
View File
@@ -228,7 +228,6 @@ impl<'b> VirtualDom {
self.run_scope(scope_id); self.run_scope(scope_id);
self.diff_scope(scope_id); self.diff_scope(scope_id);
println!("diffed component scope {:?}", scope_id);
self.dirty_scopes.remove(&DirtyScope { self.dirty_scopes.remove(&DirtyScope {
height: self.scopes[scope_id.0].height, height: self.scopes[scope_id.0].height,
id: scope_id, id: scope_id,
@@ -273,14 +272,13 @@ impl<'b> VirtualDom {
/// } /// }
/// ``` /// ```
fn light_diff_templates(&mut self, left: &'b VNode<'b>, right: &'b VNode<'b>) { fn light_diff_templates(&mut self, left: &'b VNode<'b>, right: &'b VNode<'b>) {
self.replace(left, right) match matching_components(left, right) {
// match matching_components(left, right) { None => self.replace(left, right),
// None => self.replace(left, right), Some(components) => components
// Some(components) => components .into_iter()
// .into_iter() .enumerate()
// .enumerate() .for_each(|(idx, (l, r))| self.diff_vcomponent(l, r, right, idx)),
// .for_each(|(idx, (l, r))| self.diff_vcomponent(l, r, right, idx)), }
// }
} }
/// Diff the two text nodes /// Diff the two text nodes
-1
View File
@@ -238,7 +238,6 @@ impl<'src> ScopeState {
pub fn schedule_update_any(&self) -> Arc<dyn Fn(ScopeId) + Send + Sync> { pub fn schedule_update_any(&self) -> Arc<dyn Fn(ScopeId) + Send + Sync> {
let chan = self.tasks.sender.clone(); let chan = self.tasks.sender.clone();
Arc::new(move |id| { Arc::new(move |id| {
println!("Scheduling update for {:?}", id);
chan.unbounded_send(SchedulerMsg::Immediate(id)).unwrap(); chan.unbounded_send(SchedulerMsg::Immediate(id)).unwrap();
}) })
} }