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

[Flight] erroring after abort should not result in unhandled rejection #30675

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Aug 13, 2024

When I implemented the ability to abort synchronoulsy in flight I made it possible for erroring async server components to cause an unhandled rejection error. In the current implementation if you abort during the synchronous phase of a Function Component and then throw an error in the synchronous phase React will not attach any promise handlers because it short circuits the thenable treatment and throws an AbortSigil instead. This change updates the rendering logic to ignore the rejecting component.

Copy link

vercel bot commented Aug 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 6:24pm

@react-sizebot
Copy link

react-sizebot commented Aug 13, 2024

Comparing: d48603a...049d6f0

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.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 500.37 kB 500.37 kB = 89.80 kB 89.80 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 507.50 kB 507.50 kB = 90.96 kB 90.96 kB
facebook-www/ReactDOM-prod.classic.js = 595.24 kB 595.24 kB = 105.55 kB 105.55 kB
facebook-www/ReactDOM-prod.modern.js = 571.54 kB 571.54 kB = 101.75 kB 101.75 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-rc/react-server/cjs/react-server-flight.production.js +0.48% 55.91 kB 56.18 kB +0.41% 11.28 kB 11.33 kB
oss-stable-semver/react-server/cjs/react-server-flight.production.js +0.48% 55.91 kB 56.18 kB +0.41% 11.28 kB 11.33 kB
oss-stable/react-server/cjs/react-server-flight.production.js +0.48% 55.91 kB 56.18 kB +0.41% 11.28 kB 11.33 kB
oss-experimental/react-server/cjs/react-server-flight.production.js +0.45% 59.99 kB 60.26 kB +0.38% 12.02 kB 12.06 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.31% 86.90 kB 87.17 kB +0.23% 18.13 kB 18.17 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.31% 86.90 kB 87.17 kB +0.23% 18.13 kB 18.17 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.31% 86.90 kB 87.17 kB +0.23% 18.13 kB 18.17 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.30% 90.07 kB 90.34 kB +0.25% 18.56 kB 18.61 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.30% 90.07 kB 90.34 kB +0.25% 18.56 kB 18.61 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.30% 90.07 kB 90.34 kB +0.25% 18.56 kB 18.61 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.30% 90.39 kB 90.66 kB +0.25% 18.65 kB 18.70 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.30% 90.39 kB 90.66 kB +0.25% 18.65 kB 18.70 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.30% 90.39 kB 90.66 kB +0.25% 18.65 kB 18.70 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.30% 90.40 kB 90.67 kB +0.24% 18.67 kB 18.71 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.30% 90.40 kB 90.67 kB +0.24% 18.67 kB 18.71 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.30% 90.40 kB 90.67 kB +0.24% 18.67 kB 18.71 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.30% 90.43 kB 90.70 kB +0.23% 18.66 kB 18.71 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.30% 90.43 kB 90.70 kB +0.23% 18.66 kB 18.71 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.30% 90.43 kB 90.70 kB +0.23% 18.66 kB 18.71 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.30% 90.61 kB 90.88 kB +0.21% 18.80 kB 18.84 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.29% 92.56 kB 92.83 kB +0.24% 19.03 kB 19.07 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.29% 92.56 kB 92.83 kB +0.24% 19.03 kB 19.07 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.29% 92.56 kB 92.83 kB +0.24% 19.03 kB 19.07 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.29% 92.58 kB 92.85 kB +0.24% 19.03 kB 19.08 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.29% 92.58 kB 92.85 kB +0.24% 19.03 kB 19.08 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.29% 92.58 kB 92.85 kB +0.24% 19.03 kB 19.08 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.29% 93.52 kB 93.79 kB +0.23% 19.23 kB 19.27 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.29% 93.52 kB 93.79 kB +0.23% 19.23 kB 19.27 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.29% 93.52 kB 93.79 kB +0.23% 19.23 kB 19.27 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.29% 93.55 kB 93.82 kB +0.23% 19.22 kB 19.27 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.29% 93.55 kB 93.82 kB +0.23% 19.22 kB 19.27 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.29% 93.55 kB 93.82 kB +0.23% 19.22 kB 19.27 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.29% 93.82 kB 94.09 kB +0.24% 19.21 kB 19.26 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.29% 94.14 kB 94.41 kB +0.24% 19.31 kB 19.35 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.29% 94.24 kB 94.51 kB +0.20% 19.33 kB 19.37 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.29% 94.27 kB 94.54 kB +0.20% 19.33 kB 19.37 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.28% 96.27 kB 96.54 kB +0.22% 19.68 kB 19.72 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.28% 96.29 kB 96.56 kB +0.22% 19.68 kB 19.73 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.28% 97.22 kB 97.49 kB +0.22% 19.89 kB 19.94 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.28% 97.25 kB 97.52 kB +0.23% 19.89 kB 19.93 kB
oss-stable-rc/react-server/cjs/react-server-flight.development.js +0.26% 85.82 kB 86.04 kB +0.27% 15.93 kB 15.98 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.26% 85.82 kB 86.04 kB +0.27% 15.93 kB 15.98 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.26% 85.82 kB 86.04 kB +0.27% 15.93 kB 15.98 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.24% 141.04 kB 141.39 kB +0.30% 26.05 kB 26.13 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.24% 144.05 kB 144.39 kB +0.29% 26.59 kB 26.67 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.24% 144.67 kB 145.01 kB +0.29% 26.76 kB 26.84 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.23% 146.89 kB 147.24 kB +0.24% 26.98 kB 27.05 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.23% 147.04 kB 147.39 kB +0.24% 27.05 kB 27.11 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.23% 147.41 kB 147.76 kB +0.28% 27.02 kB 27.10 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.23% 147.58 kB 147.92 kB +0.28% 27.08 kB 27.16 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.23% 148.53 kB 148.87 kB +0.27% 27.29 kB 27.37 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.23% 148.68 kB 149.02 kB +0.27% 27.36 kB 27.43 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.22% 125.83 kB 126.10 kB +0.26% 23.48 kB 23.54 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.22% 125.83 kB 126.10 kB +0.26% 23.48 kB 23.54 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.22% 125.83 kB 126.10 kB +0.26% 23.48 kB 23.54 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.22% 100.35 kB 100.57 kB +0.26% 18.43 kB 18.48 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.21% 129.58 kB 129.86 kB +0.27% 24.07 kB 24.13 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.21% 129.58 kB 129.86 kB +0.27% 24.07 kB 24.13 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.21% 129.58 kB 129.86 kB +0.27% 24.07 kB 24.13 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.21% 130.21 kB 130.48 kB +0.27% 24.25 kB 24.31 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.21% 130.21 kB 130.48 kB +0.27% 24.25 kB 24.31 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.21% 130.21 kB 130.48 kB +0.27% 24.25 kB 24.31 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.21% 130.79 kB 131.06 kB +0.25% 24.28 kB 24.34 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.21% 130.79 kB 131.06 kB +0.25% 24.28 kB 24.34 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.21% 130.79 kB 131.06 kB +0.25% 24.28 kB 24.34 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.21% 130.94 kB 131.21 kB +0.26% 24.35 kB 24.41 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.21% 130.94 kB 131.21 kB +0.26% 24.35 kB 24.41 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.21% 130.94 kB 131.21 kB +0.26% 24.35 kB 24.41 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.21% 132.20 kB 132.47 kB +0.25% 24.43 kB 24.49 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.21% 132.20 kB 132.47 kB +0.25% 24.43 kB 24.49 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.21% 132.20 kB 132.47 kB +0.25% 24.43 kB 24.49 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.21% 132.36 kB 132.63 kB +0.25% 24.50 kB 24.56 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.21% 132.36 kB 132.63 kB +0.25% 24.50 kB 24.56 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.21% 132.36 kB 132.63 kB +0.25% 24.50 kB 24.56 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.21% 133.31 kB 133.59 kB +0.25% 24.70 kB 24.76 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.21% 133.31 kB 133.59 kB +0.25% 24.70 kB 24.76 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.21% 133.31 kB 133.59 kB +0.25% 24.70 kB 24.76 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.21% 133.46 kB 133.73 kB +0.24% 24.77 kB 24.83 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.21% 133.46 kB 133.73 kB +0.24% 24.77 kB 24.83 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.21% 133.46 kB 133.73 kB +0.24% 24.77 kB 24.83 kB

Generated by 🚫 dangerJS against e50f369

When I implemented the ability to abort synchronoulsy in flight I made it possible for erroring async server components to cause an unhandled rejection error. In the current implementation if you abort during the synchronous phase of a Function Component and then throw an error in the synchronous phase React will not attach any promise handlers because it short circuits the thenable treatment and throws an AbortSigil instead. This change updates the rendering logic to ignore the rejecting component.
@gnoff gnoff merged commit f6d1df6 into facebook:main Aug 13, 2024
185 checks passed
@gnoff gnoff deleted the handle-rejects-while-aborting branch August 13, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants