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 — [Flight] Serialize deduped elements by direct reference even if they suspend by sebmarkbage · Pull Request #28283 · react/react

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Feb 8, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

In #28123 I switched these to be lazy references. However that creates a lazy wrapper even if they're synchronously available. We try to as much as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't complete synchronously: https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of each emitted row. We could store the task in the map but then they couldn't be GC:ed as they complete. We could maybe store the status of each element but seems so heavy.

For now I just went back to direct reference which might be an issue since it can suspend something higher up when deduped.

Sorry, something went wrong.

Uh oh!

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

All reactions
@sebmarkbage
Serialize deduped elements by direct reference even if they suspend
631bb04
@sebmarkbage
sebmarkbage requested a review from gnoff February 8, 2024 23:31
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 8, 2024
@react-sizebot

react-sizebot commented Feb 8, 2024

Copy link
Copy Markdown

Comparing: d3def47...631bb04

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 = 176.64 kB 176.64 kB = 55.02 kB 55.02 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 178.63 kB 178.63 kB = 55.59 kB 55.59 kB
facebook-www/ReactDOM-prod.classic.js = 591.73 kB 591.73 kB = 104.44 kB 104.44 kB
facebook-www/ReactDOM-prod.modern.js = 575.51 kB 575.51 kB = 101.53 kB 101.53 kB
test_utils/ReactAllWarnings.js Deleted 67.02 kB 0.00 kB Deleted 16.42 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-server/cjs/react-server-flight.production.js +0.68% 56.77 kB 57.15 kB +0.94% 13.89 kB 14.02 kB
oss-stable/react-server/cjs/react-server-flight.production.js +0.68% 56.77 kB 57.15 kB +0.94% 13.89 kB 14.02 kB
oss-experimental/react-server/cjs/react-server-flight.production.js +0.58% 66.44 kB 66.83 kB +0.69% 15.88 kB 15.99 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.58% 66.51 kB 66.90 kB +0.68% 16.20 kB 16.31 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.58% 66.51 kB 66.90 kB +0.68% 16.20 kB 16.31 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.50% 76.21 kB 76.60 kB +0.63% 18.18 kB 18.29 kB
facebook-www/ReactFlightDOMServer-dev.modern.js +0.46% 84.42 kB 84.81 kB +0.64% 18.25 kB 18.36 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.43% 90.17 kB 90.56 kB +0.43% 21.45 kB 21.54 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.43% 90.17 kB 90.56 kB +0.43% 21.45 kB 21.54 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.42% 92.24 kB 92.62 kB +0.55% 22.24 kB 22.37 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.42% 92.24 kB 92.62 kB +0.55% 22.24 kB 22.37 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.41% 92.90 kB 93.28 kB +0.41% 22.48 kB 22.57 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.41% 92.90 kB 93.28 kB +0.41% 22.48 kB 22.57 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.40% 94.82 kB 95.21 kB +0.55% 22.97 kB 23.09 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.40% 94.82 kB 95.21 kB +0.55% 22.97 kB 23.09 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.40% 94.96 kB 95.34 kB +0.39% 23.04 kB 23.13 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.40% 94.96 kB 95.34 kB +0.39% 23.04 kB 23.13 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.40% 95.57 kB 95.96 kB +0.40% 22.67 kB 22.76 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.40% 95.57 kB 95.96 kB +0.40% 22.67 kB 22.76 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.39% 97.99 kB 98.37 kB +0.40% 23.28 kB 23.37 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.39% 97.99 kB 98.37 kB +0.40% 23.28 kB 23.37 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.39% 98.24 kB 98.62 kB +0.39% 23.50 kB 23.60 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.39% 98.24 kB 98.62 kB +0.39% 23.50 kB 23.60 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.38% 100.08 kB 100.46 kB +0.39% 23.50 kB 23.59 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.38% 100.65 kB 101.03 kB +0.37% 24.17 kB 24.26 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.38% 100.65 kB 101.03 kB +0.37% 24.17 kB 24.26 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.38% 100.68 kB 101.06 kB +0.40% 23.99 kB 24.09 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.38% 100.68 kB 101.06 kB +0.40% 23.99 kB 24.09 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.37% 102.59 kB 102.97 kB +0.39% 24.49 kB 24.58 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.37% 102.95 kB 103.34 kB +0.40% 24.83 kB 24.93 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.37% 102.95 kB 103.34 kB +0.40% 24.83 kB 24.93 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.37% 103.25 kB 103.63 kB +0.39% 24.70 kB 24.79 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.37% 103.66 kB 104.04 kB +0.38% 25.02 kB 25.12 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.37% 103.66 kB 104.04 kB +0.38% 25.02 kB 25.12 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.37% 105.17 kB 105.56 kB +0.38% 25.22 kB 25.32 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.36% 105.31 kB 105.69 kB +0.38% 25.26 kB 25.36 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.36% 105.48 kB 105.86 kB +0.38% 24.71 kB 24.81 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.36% 105.54 kB 105.92 kB +0.37% 25.55 kB 25.64 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.36% 105.54 kB 105.92 kB +0.37% 25.55 kB 25.64 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.36% 105.72 kB 106.11 kB +0.36% 25.58 kB 25.67 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.36% 105.72 kB 106.11 kB +0.36% 25.58 kB 25.67 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.36% 106.09 kB 106.48 kB +0.39% 25.20 kB 25.30 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.36% 106.09 kB 106.48 kB +0.39% 25.20 kB 25.30 kB
oss-stable-semver/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.36% 108.73 kB 109.12 kB +0.39% 25.12 kB 25.22 kB
oss-stable/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.36% 108.73 kB 109.12 kB +0.39% 25.12 kB 25.22 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.36% 107.89 kB 108.27 kB +0.38% 25.32 kB 25.42 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.36% 108.14 kB 108.52 kB +0.39% 25.54 kB 25.64 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.35% 108.52 kB 108.90 kB +0.37% 25.81 kB 25.91 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.35% 108.52 kB 108.90 kB +0.37% 25.81 kB 25.91 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.35% 108.73 kB 109.12 kB +0.36% 26.03 kB 26.12 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.35% 108.73 kB 109.12 kB +0.36% 26.03 kB 26.12 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.35% 111.45 kB 111.84 kB +0.38% 25.86 kB 25.95 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.35% 111.45 kB 111.84 kB +0.38% 25.86 kB 25.95 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.35% 110.55 kB 110.93 kB +0.37% 26.22 kB 26.32 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.35% 111.15 kB 111.54 kB +0.37% 26.68 kB 26.78 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.35% 111.15 kB 111.54 kB +0.37% 26.68 kB 26.78 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.35% 111.26 kB 111.64 kB +0.38% 26.28 kB 26.38 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.34% 113.33 kB 113.72 kB +0.37% 27.06 kB 27.16 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.33% 114.71 kB 115.09 kB +0.37% 27.49 kB 27.59 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.33% 115.91 kB 116.30 kB +0.36% 27.79 kB 27.89 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.33% 116.67 kB 117.05 kB +0.37% 27.49 kB 27.59 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.33% 116.77 kB 117.16 kB +0.36% 28.05 kB 28.15 kB
oss-experimental/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.33% 119.56 kB 119.95 kB +0.39% 27.42 kB 27.53 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.32% 119.09 kB 119.48 kB +0.37% 28.11 kB 28.21 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.32% 119.31 kB 119.69 kB +0.35% 28.32 kB 28.42 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.32% 122.29 kB 122.68 kB +0.38% 28.14 kB 28.25 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.32% 121.73 kB 122.11 kB +0.36% 28.99 kB 29.10 kB
test_utils/ReactAllWarnings.js Deleted 67.02 kB 0.00 kB Deleted 16.42 kB 0.00 kB

