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] Don't double replay elements when it's the postpone point #27440

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Sep 29, 2023

The resumeElement function wasn't actually doing the correct thing because it was resuming the element itself but what the child slot means is that we're supposed to resume in the direct child of the element. This is difficult to check for since it's all the possible branches that the element can render into, so instead we just check this in renderNode. It means the hottest path always checks the task which is unfortunate.

And also, resuming using the correct nextSegmentId.

Fixes two bugs surfaced by this test.

And also, resuming using the correct nextSegmentId.
@react-sizebot
Copy link

react-sizebot commented Sep 29, 2023

Comparing: d900fad...83a5af4

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 = 167.55 kB 167.55 kB = 52.14 kB 52.15 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 176.21 kB 176.21 kB = 54.84 kB 54.84 kB
facebook-www/ReactDOM-prod.classic.js = 564.39 kB 564.39 kB = 99.37 kB 99.37 kB
facebook-www/ReactDOM-prod.modern.js = 548.11 kB 548.11 kB = 96.45 kB 96.45 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/cjs/react-dom-server.edge.development.js = 411.71 kB 410.12 kB = 90.97 kB 90.86 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 411.30 kB 409.71 kB = 90.85 kB 90.74 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 430.75 kB 429.08 kB = 91.79 kB 91.67 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 408.88 kB 407.29 kB = 89.73 kB 89.62 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 406.92 kB 405.30 kB = 90.56 kB 90.45 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 405.07 kB 403.45 kB = 90.09 kB 89.98 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 424.22 kB 422.52 kB = 91.08 kB 90.96 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 398.63 kB 397.02 kB = 88.08 kB 87.97 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 379.72 kB 378.10 kB = 83.74 kB 83.65 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 379.69 kB 378.07 kB = 83.71 kB 83.62 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 379.34 kB 377.72 kB = 83.76 kB 83.67 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 379.32 kB 377.70 kB = 83.73 kB 83.64 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js = 378.26 kB 376.65 kB = 83.85 kB 83.76 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js = 378.24 kB 376.62 kB = 83.83 kB 83.73 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 377.86 kB 376.25 kB = 83.28 kB 83.19 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 377.85 kB 376.24 kB = 83.72 kB 83.63 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 377.84 kB 376.22 kB = 83.25 kB 83.16 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 377.83 kB 376.21 kB = 83.69 kB 83.60 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 395.90 kB 394.20 kB = 84.46 kB 84.35 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 395.88 kB 394.18 kB = 84.90 kB 84.79 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 395.88 kB 394.18 kB = 84.43 kB 84.33 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 395.86 kB 394.16 kB = 84.87 kB 84.76 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 375.10 kB 373.48 kB = 82.82 kB 82.73 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 375.07 kB 373.45 kB = 82.79 kB 82.70 kB
facebook-www/ReactDOMServer-dev.classic.js = 404.23 kB 402.29 kB = 89.25 kB 89.07 kB
facebook-www/ReactDOMServer-dev.modern.js = 396.80 kB 394.87 kB = 87.60 kB 87.43 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 391.57 kB 389.63 kB = 86.34 kB 86.18 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js = 84.59 kB 84.16 kB = 26.04 kB 25.92 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 82.80 kB 82.37 kB = 25.25 kB 25.11 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js = 79.44 kB 79.01 kB = 24.73 kB 24.62 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js = 79.32 kB 78.89 kB = 24.33 kB 24.24 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 80.37 kB 79.92 kB = 24.56 kB 24.42 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js = 78.56 kB 78.11 kB = 23.81 kB 23.70 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 75.48 kB 75.04 kB = 23.24 kB 23.12 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 75.46 kB 75.01 kB = 23.22 kB 23.09 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js = 75.40 kB 74.96 kB = 23.16 kB 23.06 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js = 75.38 kB 74.93 kB = 23.14 kB 23.03 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 74.58 kB 74.13 kB = 23.02 kB 22.90 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 74.43 kB 73.98 kB = 22.68 kB 22.57 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 73.51 kB 73.06 kB = 22.19 kB 22.06 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 73.48 kB 73.04 kB = 22.17 kB 22.04 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 73.28 kB 72.83 kB = 21.94 kB 21.81 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 73.25 kB 72.81 kB = 21.92 kB 21.78 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 70.52 kB 70.07 kB = 21.63 kB 21.51 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js = 70.66 kB 70.21 kB = 21.92 kB 21.81 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js = 70.49 kB 70.05 kB = 21.61 kB 21.49 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js = 70.63 kB 70.19 kB = 21.90 kB 21.79 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 67.90 kB 67.46 kB = 20.49 kB 20.37 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 67.74 kB 67.30 kB = 20.13 kB 20.02 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 67.88 kB 67.43 kB = 20.47 kB 20.34 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 67.72 kB 67.27 kB = 20.11 kB 19.99 kB
oss-experimental/react-server/cjs/react-server.development.js = 199.46 kB 197.86 kB = 46.09 kB 45.99 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 181.54 kB 179.95 kB = 41.90 kB 41.81 kB
oss-stable/react-server/cjs/react-server.development.js = 181.54 kB 179.95 kB = 41.90 kB 41.81 kB
oss-experimental/react-server/cjs/react-server.production.min.js = 37.50 kB 37.06 kB = 11.71 kB 11.61 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js = 33.98 kB 33.55 kB = 10.71 kB 10.60 kB
oss-stable/react-server/cjs/react-server.production.min.js = 33.98 kB 33.55 kB = 10.71 kB 10.60 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 186.67 kB 183.97 kB = 34.13 kB 33.81 kB
facebook-www/ReactDOMServer-prod.classic.js = 180.39 kB 177.68 kB = 32.51 kB 32.18 kB
facebook-www/ReactDOMServer-prod.modern.js = 178.52 kB 175.81 kB = 32.17 kB 31.84 kB

