Skip to content

[Flight] Don't increase serializedSize for every recursive pass #33123

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

Merged
merged 1 commit into from
May 5, 2025

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented May 5, 2025

I noticed that we increase this in the recursive part of the algorithm. This would mean that we'd count a key more than once if it has Server Components inside it recursively resolving. This moves it out to where we enter from toJSON. Which is called once per JSON entry (and therefore once per key).

@sebmarkbage sebmarkbage requested a review from eps1lon May 5, 2025 14:06
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label May 5, 2025
@sebmarkbage sebmarkbage force-pushed the serializerecursive branch from 68bb5f2 to a4a49b2 Compare May 5, 2025 14:23
@react-sizebot
Copy link

Comparing: 0ca8420...63042a5

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 +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 528.27 kB 528.27 kB = 93.14 kB 93.14 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 633.90 kB 633.90 kB = 111.33 kB 111.33 kB
facebook-www/ReactDOM-prod.classic.js = 671.68 kB 671.68 kB = 117.77 kB 117.77 kB
facebook-www/ReactDOM-prod.modern.js = 661.96 kB 661.96 kB = 116.21 kB 116.21 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 63042a5

@sebmarkbage sebmarkbage merged commit 52ea641 into facebook:main May 5, 2025
464 of 466 checks passed
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.

5 participants