Generated by 🚫 dangerJS against 631bb04

All reactions

Sorry, something went wrong.

Uh oh!

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

gnoff
gnoff approved these changes Feb 8, 2024
View reviewed changes

@gnoff gnoff left a comment

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.

I'm wondering if this will reintroduce the other bug that was fixed when you introduced key support. We got into a weird state where the root chunk never resolved to a value and always fullfilled with null. Maybe the other change where the model root condition is checked first is what resolved that though

Sorry, something went wrong.

Uh oh!

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

All reactions
@sebmarkbage

sebmarkbage commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

Yes. Either the lazy or the modelRoot thing should fix that issue so we have at least the other fix.

All reactions

Sorry, something went wrong.

Uh oh!

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

@sebmarkbage
sebmarkbage merged commit ba5e6a8 into react:main Feb 8, 2024
github-actions Bot pushed a commit that referenced this pull request Feb 8, 2024
@sebmarkbage
[Flight] Serialize deduped elements by direct reference even if they …
b239264
…suspend (#28283)

In #28123 I switched these to be lazy references. However that creates a
lazy wrapper even if they're synchronously available. We try to as much
as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't
complete synchronously:
https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of
each emitted row. We could store the task in the map but then they
couldn't be GC:ed as they complete. We could maybe store the status of
each element but seems so heavy.

For now I just went back to direct reference which might be an issue
since it can suspend something higher up when deduped.

DiffTrain build for [ba5e6a8](ba5e6a8)
@ztanner ztanner mentioned this pull request Feb 9, 2024
Update React from 2bc7d336a to ba5e6a832 vercel/next.js#61837
Merged
huozhi pushed a commit to vercel/next.js that referenced this pull request Feb 9, 2024
@ztanner
Update React from 2bc7d336a to ba5e6a832 (#61837)
f165514
Updates React from 2bc7d336a to ba5e6a832.

### React upstream changes

- react/react#28283
- react/react#28280
- react/react#28079
- react/react#28233
- react/react#28276
- react/react#28272
- react/react#28265
- react/react#28259
- react/react#28153
- react/react#28246
- react/react#28218
- react/react#28263
- react/react#28257
- react/react#28261
- react/react#28262
- react/react#28260
- react/react#28258
- react/react#27864
- react/react#28254
- react/react#28219
- react/react#28248
- react/react#28216
- react/react#28249
- react/react#28241
- react/react#28243
- react/react#28253
- react/react#28256
- react/react#28236
- react/react#28237
- react/react#28242
- react/react#28251
- react/react#28252

Closes NEXT-2411
@ztanner ztanner mentioned this pull request Mar 19, 2024
(backport) Update React from 60a927d04 to 14898b6a9 vercel/next.js#63442
Closed
This was referenced Mar 20, 2024
Move data fetching into FlightCard unstubbable/ai-rsc-test#1
Open
Bug: [Flight] Async server components in ai/rsc not rendered correctly #28595
Closed
unstubbable added a commit to unstubbable/react that referenced this pull request Mar 21, 2024
@unstubbable
Revert "[Flight] Serialize deduped elements by direct reference even …
15fefa1
…if they suspend (react#28283)"

This reverts commit ba5e6a8.
@unstubbable unstubbable mentioned this pull request Mar 21, 2024
Sanity check for #28601 #28604
Closed
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@sebmarkbage @AndyPengc12
[Flight] Serialize deduped elements by direct reference even if they …
261a0cb
…suspend (react#28283)

In react#28123 I switched these to be lazy references. However that creates a
lazy wrapper even if they're synchronously available. We try to as much
as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't
complete synchronously:
https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of
each emitted row. We could store the task in the map but then they
couldn't be GC:ed as they complete. We could maybe store the status of
each element but seems so heavy.

For now I just went back to direct reference which might be an issue
since it can suspend something higher up when deduped.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@sebmarkbage
[Flight] Serialize deduped elements by direct reference even if they …
b6023de
…suspend (#28283)

In #28123 I switched these to be lazy references. However that creates a
lazy wrapper even if they're synchronously available. We try to as much
as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't
complete synchronously:
https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of
each emitted row. We could store the task in the map but then they
couldn't be GC:ed as they complete. We could maybe store the status of
each element but seems so heavy.

For now I just went back to direct reference which might be an issue
since it can suspend something higher up when deduped.

DiffTrain build for commit ba5e6a8.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
[Flight] Serialize deduped elements by direct reference even if they …
7fcb9f9
…suspend (react#28283)

In react#28123 I switched these to be lazy references. However that creates a
lazy wrapper even if they're synchronously available. We try to as much
as possible preserve the original data structure in these cases.

E.g. here in the dev outlining I only use a lazy wrapper if it didn't
complete synchronously:
https://github.com/facebook/react/pull/28272/files#diff-d4c9c509922b3671d3ecce4e051df66dd5c3d38ff913c7a7fe94abc3ba2ed72eR638

Unfortunately we don't have a data structure that tracks the status of
each emitted row. We could store the task in the map but then they
couldn't be GC:ed as they complete. We could maybe store the status of
each element but seems so heavy.

For now I just went back to direct reference which might be an issue
since it can suspend something higher up when deduped.
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.