chore: add back template diffing

This commit is contained in:
Jonathan Kelley 2022-12-13 15:18:20 -08:00
parent 7e45f2aa04
commit b659f4d5d6
2 changed files with 7 additions and 10 deletions

View file

@ -228,7 +228,6 @@ impl<'b> VirtualDom {
self.run_scope(scope_id);
self.diff_scope(scope_id);
println!("diffed component scope {:?}", scope_id);
self.dirty_scopes.remove(&DirtyScope {
height: self.scopes[scope_id.0].height,
id: scope_id,
@ -273,14 +272,13 @@ impl<'b> VirtualDom {
/// }
/// ```
fn light_diff_templates(&mut self, left: &'b VNode<'b>, right: &'b VNode<'b>) {
self.replace(left, right)
// match matching_components(left, right) {
// None => self.replace(left, right),
// Some(components) => components
// .into_iter()
// .enumerate()
// .for_each(|(idx, (l, r))| self.diff_vcomponent(l, r, right, idx)),
// }
match matching_components(left, right) {
None => self.replace(left, right),
Some(components) => components
.into_iter()
.enumerate()
.for_each(|(idx, (l, r))| self.diff_vcomponent(l, r, right, idx)),
}
}
/// Diff the two text nodes

View file

@ -238,7 +238,6 @@ impl<'src> ScopeState {
pub fn schedule_update_any(&self) -> Arc<dyn Fn(ScopeId) + Send + Sync> {
let chan = self.tasks.sender.clone();
Arc::new(move |id| {
println!("Scheduling update for {:?}", id);
chan.unbounded_send(SchedulerMsg::Immediate(id)).unwrap();
})
}