Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hydration of suspense fragments that contain text nodes #3287

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Dec 4, 2024

The node walker that hydrates streaming fragments in fullstack was walking some nodes twice which took too many ids off of the stack. This PR fixes that issue and adds more debug information for data hydration failures in debug mode

Fixes #3041
Fixes #3299

@ealmloff ealmloff added bug Something isn't working fullstack related to the fullstack crate labels Dec 4, 2024
@ealmloff ealmloff marked this pull request as ready for review December 7, 2024 02:25
@ealmloff ealmloff added the breaking This is a breaking change label Dec 7, 2024
@ealmloff ealmloff removed the breaking This is a breaking change label Dec 7, 2024
/// Create a new meta tag in the head
fn create_meta(&self, props: MetaProps) {
let myself = self.clone();
queue_effect(move || {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally these would be a default implementation, but it requires a Clone bound on the document trait for queue_effect which is a breaking change

@@ -13,27 +13,26 @@ pub(crate) fn RootScopeWrapper(props: RootProps<VComponent>) -> Element {
None,
TEMPLATE,
Box::new([DynamicNode::Component(
fc_to_builder(ErrorBoundary)
.children(Element::Ok(VNode::new(
fc_to_builder(SuspenseBoundary)
Copy link
Member Author

@ealmloff ealmloff Dec 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not causing the hydration error, but putting the error boundary inside the suspense boundary makes it possible to resolve the error on the server without javascript instead of waiting and resolving the error on the client (we added support in #2772, but it is still slower when we can avoid it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fullstack related to the fullstack crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double render of element on use_server_future when using asset!()s use_server_future Hydration error
1 participant