GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Fizz] Split ResponseState/Resources into RenderState/ResumableState by sebmarkbage · Pull Request #27268 · react/react

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

This exposes a resume() API to go with the prerender() (only in experimental). It doesn't work yet since we don't yet emit the postponed state so not yet tested.

The main thing this does is rename ResponseState->RenderState and Resources->ResumableState. We separated out resources into a separate concept preemptively since it seemed like separate enough but probably doesn't warrant being a separate concept. The result is that we have a per RenderState in the Config which is really just temporary state and things that must be flushed completely in the prerender. Most things should be ResumableState.

Most options are specified in the prerender() and transferred into the resume() but certain options that are unique per request can't be. Notably nonce is special. This means that bootstrap scripts and external runtime can't use nonce in this mode. They need to have a CSP configured to deal with external scripts, but not inline.

We need to be able to restore state of things that we've already emitted in the prerender. We could have separate snapshot/restore methods that does this work when it happens but that means we have to explicitly do that work. This design is trying to keep to the principle that we just work with resumable data structures instead so that we're designing for it with every feature. It also makes restoring faster since it's just straight into the data structure.

This is not yet a serializable format. That can be done in a follow up.

We also need to vet that each step makes sense. Notably stylesToHoist is a bit unclear how it'll work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sebmarkbage
sebmarkbage requested a review from gnoff August 22, 2023 16:31
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Aug 22, 2023
@sebmarkbage
sebmarkbage force-pushed the fizzresume branch 2 times, most recently from e6300e8 to e9feaab Compare August 22, 2023 16:41
@react-sizebot

