Rip out async components

This commit is contained in:
Jonathan Kelley committed 2023-07-14 16:15:20 -07:00
1 parent 4147498041
commit cbd88bbcc3
14 files changed
+62 -300

No files matched your search

+2 -9
View File
@@ -335,7 +335,8 @@ impl VirtualDom {
/// Determine if the tree is at all suspended. Used by SSR and other outside mechanisms to determine if the tree is
/// ready to be rendered.
pub fn has_suspended_work(&self) -> bool {
!self.scheduler.leaves.borrow().is_empty()
todo!()
// !self.scheduler.leaves.borrow().is_empty()
}
/// Call a listener inside the VirtualDom with data from outside the VirtualDom.
@@ -485,7 +486,6 @@ impl VirtualDom {
Some(msg) => match msg {
SchedulerMsg::Immediate(id) => self.mark_dirty(id),
SchedulerMsg::TaskNotified(task) => self.handle_task_wakeup(task),
SchedulerMsg::SuspenseNotified(id) => self.handle_suspense_wakeup(id),
},
// If they're not ready, then we should wait for them to be ready
@@ -513,7 +513,6 @@ impl VirtualDom {
match msg {
SchedulerMsg::Immediate(id) => self.mark_dirty(id),
SchedulerMsg::TaskNotified(task) => self.handle_task_wakeup(task),
SchedulerMsg::SuspenseNotified(id) => self.handle_suspense_wakeup(id),
}
}
}
@@ -574,7 +573,6 @@ impl VirtualDom {
}
// If an error occurs, we should try to render the default error component and context where the error occured
RenderReturn::Aborted(_placeholder) => panic!("Cannot catch errors during rebuild"),
RenderReturn::Pending(_) => unreachable!("Root scope cannot be an async component"),
}
self.finalize()
@@ -680,11 +678,6 @@ impl VirtualDom {
continue;
}
// If there's no pending suspense, then we have no reason to wait for anything
if self.scheduler.leaves.borrow().is_empty() {
return self.finalize();
}
// Poll the suspense leaves in the meantime
let mut work = self.wait_for_work();