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

[Static][Fizz] Carry forward bootstrap config to resume if postponing in the shell #27672

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Nov 8, 2023

Previously it was possible to postpone in the shell during a prerender and then during a resume the bootstrap scripts would not be emitted leading to no hydration on the client. This change moves the bootstrap configuration to ResumableState where it can be serialized after postponing if it wasn't flushed as part of the static shell.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Nov 8, 2023
…r and then during a resume the bootstrap scripts would not be emitted leading to no hydration on the client. This change moves the bootstrap configuration to ResumableState where it can be serialized after postponing if it wasn't flushed as part of the static shell.
@react-sizebot
Copy link

Comparing: 88b00de...269ac62

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 = 175.90 kB 175.90 kB = 54.75 kB 54.75 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 177.97 kB 177.97 kB = 55.39 kB 55.39 kB
facebook-www/ReactDOM-prod.classic.js = 569.66 kB 569.66 kB = 100.26 kB 100.26 kB
facebook-www/ReactDOM-prod.modern.js = 553.51 kB 553.51 kB = 97.35 kB 97.35 kB
facebook-www/ReactDOMServer-prod.modern.js +2.33% 185.80 kB 190.12 kB +2.23% 33.53 kB 34.28 kB
facebook-www/ReactDOMServer-prod.classic.js +2.30% 187.67 kB 191.99 kB +2.20% 33.87 kB 34.61 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.17% 75.42 kB 77.06 kB +2.03% 22.89 kB 23.36 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.17% 75.45 kB 77.08 kB +2.03% 22.92 kB 23.38 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.16% 75.49 kB 77.12 kB +2.07% 23.29 kB 23.78 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.16% 75.51 kB 77.15 kB +2.08% 23.32 kB 23.80 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.09% 78.05 kB 79.68 kB +2.03% 23.68 kB 24.16 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.09% 78.11 kB 79.75 kB +2.11% 24.04 kB 24.54 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.02% 81.04 kB 82.67 kB +2.11% 24.73 kB 25.25 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.02% 81.06 kB 82.70 kB +2.10% 24.75 kB 25.27 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactDOMServer-prod.modern.js +2.33% 185.80 kB 190.12 kB +2.23% 33.53 kB 34.28 kB
facebook-www/ReactDOMServer-prod.classic.js +2.30% 187.67 kB 191.99 kB +2.20% 33.87 kB 34.61 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.17% 75.42 kB 77.06 kB +2.03% 22.89 kB 23.36 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.17% 75.45 kB 77.08 kB +2.03% 22.92 kB 23.38 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.16% 75.49 kB 77.12 kB +2.07% 23.29 kB 23.78 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.16% 75.51 kB 77.15 kB +2.08% 23.32 kB 23.80 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +2.09% 78.05 kB 79.68 kB +2.03% 23.68 kB 24.16 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +2.09% 78.11 kB 79.75 kB +2.11% 24.04 kB 24.54 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.02% 81.04 kB 82.67 kB +2.11% 24.73 kB 25.25 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2.02% 81.06 kB 82.70 kB +2.10% 24.75 kB 25.27 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +1.94% 84.03 kB 85.66 kB +1.93% 25.57 kB 26.06 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js +0.30% 77.79 kB 78.02 kB +0.14% 24.18 kB 24.21 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js +0.30% 77.81 kB 78.04 kB +0.14% 24.20 kB 24.23 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js +0.30% 77.84 kB 78.07 kB +0.08% 24.59 kB 24.60 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js +0.30% 77.87 kB 78.10 kB +0.08% 24.61 kB 24.63 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js +0.29% 79.40 kB 79.63 kB +0.20% 24.04 kB 24.08 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js +0.29% 79.43 kB 79.66 kB +0.20% 24.06 kB 24.11 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js +0.28% 82.39 kB 82.62 kB +0.19% 24.85 kB 24.90 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js +0.28% 82.86 kB 83.09 kB +0.16% 25.85 kB 25.89 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js +0.28% 82.88 kB 83.12 kB +0.16% 25.87 kB 25.91 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js +0.27% 81.03 kB 81.25 kB +0.21% 24.95 kB 25.01 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js +0.27% 81.05 kB 81.27 kB +0.21% 24.98 kB 25.03 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js +0.26% 83.86 kB 84.08 kB +0.08% 26.03 kB 26.05 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js +0.26% 83.82 kB 84.04 kB +0.14% 25.66 kB 25.70 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js +0.25% 87.49 kB 87.71 kB +0.12% 26.54 kB 26.58 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js +0.25% 89.23 kB 89.45 kB +0.11% 27.36 kB 27.39 kB

Generated by 🚫 dangerJS against 269ac62

@gnoff gnoff merged commit 7508dcd into facebook:main Nov 8, 2023
35 of 36 checks passed
@gnoff gnoff deleted the fix-bootstrap-on-resume branch November 8, 2023 18:43
@@ -612,9 +618,6 @@ export function resumeRenderState(
return createRenderState(
resumableState,
nonce,
// These should have already been flushed in the prerender.
undefined,
undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You removed three options. How come only two are removed?

@@ -92,8 +92,6 @@ export function createRenderState(
undefined,
undefined,
undefined,
undefined,
undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here. Were we sending one less already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I checked on those, I believe we were sending too many undefineds before. I confirmed the signature has six args and there are six inputs when 2 are removed

github-actions bot pushed a commit that referenced this pull request Nov 8, 2023
… in the shell (#27672)

Previously it was possible to postpone in the shell during a prerender
and then during a resume the bootstrap scripts would not be emitted
leading to no hydration on the client. This change moves the bootstrap
configuration to `ResumableState` where it can be serialized after
postponing if it wasn't flushed as part of the static shell.

DiffTrain build for [7508dcd](7508dcd)
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Nov 8, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
… in the shell (facebook#27672)

Previously it was possible to postpone in the shell during a prerender
and then during a resume the bootstrap scripts would not be emitted
leading to no hydration on the client. This change moves the bootstrap
configuration to `ResumableState` where it can be serialized after
postponing if it wasn't flushed as part of the static shell.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
… in the shell (#27672)

Previously it was possible to postpone in the shell during a prerender
and then during a resume the bootstrap scripts would not be emitted
leading to no hydration on the client. This change moves the bootstrap
configuration to `ResumableState` where it can be serialized after
postponing if it wasn't flushed as part of the static shell.

DiffTrain build for commit 7508dcd.
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