react-sizebot commented Aug 22, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: 86198b9...92d4029

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 = 165.59 kB 165.59 kB = 51.88 kB 51.88 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 173.15 kB 173.15 kB = 54.20 kB 54.20 kB
facebook-www/ReactDOM-prod.classic.js = 569.82 kB 569.82 kB = 100.37 kB 100.37 kB
facebook-www/ReactDOM-prod.modern.js = 553.62 kB 553.62 kB = 97.53 kB 97.53 kB
oss-experimental/react-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-stable-semver/react-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-stable/react-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-experimental/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-stable-semver/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-stable/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-experimental/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-stable-semver/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-stable/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-experimental/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
oss-stable-semver/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
oss-stable/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
facebook-www/ReactDOMServer-prod.modern.js +3.96% 148.20 kB 154.08 kB +3.42% 26.95 kB 27.87 kB
facebook-www/ReactDOMServer-prod.classic.js +3.94% 148.94 kB 154.81 kB +3.37% 27.18 kB 28.10 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.78% 60.90 kB 62.59 kB +3.20% 18.15 kB 18.73 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.78% 60.93 kB 62.62 kB +3.20% 18.17 kB 18.75 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.77% 61.06 kB 62.75 kB +3.00% 18.49 kB 19.04 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.77% 61.09 kB 62.78 kB +2.98% 18.51 kB 19.06 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.70% 62.95 kB 64.64 kB +2.98% 18.94 kB 19.51 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.69% 63.10 kB 64.80 kB +2.74% 19.36 kB 19.89 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.60% 65.76 kB 67.48 kB +2.76% 19.79 kB 20.34 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.60% 65.79 kB 67.50 kB +2.76% 19.82 kB 20.36 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.53% 67.92 kB 69.64 kB +2.52% 20.64 kB 21.16 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-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-stable-semver/react-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-stable/react-dom/server.node.js +7.28% 0.65 kB 0.69 kB +7.20% 0.25 kB 0.27 kB
oss-experimental/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-stable-semver/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-stable/react-dom/server.bun.js +7.19% 0.65 kB 0.70 kB +7.42% 0.26 kB 0.28 kB
oss-experimental/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-stable-semver/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-stable/react-dom/server.edge.js +7.16% 0.66 kB 0.70 kB +7.78% 0.26 kB 0.28 kB
oss-experimental/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
oss-stable-semver/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
oss-stable/react-dom/server.browser.js +7.14% 0.66 kB 0.71 kB +6.72% 0.25 kB 0.27 kB
facebook-www/ReactDOMServer-prod.modern.js +3.96% 148.20 kB 154.08 kB +3.42% 26.95 kB 27.87 kB
facebook-www/ReactDOMServer-prod.classic.js +3.94% 148.94 kB 154.81 kB +3.37% 27.18 kB 28.10 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.78% 60.90 kB 62.59 kB +3.20% 18.15 kB 18.73 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.78% 60.93 kB 62.62 kB +3.20% 18.17 kB 18.75 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.77% 61.06 kB 62.75 kB +3.00% 18.49 kB 19.04 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.77% 61.09 kB 62.78 kB +2.98% 18.51 kB 19.06 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.70% 62.95 kB 64.64 kB +2.98% 18.94 kB 19.51 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.69% 63.10 kB 64.80 kB +2.74% 19.36 kB 19.89 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.60% 65.76 kB 67.48 kB +2.76% 19.79 kB 20.34 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.60% 65.79 kB 67.50 kB +2.76% 19.82 kB 20.36 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.53% 67.92 kB 69.64 kB +2.52% 20.64 kB 21.16 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js +1.43% 64.62 kB 65.55 kB +0.82% 20.08 kB 20.25 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js +1.42% 64.77 kB 65.69 kB +0.74% 20.31 kB 20.47 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js +1.37% 69.06 kB 70.00 kB +1.12% 21.56 kB 21.80 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js +1.29% 68.96 kB 69.85 kB +0.74% 21.56 kB 21.72 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js +0.99% 355.12 kB 358.64 kB +0.35% 79.97 kB 80.25 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js +0.99% 355.53 kB 359.05 kB +0.35% 80.10 kB 80.38 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js +0.98% 372.19 kB 375.82 kB +0.34% 80.85 kB 81.12 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js +0.84% 356.60 kB 359.58 kB +0.35% 80.02 kB 80.30 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js +0.83% 154.91 kB 156.20 kB +0.38% 28.69 kB 28.80 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js +0.49% 348.26 kB 349.96 kB +0.38% 77.02 kB 77.32 kB
oss-experimental/react-dom/cjs/react-dom-static.node.development.js +0.48% 356.56 kB 358.26 kB +0.32% 80.11 kB 80.36 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.development.js +0.48% 354.42 kB 356.12 kB +0.32% 79.78 kB 80.04 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.development.js +0.48% 354.83 kB 356.53 kB +0.32% 79.91 kB 80.17 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js +0.46% 25.40 kB 25.52 kB +0.23% 8.65 kB 8.67 kB
oss-stable/react-server/cjs/react-server.production.min.js +0.46% 25.40 kB 25.52 kB +0.23% 8.65 kB 8.67 kB
oss-experimental/react-server/cjs/react-server.production.min.js +0.45% 26.03 kB 26.15 kB +0.25% 8.86 kB 8.89 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js +0.45% 352.92 kB 354.49 kB +0.26% 79.29 kB 79.50 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js +0.44% 342.34 kB 343.85 kB +0.39% 76.89 kB 77.19 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js +0.44% 342.37 kB 343.88 kB +0.39% 76.92 kB 77.22 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js +0.44% 345.12 kB 346.63 kB +0.39% 77.79 kB 78.09 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js +0.44% 345.14 kB 346.65 kB +0.38% 77.82 kB 78.12 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js +0.44% 345.53 kB 347.04 kB +0.39% 77.91 kB 78.22 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js +0.44% 345.55 kB 347.06 kB +0.39% 77.94 kB 78.25 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js +0.44% 346.59 kB 348.11 kB +0.38% 77.83 kB 78.13 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js +0.44% 346.62 kB 348.13 kB +0.38% 77.86 kB 78.16 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js +0.42% 361.74 kB 363.27 kB +0.31% 78.72 kB 78.96 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js +0.42% 361.77 kB 363.30 kB +0.31% 78.75 kB 78.99 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js +0.39% 64.50 kB 64.76 kB +0.41% 20.03 kB 20.11 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js +0.39% 64.83 kB 65.08 kB +0.48% 20.13 kB 20.23 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js +0.39% 63.28 kB 63.53 kB +0.41% 19.78 kB 19.87 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js +0.39% 63.31 kB 63.56 kB +0.41% 19.81 kB 19.89 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js +0.39% 63.13 kB 63.38 kB +0.34% 19.53 kB 19.60 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js +0.39% 63.16 kB 63.40 kB +0.33% 19.56 kB 19.62 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js +0.39% 65.50 kB 65.75 kB +0.45% 19.93 kB 20.02 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js +0.39% 65.52 kB 65.78 kB +0.45% 19.96 kB 20.05 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js +0.38% 67.65 kB 67.91 kB +0.48% 20.77 kB 20.87 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js +0.37% 69.03 kB 69.29 kB +0.36% 21.59 kB 21.67 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js +0.37% 67.36 kB 67.61 kB +0.29% 20.96 kB 21.02 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js +0.37% 67.39 kB 67.63 kB +0.28% 20.99 kB 21.05 kB
facebook-www/ReactDOMServer-dev.modern.js +0.34% 353.52 kB 354.72 kB +0.24% 78.28 kB 78.46 kB
facebook-www/ReactDOMServer-dev.classic.js +0.33% 360.94 kB 362.15 kB +0.22% 79.93 kB 80.10 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js +0.33% 357.78 kB 358.95 kB +0.12% 80.33 kB 80.43 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js +0.32% 347.19 kB 348.31 kB +0.23% 77.94 kB 78.12 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js +0.32% 347.22 kB 348.34 kB +0.23% 77.97 kB 78.15 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js +0.31% 67.46 kB 67.67 kB +0.32% 20.96 kB 21.03 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js +0.31% 67.49 kB 67.70 kB +0.32% 20.99 kB 21.06 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.31% 355.95 kB 357.04 kB +0.13% 79.87 kB 79.98 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.30% 345.37 kB 346.40 kB +0.24% 77.48 kB 77.66 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.30% 345.39 kB 346.43 kB +0.23% 77.51 kB 77.69 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js +0.30% 373.03 kB 374.13 kB +0.11% 80.72 kB 80.81 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js +0.29% 362.00 kB 363.04 kB +0.17% 78.36 kB 78.49 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js +0.29% 362.03 kB 363.07 kB +0.16% 78.38 kB 78.51 kB
oss-stable-semver/react-server/cjs/react-server.development.js +0.21% 148.13 kB 148.43 kB +0.15% 36.92 kB 36.97 kB
oss-stable/react-server/cjs/react-server.development.js +0.21% 148.13 kB 148.43 kB +0.15% 36.92 kB 36.97 kB
oss-experimental/react-server/cjs/react-server.development.js +0.20% 150.11 kB 150.42 kB +0.14% 37.35 kB 37.40 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-server.development.js = 6.50 kB 6.42 kB = 1.80 kB 1.79 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-server.development.js = 6.50 kB 6.42 kB = 1.80 kB 1.79 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-server.development.js = 6.50 kB 6.42 kB = 1.80 kB 1.79 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-server.production.min.js = 3.23 kB 3.19 kB = 1.22 kB 1.22 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-server.production.min.js = 3.23 kB 3.19 kB = 1.22 kB 1.22 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-server.production.min.js = 3.23 kB 3.19 kB = 1.22 kB 1.22 kB

