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

[Fizz] Prerender fallbacks before children #30483

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Jul 26, 2024

When prerendering it can be convenient to abort the prerender while rendering. However if any Suspense fallbacks have not yet rendered before the abort happens the fallback itself will error and cause the nearest parent Suspense boundary to render a fallback instead. Prerenders are by definition not time critical so the prioritization of children over fallbacks which makes sense for render isn't similarly motivated for prerender. Given this, this change updates fallback rendering during a prerender to attempt the fallback before attempting children.

Copy link

vercel bot commented Jul 26, 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 Jul 26, 2024 9:06pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 26, 2024
@gnoff gnoff requested a review from sebmarkbage July 26, 2024 16:50
@react-sizebot
Copy link

react-sizebot commented Jul 26, 2024

Comparing: b9af819...fc49605

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.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 501.46 kB 501.46 kB = 89.98 kB 89.98 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 = 506.28 kB 506.28 kB = 90.68 kB 90.67 kB
facebook-www/ReactDOM-prod.classic.js = 601.27 kB 601.27 kB = 106.28 kB 106.28 kB
facebook-www/ReactDOM-prod.modern.js = 577.38 kB 577.38 kB = 102.52 kB 102.52 kB
oss-stable-rc/react-server/cjs/react-server.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-stable-semver/react-server/cjs/react-server.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-stable/react-server/cjs/react-server.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-experimental/react-server/cjs/react-server.production.js +2.13% 114.39 kB 116.83 kB +0.89% 20.91 kB 21.09 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.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-stable-semver/react-server/cjs/react-server.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-stable/react-server/cjs/react-server.production.js +2.23% 104.18 kB 106.50 kB +0.97% 19.38 kB 19.57 kB
oss-experimental/react-server/cjs/react-server.production.js +2.13% 114.39 kB 116.83 kB +0.89% 20.91 kB 21.09 kB
oss-stable-rc/react-server/cjs/react-server.development.js +0.85% 153.33 kB 154.63 kB +0.32% 28.31 kB 28.41 kB
oss-stable-semver/react-server/cjs/react-server.development.js +0.85% 153.33 kB 154.63 kB +0.32% 28.31 kB 28.41 kB
oss-stable/react-server/cjs/react-server.development.js +0.85% 153.33 kB 154.63 kB +0.32% 28.31 kB 28.41 kB
oss-experimental/react-server/cjs/react-server.development.js +0.78% 170.13 kB 171.45 kB +0.59% 30.71 kB 30.89 kB
facebook-www/ReactDOMServer-prod.classic.js +0.69% 207.78 kB 209.22 kB +0.28% 38.16 kB 38.26 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.65% 197.83 kB 199.12 kB +0.30% 36.73 kB 36.84 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.65% 197.83 kB 199.12 kB +0.30% 36.73 kB 36.84 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.65% 197.85 kB 199.14 kB +0.30% 36.75 kB 36.86 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.node.production.js +0.64% 202.22 kB 203.51 kB +0.29% 38.46 kB 38.57 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.js +0.64% 202.22 kB 203.51 kB +0.29% 38.46 kB 38.57 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.js +0.64% 202.24 kB 203.53 kB +0.29% 38.49 kB 38.60 kB
facebook-www/ReactDOMServer-prod.modern.js +0.63% 205.51 kB 206.80 kB +0.28% 37.81 kB 37.92 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.62% 212.07 kB 213.39 kB +0.32% 38.71 kB 38.83 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.js +0.61% 217.02 kB 218.33 kB +0.32% 40.56 kB 40.69 kB
oss-stable-rc/react-dom/cjs/react-dom-server.bun.production.js +0.51% 202.09 kB 203.12 kB +0.22% 37.89 kB 37.97 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.js +0.51% 202.09 kB 203.12 kB +0.22% 37.89 kB 37.97 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.js +0.51% 202.15 kB 203.18 kB +0.22% 37.91 kB 38.00 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js +0.49% 210.00 kB 211.03 kB +0.21% 39.34 kB 39.42 kB
oss-stable-rc/react-dom/cjs/react-dom-server.browser.production.js +0.48% 213.58 kB 214.61 kB +0.19% 39.10 kB 39.17 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.js +0.48% 213.58 kB 214.61 kB +0.19% 39.10 kB 39.17 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js +0.48% 217.99 kB 219.05 kB +0.26% 39.99 kB 40.09 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.js +0.48% 213.65 kB 214.68 kB +0.19% 39.12 kB 39.19 kB
oss-stable-rc/react-dom/cjs/react-dom-server.node.production.js +0.48% 214.31 kB 215.34 kB +0.20% 39.70 kB 39.78 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.js +0.48% 214.31 kB 215.34 kB +0.20% 39.70 kB 39.78 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.js +0.48% 214.37 kB 215.40 kB +0.20% 39.72 kB 39.80 kB
oss-stable-rc/react-dom/cjs/react-dom-server.edge.production.js +0.47% 218.46 kB 219.49 kB +0.20% 40.96 kB 41.04 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.js +0.47% 218.46 kB 219.49 kB +0.20% 40.96 kB 41.04 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.js +0.47% 218.52 kB 219.55 kB +0.20% 40.98 kB 41.06 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.node.development.js +0.45% 341.68 kB 343.22 kB +0.23% 62.91 kB 63.06 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js +0.45% 341.68 kB 343.22 kB +0.23% 62.91 kB 63.06 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.45% 341.68 kB 343.23 kB +0.23% 62.91 kB 63.06 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.45% 341.68 kB 343.23 kB +0.23% 62.91 kB 63.06 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js +0.45% 341.70 kB 343.25 kB +0.23% 62.93 kB 63.08 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.45% 341.70 kB 343.25 kB +0.23% 62.93 kB 63.08 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js +0.45% 366.72 kB 368.38 kB +0.38% 66.09 kB 66.33 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.45% 366.72 kB 368.38 kB +0.37% 66.09 kB 66.33 kB
facebook-www/ReactDOMServer-dev.classic.js +0.44% 358.44 kB 360.03 kB +0.14% 65.36 kB 65.46 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.js +0.44% 237.83 kB 238.88 kB +0.25% 42.00 kB 42.10 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.js +0.44% 239.19 kB 240.24 kB +0.24% 43.22 kB 43.32 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.js +0.43% 243.26 kB 244.31 kB +0.22% 43.97 kB 44.07 kB
oss-experimental/react-html/cjs/react-html.production.js +0.42% 200.27 kB 201.11 kB +0.11% 37.89 kB 37.93 kB
facebook-www/ReactDOMServer-dev.modern.js +0.42% 351.70 kB 353.17 kB +0.20% 64.27 kB 64.39 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js +0.37% 327.55 kB 328.75 kB +0.25% 63.06 kB 63.22 kB
oss-stable-rc/react-dom/cjs/react-dom-server.bun.development.js +0.36% 304.37 kB 305.48 kB +0.18% 59.88 kB 59.99 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js +0.36% 304.37 kB 305.48 kB +0.18% 59.88 kB 59.99 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js +0.36% 304.43 kB 305.54 kB +0.19% 59.90 kB 60.01 kB
oss-stable-rc/react-dom/cjs/react-dom-server.node.development.js +0.35% 348.89 kB 350.10 kB +0.20% 63.51 kB 63.63 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js +0.35% 348.89 kB 350.10 kB +0.20% 63.51 kB 63.63 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js +0.35% 348.95 kB 350.16 kB +0.20% 63.53 kB 63.66 kB
oss-stable-rc/react-dom/cjs/react-dom-server.browser.development.js +0.34% 353.78 kB 354.99 kB +0.20% 64.81 kB 64.95 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js +0.34% 353.78 kB 354.99 kB +0.20% 64.81 kB 64.95 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js +0.34% 353.84 kB 355.05 kB +0.20% 64.84 kB 64.97 kB
oss-stable-rc/react-dom/cjs/react-dom-server.edge.development.js +0.34% 354.32 kB 355.54 kB +0.20% 64.92 kB 65.05 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js +0.34% 354.32 kB 355.54 kB +0.20% 64.92 kB 65.05 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js +0.34% 354.39 kB 355.60 kB +0.20% 64.94 kB 65.07 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js +0.34% 385.06 kB 386.38 kB +0.31% 68.29 kB 68.50 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js +0.34% 389.60 kB 390.91 kB +0.31% 68.77 kB 68.98 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js +0.34% 390.14 kB 391.46 kB +0.30% 68.87 kB 69.08 kB
oss-experimental/react-html/cjs/react-html.development.js +0.33% 338.71 kB 339.85 kB +0.29% 61.91 kB 62.08 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js +0.33% 344.13 kB 345.27 kB +0.18% 63.09 kB 63.20 kB
oss-experimental/react-html/cjs/react-html.react-server.production.js +0.28% 296.67 kB 297.52 kB +0.08% 56.32 kB 56.36 kB
oss-experimental/react-html/cjs/react-html.react-server.development.js +0.23% 491.54 kB 492.68 kB +0.21% 88.60 kB 88.79 kB