Generated by 🚫 dangerJS against 83a5af4

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Sep 29, 2023
@sebmarkbage sebmarkbage merged commit a6ed60a into facebook:main Sep 29, 2023
2 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 29, 2023
)

The `resumeElement` function wasn't actually doing the correct thing
because it was resuming the element itself but what the child slot means
is that we're supposed to resume in the direct child of the element.
This is difficult to check for since it's all the possible branches that
the element can render into, so instead we just check this in
renderNode. It means the hottest path always checks the task which is
unfortunate.

And also, resuming using the correct nextSegmentId.

Fixes two bugs surfaced by this test.

---------

Co-authored-by: Josh Story <[email protected]>

DiffTrain build for [a6ed60a](a6ed60a)
ztanner added a commit to vercel/next.js that referenced this pull request Oct 16, 2023
…experimental prefix for server action APIs (#56809)

The latest React canary builds have a few changes that need to be
adopted for compatability.

1. the `useFormState` and `useFormStatus` hooks in `react-dom` and the
`formData` opiont in `react-dom/server` are no longer prefixed with
`experimental_`
2. server content (an undocumented React feature) has been removed. Next
only had trivial intenral use of this API and did not expose a coherent
feature to Next users (no ability to seed context on refetches). It is
still possible that some users used the React server context APIs which
is why this should go into Next 14.

### React upstream changes

- facebook/react#27513
- facebook/react#27514
- facebook/react#27511
- facebook/react#27508
- facebook/react#27502
- facebook/react#27474
- facebook/react#26789
- facebook/react#27500
- facebook/react#27488
- facebook/react#27458
- facebook/react#27471
- facebook/react#27470
- facebook/react#27464
- facebook/react#27456
- facebook/react#27462
- facebook/react#27461
- facebook/react#27460
- facebook/react#27459
- facebook/react#27454
- facebook/react#27457
- facebook/react#27453
- facebook/react#27401
- facebook/react#27443
- facebook/react#27445
- facebook/react#27364
- facebook/react#27440
- facebook/react#27436

---------

Co-authored-by: Zack Tanner <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Jiachi Liu <[email protected]>
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…ebook#27440)

The `resumeElement` function wasn't actually doing the correct thing
because it was resuming the element itself but what the child slot means
is that we're supposed to resume in the direct child of the element.
This is difficult to check for since it's all the possible branches that
the element can render into, so instead we just check this in
renderNode. It means the hottest path always checks the task which is
unfortunate.

And also, resuming using the correct nextSegmentId.

Fixes two bugs surfaced by this test.

---------

Co-authored-by: Josh Story <[email protected]>
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
)

The `resumeElement` function wasn't actually doing the correct thing
because it was resuming the element itself but what the child slot means
is that we're supposed to resume in the direct child of the element.
This is difficult to check for since it's all the possible branches that
the element can render into, so instead we just check this in
renderNode. It means the hottest path always checks the task which is
unfortunate.

And also, resuming using the correct nextSegmentId.

Fixes two bugs surfaced by this test.

---------

Co-authored-by: Josh Story <[email protected]>

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