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

Do not replay erroring beginWork with invokeGuardedCallback when suspended or previously errored #24480

Merged
merged 1 commit into from
May 3, 2022

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented May 2, 2022

When hydrating a suspense boundary an error or a suspending fiber can often lead to a cascade of hydration errors. While in many cases these errors are simply discarde (e.g. when the root does not commit and we fall back to client rendering) the use of invokeGuardedCallback can lead to many of these errors appearing as uncaught in the browser console. This change avoids error replaying using invokeGuardedCallback when we are hydrating a suspense boundary and have either already suspended or we have one previous error which was replayed.

@gnoff gnoff force-pushed the suppress-uncaught-sibling-errors branch from 36ec127 to 10cc785 Compare May 2, 2022 23:21
@sizebot
Copy link

sizebot commented May 2, 2022

Comparing: ce13860...710429e

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 131.58 kB 131.58 kB = 42.17 kB 42.17 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 136.82 kB 136.82 kB +0.03% 43.68 kB 43.69 kB
facebook-www/ReactDOM-prod.classic.js = 441.21 kB 441.21 kB +0.02% 80.36 kB 80.37 kB
facebook-www/ReactDOM-prod.modern.js = 426.42 kB 426.42 kB = 78.20 kB 78.20 kB
facebook-www/ReactDOMForked-prod.classic.js = 441.21 kB 441.21 kB +0.02% 80.36 kB 80.38 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 710429e

…ended or previously errored

When hydrating a suspense boundary an error or a suspending fiber can often lead to a cascade of hydration errors. While in many cases these errors are simply discarded (e.g. when teh root does not commit and we fall back to client rendering) the use of invokeGuardedCallback can lead to many of these errors appearing as uncaught in the browser console. This change avoids error replaying using invokeGuardedCallback when we are hydrating a suspense boundary and have either already suspended or we have one previous error which was replayed.
@gnoff gnoff merged commit b4eb0ad into facebook:main May 3, 2022
@gnoff gnoff deleted the suppress-uncaught-sibling-errors branch May 3, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants