-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Suppress hydration warnings when a preceding sibling suspends #24404
Commits on Apr 20, 2022
-
Add failing test case for facebook#24384
If a components suspends during hydration we expect there to be mismatches with server rendered HTML but we were not always supressing warning messages related to these expected mismatches
Configuration menu - View commit details
-
Copy full SHA for a9ccb8b - Browse repository at this point
Copy the full SHA a9ccb8bView commit details -
Mark hydration as suspending on every thrownException
previously hydration would only be marked as supsending when a genuine error was thrown. This created an opportunity for a hydration mismatch that would warn after which later hydration mismatches would not lead to warnings. By moving the marker check earlier in the thrownException function we get the hydration context to enter the didSuspend state on both error and thrown promise cases which eliminates this gap.
Configuration menu - View commit details
-
Copy full SHA for b530537 - Browse repository at this point
Copy the full SHA b530537View commit details -
Fix failing test related to client render fallbacks
This test was actually subject to the project identified in the issue fixed in this branch. After fixing the underlying issue the assertion logic needed to change to pick the right warning which now emits after hydration successfully completes on promise resolution. I changed the container type to 'section' to make the error message slightly easier to read/understand (for me)
Configuration menu - View commit details
-
Copy full SHA for dc1cd0b - Browse repository at this point
Copy the full SHA dc1cd0bView commit details -
Only mark didSuspend on suspense path
For unknown reasons the didSuspend was being set only on the error path and nto the suspense path. The original change hoisted this to happen on both paths. This change moves the didSuspend call to the suspense path only. This appears to be a noop because if the error path marked didSuspend it would suppress later warnings but if it does not the warning functions themsevles do that suppression (after the first one which necessarily already happened)
Configuration menu - View commit details
-
Copy full SHA for b06d2e9 - Browse repository at this point
Copy the full SHA b06d2e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e1cd0a - Browse repository at this point
Copy the full SHA 5e1cd0aView commit details -
refactor didSuspend to didSuspendOrError
the orignial behavior applied the hydration warning bailout to error paths only. originally I moved it to Suspense paths only but this commit restores it to both paths and renames the marker function as didThrow rather than didSuspend The logic here is that for either case if we get a mismatch in hydration we want to warm up components but effectively consider the hydration for this boundary halted
Configuration menu - View commit details
-
Copy full SHA for 668d8c9 - Browse repository at this point
Copy the full SHA 668d8c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bccb4d - Browse repository at this point
Copy the full SHA 3bccb4dView commit details -
add DEV suffix to didSuspendOrError to better indicate this feature s…
…hould only affect dev behavior
Configuration menu - View commit details
-
Copy full SHA for eeede50 - Browse repository at this point
Copy the full SHA eeede50View commit details -
Configuration menu - View commit details
-
Copy full SHA for c827582 - Browse repository at this point
Copy the full SHA c827582View commit details -
Configuration menu - View commit details
-
Copy full SHA for 945352e - Browse repository at this point
Copy the full SHA 945352eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07a2eee - Browse repository at this point
Copy the full SHA 07a2eeeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8839f1b - Browse repository at this point
Copy the full SHA 8839f1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fd1eb6 - Browse repository at this point
Copy the full SHA 3fd1eb6View commit details -
it not has an intentional client mismatch that would error if there wasn't supression brought about by the earlier error. when it client rendres it has the updated value not found in the server response but we do not see a hydration warning because it was superseded by the thrown error in that render
Configuration menu - View commit details
-
Copy full SHA for be1cefa - Browse repository at this point
Copy the full SHA be1cefaView commit details