Generated by 🚫 dangerJS against 92d4029

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage
sebmarkbage force-pushed the fizzresume branch from e9feaab to 2072780 Compare August 22, 2023 16:46
gnoff
gnoff approved these changes Aug 22, 2023
View reviewed changes
Comment thread packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
// Per request, global state that is not contextual to the rendering subtree.
// This cannot be resumed and therefore should only contain things that are
// temporary working state or are never used in the prerender pass.
export type RenderState = {

@gnoff gnoff Aug 22, 2023

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this missing stylesToHoist?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sebmarkbage sebmarkbage Aug 22, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
hoistableChunks: Array<Chunk | PrecomputedChunk>,

// Module-global-like reference for current boundary resources
boundaryResources: ?BoundaryResources,

@gnoff gnoff Aug 22, 2023

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's surprising in a way that BoundaryResources would be render state. maybe worth clarifying here why this is possible?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sebmarkbage added 6 commits August 22, 2023 14:56
@sebmarkbage
Add postponed result to store resumable state
f90fba7
@sebmarkbage
NodeStreams -> NodeStream
ffcd249
This was plural because in the future the result can contain multiple
streams but since it's mostly just one primary one it seems more confusion
that it's not similar to the other API.
@sebmarkbage
Add resume API
504e951
@sebmarkbage
Split ResponseState/Resources into RenderState/ResumableState
e627723
@sebmarkbage
Expose resume() API but not in stable
c5abf7a
Since we don't have a top level module for these we have to introduce one
that we can fork.
@sebmarkbage
Reunify createRequest
92d4029
We can split these at the startWork layer instead.
@sebmarkbage
sebmarkbage force-pushed the fizzresume branch from 0528ab5 to 92d4029 Compare August 22, 2023 18:58
@sebmarkbage
sebmarkbage merged commit 31034b6 into react:main Aug 22, 2023
github-actions Bot pushed a commit that referenced this pull request Aug 22, 2023
@sebmarkbage
[Fizz] Split ResponseState/Resources into RenderState/ResumableState (#…
ff6e098
…27268)

This exposes a `resume()` API to go with the `prerender()` (only in
experimental). It doesn't work yet since we don't yet emit the postponed
state so not yet tested.

The main thing this does is rename ResponseState->RenderState and
Resources->ResumableState. We separated out resources into a separate
concept preemptively since it seemed like separate enough but probably
doesn't warrant being a separate concept. The result is that we have a
per RenderState in the Config which is really just temporary state and
things that must be flushed completely in the prerender. Most things
should be ResumableState.

Most options are specified in the `prerender()` and transferred into the
`resume()` but certain options that are unique per request can't be.
Notably `nonce` is special. This means that bootstrap scripts and
external runtime can't use `nonce` in this mode. They need to have a CSP
configured to deal with external scripts, but not inline.

We need to be able to restore state of things that we've already emitted
in the prerender. We could have separate snapshot/restore methods that
does this work when it happens but that means we have to explicitly do
that work. This design is trying to keep to the principle that we just
work with resumable data structures instead so that we're designing for
it with every feature. It also makes restoring faster since it's just
straight into the data structure.

This is not yet a serializable format. That can be done in a follow up.

We also need to vet that each step makes sense. Notably stylesToHoist is
a bit unclear how it'll work.

DiffTrain build for [31034b6](31034b6)
@acdlite acdlite mentioned this pull request Sep 14, 2023
Update React from dd480ef92 to d6dcad6a8. vercel/next.js#55399
Merged
acdlite added a commit to acdlite/next.js that referenced this pull request Sep 14, 2023
@acdlite
Update React from dd480ef92 to d6dcad6a8.
7e8e320
React upstream changes:

- react/react#27374
- react/react#27369
- react/react#27372
- react/react#27371
- react/react#27370
- react/react#27321
- react/react#27368
- react/react#27367
- react/react#27366
- react/react#27360
- react/react#27361
- react/react#27357
- react/react#27359
- react/react#27358
- react/react#27330
- react/react#27347
- react/react#27307
- react/react#27346
- react/react#27342
- react/react#27340
- react/react#27328
- react/react#27327
- react/react#27325
- react/react#27337
- react/react#27336
- react/react#27323
- react/react#27320
- react/react#27317
- react/react#27318
- react/react#27316
- react/react#27313
- react/react#27309
- react/react#27302
- react/react#27297
- react/react#27295
- react/react#27305
- react/react#27215
- react/react#27304
- react/react#27067
- react/react#27179
- react/react#27278
- react/react#27277
- react/react#27282
- react/react#27230
- react/react#27260
- react/react#27270
- react/react#27273
- react/react#27268
- react/react#27269
kodiakhq Bot pushed a commit to vercel/next.js that referenced this pull request Sep 14, 2023
@acdlite
Update React from dd480ef92 to d6dcad6a8. (#55399)
6f2e9ae
### React upstream changes:

- react/react#27374
- react/react#27369
- react/react#27372
- react/react#27371
- react/react#27370
- react/react#27321
- react/react#27368
- react/react#27367
- react/react#27366
- react/react#27360
- react/react#27361
- react/react#27357
- react/react#27359
- react/react#27358
- react/react#27330
- react/react#27347
- react/react#27307
- react/react#27346
- react/react#27342
- react/react#27340
- react/react#27328
- react/react#27327
- react/react#27325
- react/react#27337
- react/react#27336
- react/react#27323
- react/react#27320
- react/react#27317
- react/react#27318
- react/react#27316
- react/react#27313
- react/react#27309
- react/react#27302
- react/react#27297
- react/react#27295
- react/react#27305
- react/react#27215
- react/react#27304
- react/react#27067
- react/react#27179
- react/react#27278
- react/react#27277
- react/react#27282
- react/react#27230
- react/react#27260
- react/react#27270
- react/react#27273
- react/react#27268
- react/react#27269
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@sebmarkbage @AndyPengc12
[Fizz] Split ResponseState/Resources into RenderState/ResumableState (r…
ce0b700
…eact#27268)

This exposes a `resume()` API to go with the `prerender()` (only in
experimental). It doesn't work yet since we don't yet emit the postponed
state so not yet tested.

The main thing this does is rename ResponseState->RenderState and
Resources->ResumableState. We separated out resources into a separate
concept preemptively since it seemed like separate enough but probably
doesn't warrant being a separate concept. The result is that we have a
per RenderState in the Config which is really just temporary state and
things that must be flushed completely in the prerender. Most things
should be ResumableState.

Most options are specified in the `prerender()` and transferred into the
`resume()` but certain options that are unique per request can't be.
Notably `nonce` is special. This means that bootstrap scripts and
external runtime can't use `nonce` in this mode. They need to have a CSP
configured to deal with external scripts, but not inline.

We need to be able to restore state of things that we've already emitted
in the prerender. We could have separate snapshot/restore methods that
does this work when it happens but that means we have to explicitly do
that work. This design is trying to keep to the principle that we just
work with resumable data structures instead so that we're designing for
it with every feature. It also makes restoring faster since it's just
straight into the data structure.

This is not yet a serializable format. That can be done in a follow up.

We also need to vet that each step makes sense. Notably stylesToHoist is
a bit unclear how it'll work.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@sebmarkbage
[Fizz] Split ResponseState/Resources into RenderState/ResumableState (#…
5dbb6a2
…27268)

This exposes a `resume()` API to go with the `prerender()` (only in
experimental). It doesn't work yet since we don't yet emit the postponed
state so not yet tested.

The main thing this does is rename ResponseState->RenderState and
Resources->ResumableState. We separated out resources into a separate
concept preemptively since it seemed like separate enough but probably
doesn't warrant being a separate concept. The result is that we have a
per RenderState in the Config which is really just temporary state and
things that must be flushed completely in the prerender. Most things
should be ResumableState.

Most options are specified in the `prerender()` and transferred into the
`resume()` but certain options that are unique per request can't be.
Notably `nonce` is special. This means that bootstrap scripts and
external runtime can't use `nonce` in this mode. They need to have a CSP
configured to deal with external scripts, but not inline.

We need to be able to restore state of things that we've already emitted
in the prerender. We could have separate snapshot/restore methods that
does this work when it happens but that means we have to explicitly do
that work. This design is trying to keep to the principle that we just
work with resumable data structures instead so that we're designing for
it with every feature. It also makes restoring faster since it's just
straight into the data structure.

This is not yet a serializable format. That can be done in a follow up.

We also need to vet that each step makes sense. Notably stylesToHoist is
a bit unclear how it'll work.

DiffTrain build for commit 31034b6.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
[Fizz] Split ResponseState/Resources into RenderState/ResumableState (r…
7334883
…eact#27268)

This exposes a `resume()` API to go with the `prerender()` (only in
experimental). It doesn't work yet since we don't yet emit the postponed
state so not yet tested.

The main thing this does is rename ResponseState->RenderState and
Resources->ResumableState. We separated out resources into a separate
concept preemptively since it seemed like separate enough but probably
doesn't warrant being a separate concept. The result is that we have a
per RenderState in the Config which is really just temporary state and
things that must be flushed completely in the prerender. Most things
should be ResumableState.

Most options are specified in the `prerender()` and transferred into the
`resume()` but certain options that are unique per request can't be.
Notably `nonce` is special. This means that bootstrap scripts and
external runtime can't use `nonce` in this mode. They need to have a CSP
configured to deal with external scripts, but not inline.

We need to be able to restore state of things that we've already emitted
in the prerender. We could have separate snapshot/restore methods that
does this work when it happens but that means we have to explicitly do
that work. This design is trying to keep to the principle that we just
work with resumable data structures instead so that we're designing for
it with every feature. It also makes restoring faster since it's just
straight into the data structure.

This is not yet a serializable format. That can be done in a follow up.

We also need to vet that each step makes sense. Notably stylesToHoist is
a bit unclear how it'll work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnoff gnoff gnoff approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sebmarkbage @react-sizebot @gnoff @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.