Generated by 🚫 dangerJS against 762d139

@gnoff gnoff force-pushed the fizz-prerender-fallbacks-first branch from 280cbe4 to bb110b1 Compare July 26, 2024 16:53
When prerendering it can be convenient to abort the prerender while rendering. However if any Suspense fallbacks have not yet rendered before the abort happens the fallback itself will error and cause the nearest parent Suspense boundary to render a fallback instead. Prerenders are by definition not time critical so the prioritization of children over fallbacks which makes sense for render isn't similarly motivated for prerender. Given this, this change updates fallback rendering during a prerender to attempt the fallback before attempting children.
@gnoff gnoff force-pushed the fizz-prerender-fallbacks-first branch from 2a0e690 to 762d139 Compare July 26, 2024 20:58
@gnoff gnoff merged commit d17e9d1 into facebook:main Jul 26, 2024
187 checks passed
@gnoff gnoff deleted the fizz-prerender-fallbacks-first branch July 26, 2024 21:06
github-actions bot pushed a commit that referenced this pull request Jul 26, 2024
When prerendering it can be convenient to abort the prerender while
rendering. However if any Suspense fallbacks have not yet rendered
before the abort happens the fallback itself will error and cause the
nearest parent Suspense boundary to render a fallback instead.
Prerenders are by definition not time critical so the prioritization of
children over fallbacks which makes sense for render isn't similarly
motivated for prerender. Given this, this change updates fallback
rendering during a prerender to attempt the fallback before attempting
children.

DiffTrain build for [d17e9d1](d17e9d1)
github-actions bot pushed a commit to surenpoghosian/react that referenced this pull request Jul 28, 2024
When prerendering it can be convenient to abort the prerender while
rendering. However if any Suspense fallbacks have not yet rendered
before the abort happens the fallback itself will error and cause the
nearest parent Suspense boundary to render a fallback instead.
Prerenders are by definition not time critical so the prioritization of
children over fallbacks which makes sense for render isn't similarly
motivated for prerender. Given this, this change updates fallback
rendering during a prerender to attempt the fallback before attempting
children.

DiffTrain build for commit facebook@d17e9d1.
github-actions bot pushed a commit to surenpoghosian/react that referenced this pull request Jul 28, 2024
When prerendering it can be convenient to abort the prerender while
rendering. However if any Suspense fallbacks have not yet rendered
before the abort happens the fallback itself will error and cause the
nearest parent Suspense boundary to render a fallback instead.
Prerenders are by definition not time critical so the prioritization of
children over fallbacks which makes sense for render isn't similarly
motivated for prerender. Given this, this change updates fallback
rendering during a prerender to attempt the fallback before attempting
children.

DiffTrain build for [d17e9d1](facebook@d17e9d1)
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