Fix the root error boundary during suspense in ssr (#4710)

* Fix the root error boundary during suspense in ssr

* fix some typos
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-10-01 17:10:28 -07:00
1 parent 10912f4750
commit ad40f81607
9 files changed
+49 -13

No files matched your search

+2 -2
View File
@@ -795,7 +795,7 @@ impl VNode {
fn write_attrs(
&self,
mount: MountId,
dynamic_attrbiutes_iter: &mut Peekable<impl Iterator<Item = (usize, &'static [u8])>>,
dynamic_attributes_iter: &mut Peekable<impl Iterator<Item = (usize, &'static [u8])>>,
root_idx: u8,
dom: &mut VirtualDom,
to: &mut impl WriteMutations,
@@ -804,7 +804,7 @@ impl VNode {
// Only take nodes that are under this root node
let from_root_node = |(_, path): &(usize, &[u8])| path.first() == Some(&root_idx);
while let Some((attribute_idx, attribute_path)) =
dynamic_attrbiutes_iter.next_if(from_root_node)
dynamic_attributes_iter.next_if(from_root_node)
{
let attribute = &self.dynamic_attrs[attribute_idx];
+8 -2
View File
@@ -45,11 +45,17 @@ impl ScopeId {
/// let my_persistent_state = Signal::new_in_scope(String::new(), ScopeId::APP);
/// ```
// ScopeId(0) is the root scope wrapper
// ScopeId(1) is the default error boundary
// ScopeId(2) is the default suspense boundary
// ScopeId(1) is the default suspense boundary
// ScopeId(2) is the default error boundary
// ScopeId(3) is the users root scope
pub const APP: ScopeId = ScopeId(3);
/// The ScopeId of the topmost error boundary in the tree.
pub const ROOT_ERROR_BOUNDARY: ScopeId = ScopeId(2);
/// The ScopeId of the topmost suspense boundary in the tree.
pub const ROOT_SUSPENSE_BOUNDARY: ScopeId = ScopeId(1);
/// The ScopeId of the topmost scope in the tree.
/// This will be higher up in the tree than [`ScopeId::APP`] because dioxus inserts a default [`crate::SuspenseBoundary`] and [`crate::ErrorBoundary`] at the root of the tree.
// ScopeId(0) is the root scope wrapper