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(runtime-core): Try to fix suspense crash #7275

Closed
wants to merge 1 commit into from

Conversation

mmis1000
Copy link
Contributor

@mmis1000 mmis1000 commented Dec 5, 2022

Fixes: #6949

This is a WIP patch that intended to properly fix crash caused by #6949 , a crash caused by race condition between the component update and component hydration.

There are actually two bugs triggered by doing such actions.

  1. The suspense boundary try to render the fallback content even it totally shouldn't (We already have the content of default slot because SSR)
  2. The update of the component that wrap async component crashed
    a. Because host node relies on the subTree of async component it wraps.
    b. And the async component is not rendered yet.

This pull request does two things.

  1. Make patch of fallback content during hydration no-op
  2. Delay the patch of content when the subTree is missing until the async children resolved.

There are a few things that need to be addressed before this being a proper pull request.

  • Is delaying update a safe way to handle the race, would it be safer to just ignore it?
  • Is go one level down for find a async root component deep enough? Do I need to go recursively?
  • Is it okay to just ignore vNode of fallback content in a hydrating suspense boundary?

@mmis1000 mmis1000 changed the title fix(runtime-core): Try to fix suspense error fix(runtime-core): Try to fix suspense crash Dec 6, 2022
@mmis1000 mmis1000 closed this Dec 7, 2022
@mmis1000 mmis1000 deleted the experiment/suspense-crash-fix branch December 7, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rerender Async Component when it is root node of a Sync component before hydration crash the vue runtime.
1 participant