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][Static] when aborting a prerender halt unfinished boundaries instead of erroring #30732

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Aug 17, 2024

When we introduced prerendering for flight we modeled an abort of a flight prerender as having unfinished rows. This is similar to how postpone was already implemented when you postponed from "within" a prerender using React.unstable_postpone. However when aborting with a postponed instance every boundary would be eagerly marked for client rendering which is more akin to prerendering and then resuming with an aborted signal.

The insight with the flight work was that it's not so much the postpone that describes the intended semantics but the abort combined with a prerender. So like in flight when you abort a prerender and enableHalt is enabled boundaries and the shell won't error for any reason. Fizz will still call onPostpone and onError according to the abort reason but the consuemr of the prerender should expect to resume it before trying to use it.

Copy link

vercel bot commented Aug 17, 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 20, 2024 5:59pm

@react-sizebot
Copy link

react-sizebot commented Aug 17, 2024

Comparing: 92d26c8...4e5f208

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 = 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-experimental/react-server/cjs/react-server.production.js +1.89% 118.63 kB 120.88 kB +0.95% 21.43 kB 21.63 kB
oss-experimental/react-server/cjs/react-server.development.js +1.68% 172.80 kB 175.70 kB +0.69% 31.18 kB 31.39 kB
oss-experimental/react-markup/cjs/react-markup.production.js +0.99% 203.45 kB 205.47 kB +0.49% 38.27 kB 38.46 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.js +0.94% 215.37 kB 217.39 kB +0.51% 39.13 kB 39.33 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.js +0.92% 220.33 kB 222.35 kB +0.51% 40.99 kB 41.20 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js +0.91% 221.05 kB 223.07 kB +0.50% 40.41 kB 40.61 kB
oss-experimental/react-markup/cjs/react-markup.development.js +0.85% 342.10 kB 345.00 kB +0.32% 62.40 kB 62.60 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.js +0.84% 240.86 kB 242.88 kB +0.46% 42.41 kB 42.60 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.js +0.83% 242.24 kB 244.26 kB +0.43% 43.65 kB 43.84 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.js +0.82% 246.31 kB 248.33 kB +0.44% 44.39 kB 44.58 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js +0.79% 370.70 kB 373.61 kB +0.30% 66.69 kB 66.89 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.79% 370.70 kB 373.62 kB +0.30% 66.69 kB 66.89 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js +0.76% 330.90 kB 333.41 kB +0.31% 63.59 kB 63.78 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js +0.75% 388.70 kB 391.62 kB +0.28% 68.88 kB 69.07 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js +0.74% 393.26 kB 396.17 kB +0.28% 69.36 kB 69.55 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js +0.74% 393.81 kB 396.72 kB +0.28% 69.45 kB 69.64 kB
oss-experimental/react-markup/cjs/react-markup.react-server.production.js +0.67% 304.25 kB 306.28 kB +0.32% 57.22 kB 57.40 kB
oss-experimental/react-markup/cjs/react-markup.react-server.development.js +0.57% 504.59 kB 507.49 kB +0.23% 90.35 kB 90.55 kB

Generated by 🚫 dangerJS against bf19314

@gnoff gnoff force-pushed the halt-fizz-prerenders branch from a245cd3 to 31fa415 Compare August 19, 2024 23:00
@gnoff gnoff force-pushed the halt-fizz-prerenders branch from 31fa415 to 007cea5 Compare August 20, 2024 15:14
@gnoff gnoff force-pushed the halt-fizz-prerenders branch from 007cea5 to 981f745 Compare August 20, 2024 17:10
@gnoff gnoff marked this pull request as ready for review August 20, 2024 17:10
@gnoff gnoff changed the title [Fizz][Static] use halt rather than error when aborting a Fizz prerender when enableHalt is on [Fizz][Static] when aborting a prerender halt unfinished boundaries instead of erroring Aug 20, 2024
@gnoff gnoff force-pushed the halt-fizz-prerenders branch from 981f745 to e945509 Compare August 20, 2024 17:22
@gnoff gnoff force-pushed the halt-fizz-prerenders branch from e945509 to 2771d29 Compare August 20, 2024 17:38
@gnoff gnoff force-pushed the halt-fizz-prerenders branch from 2771d29 to 80355ac Compare August 20, 2024 17:50
@gnoff gnoff requested a review from sebmarkbage August 20, 2024 17:50
…nstead of erroring

When we introduces prerendering for flight we modeled an abort of a flight prerender as having unfinished rows. This is similar to how postpone was already implemented when you postponed from "within" a prerender using React.unstable_postpone. However when aborting with a postponed instance every boundary would be eagerly marked for client rendering which is more akin to prerendering and then resuming with an aborted signal.

The insight with the flight work was that it's not so much the postpone that describes the intended semantics but the abort combined with a prerender. So like in flight when you abort a prerender and enableHalt is enabled boundaries and the shell won't error for any reason. Fizz will still call onPostpone and onError according to the abort reason but the consuemr of the prerender should expect to resume it before trying to use it.
@gnoff gnoff merged commit 85180b8 into facebook:main Aug 20, 2024
185 checks passed
@gnoff gnoff deleted the halt-fizz-prerenders branch August 20, 2024 20:30
github-actions bot pushed a commit that referenced this pull request Aug 20, 2024
…nstead of erroring (#30732)

When we introduced prerendering for flight we modeled an abort of a
flight prerender as having unfinished rows. This is similar to how
postpone was already implemented when you postponed from "within" a
prerender using React.unstable_postpone. However when aborting with a
postponed instance every boundary would be eagerly marked for client
rendering which is more akin to prerendering and then resuming with an
aborted signal.

The insight with the flight work was that it's not so much the postpone
that describes the intended semantics but the abort combined with a
prerender. So like in flight when you abort a prerender and enableHalt
is enabled boundaries and the shell won't error for any reason. Fizz
will still call onPostpone and onError according to the abort reason but
the consuemr of the prerender should expect to resume it before trying
to use it.

DiffTrain build for [85180b8](85180b8)
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