diff --git a/packages/core/src/create.rs b/packages/core/src/create.rs index 2e0d85f96..d589deaa3 100644 --- a/packages/core/src/create.rs +++ b/packages/core/src/create.rs @@ -342,7 +342,7 @@ impl<'b> VirtualDom { match unsafe { self.run_scope(scope).extend_lifetime_ref() } { Ready(t) => self.mount_component(scope, template, t, idx), Aborted(t) => self.mount_aborted(template, t), - Async(_) => self.mount_async(template, idx, scope), + Pending(_) => self.mount_async(template, idx, scope), } } diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 56eb7421a..6ab1639a3 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -30,7 +30,7 @@ impl<'b> VirtualDom { .try_load_node() .expect("Call rebuild before diffing"); - use RenderReturn::{Aborted, Async, Ready}; + use RenderReturn::{Aborted, Pending, Ready}; match (old, new) { // Normal pathway @@ -43,16 +43,16 @@ impl<'b> VirtualDom { (Aborted(l), Aborted(r)) => r.id.set(l.id.get()), // Becomes async, do nothing while we ait - (Ready(_nodes), Async(_fut)) => self.diff_ok_to_async(_nodes, scope), + (Ready(_nodes), Pending(_fut)) => self.diff_ok_to_async(_nodes, scope), // Placeholder becomes something // We should also clear the error now (Aborted(l), Ready(r)) => self.replace_placeholder(l, [r]), - (Aborted(_), Async(_)) => todo!("async should not resolve here"), - (Async(_), Ready(_)) => todo!("async should not resolve here"), - (Async(_), Aborted(_)) => todo!("async should not resolve here"), - (Async(_), Async(_)) => { + (Aborted(_), Pending(_)) => todo!("async should not resolve here"), + (Pending(_), Ready(_)) => todo!("async should not resolve here"), + (Pending(_), Aborted(_)) => todo!("async should not resolve here"), + (Pending(_), Pending(_)) => { // All suspense should resolve before we diff it again panic!("Should not roll from suspense to suspense."); } diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 91e6d0c0c..494298321 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -30,7 +30,7 @@ pub enum RenderReturn<'a> { Aborted(VPlaceholder), /// An ongoing future that will resolve to a [`Element`] - Async(BumpBox<'a, dyn Future> + 'a>), + Pending(BumpBox<'a, dyn Future> + 'a>), } impl<'a> Default for RenderReturn<'a> { @@ -443,7 +443,7 @@ where { fn into_return(self, cx: &'a ScopeState) -> RenderReturn<'a> { let f: &mut dyn Future> = cx.bump().alloc(self); - RenderReturn::Async(unsafe { BumpBox::from_raw(f) }) + RenderReturn::Pending(unsafe { BumpBox::from_raw(f) }) } } diff --git a/packages/core/src/scope_arena.rs b/packages/core/src/scope_arena.rs index f6b7b812a..fbe865021 100644 --- a/packages/core/src/scope_arena.rs +++ b/packages/core/src/scope_arena.rs @@ -84,7 +84,7 @@ impl VirtualDom { }; // immediately resolve futures that can be resolved - if let RenderReturn::Async(task) = &mut new_nodes { + if let RenderReturn::Pending(task) = &mut new_nodes { let mut leaves = self.scheduler.leaves.borrow_mut(); let entry = leaves.vacant_entry(); diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index bd1a4c7bd..a27fcd366 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -486,7 +486,7 @@ 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::Async(_) => unreachable!("Root scope cannot be an async component"), + RenderReturn::Pending(_) => unreachable!("Root scope cannot be an async component"), } self.finalize()