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] Gate legacyContext field on disableLegacyContext #30173

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

sebmarkbage
Copy link
Collaborator

We're running out of fields and this one we can avoid at runtime in any modern builds.

@sebmarkbage sebmarkbage requested review from gnoff and eps1lon July 1, 2024 17:05
Copy link

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 5:17pm

@react-sizebot
Copy link

react-sizebot commented Jul 1, 2024

Comparing: 100dfd7...1d8abc5

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.11% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 497.99 kB 497.99 kB = 89.27 kB 89.27 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.11% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.81 kB 502.81 kB = 89.97 kB 89.97 kB
facebook-www/ReactDOM-prod.classic.js = 597.08 kB 597.08 kB = 105.33 kB 105.33 kB
facebook-www/ReactDOM-prod.modern.js = 571.42 kB 571.42 kB = 101.27 kB 101.27 kB
test_utils/ReactAllWarnings.js Deleted 62.88 kB 0.00 kB Deleted 15.69 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/react-dom/cjs/react-dom-server.edge.production.js = 220.65 kB 220.19 kB = 41.08 kB 41.03 kB
oss-stable-rc/react-dom/cjs/react-dom-server.edge.production.js = 220.58 kB 220.12 kB = 41.05 kB 41.01 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.js = 220.58 kB 220.12 kB = 41.05 kB 41.01 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.js = 216.51 kB 216.05 kB = 39.84 kB 39.78 kB
oss-stable-rc/react-dom/cjs/react-dom-server.node.production.js = 216.44 kB 215.98 kB = 39.81 kB 39.76 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.js = 216.44 kB 215.98 kB = 39.81 kB 39.76 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.js = 215.72 kB 215.26 kB = 39.21 kB 39.16 kB
oss-stable-rc/react-dom/cjs/react-dom-server.browser.production.js = 215.65 kB 215.19 kB = 39.19 kB 39.14 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.js = 215.65 kB 215.19 kB = 39.19 kB 39.14 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 212.25 kB 211.79 kB = 39.43 kB 39.38 kB
facebook-www/ReactDOMServer-prod.modern.js = 207.55 kB 207.09 kB = 37.89 kB 37.84 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.js = 204.36 kB 203.90 kB = 38.60 kB 38.55 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.node.production.js = 204.34 kB 203.88 kB = 38.58 kB 38.53 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.js = 204.34 kB 203.88 kB = 38.58 kB 38.53 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.js = 204.26 kB 203.80 kB = 38.01 kB 37.96 kB
oss-stable-rc/react-dom/cjs/react-dom-server.bun.production.js = 204.19 kB 203.73 kB = 37.99 kB 37.93 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.js = 204.19 kB 203.73 kB = 37.99 kB 37.93 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.js = 199.92 kB 199.46 kB = 36.85 kB 36.79 kB
oss-stable-rc/react-dom/cjs/react-dom-server-legacy.browser.production.js = 199.90 kB 199.44 kB = 36.83 kB 36.77 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.js = 199.90 kB 199.44 kB = 36.83 kB 36.77 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.js = 245.78 kB 245.21 kB = 44.13 kB 44.07 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.js = 220.52 kB 220.00 kB = 40.14 kB 40.08 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.js = 219.56 kB 219.04 kB = 40.71 kB 40.66 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.js = 240.30 kB 239.73 kB = 42.16 kB 42.09 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.js = 241.73 kB 241.15 kB = 43.38 kB 43.32 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.js = 214.56 kB 214.05 kB = 38.86 kB 38.80 kB
oss-experimental/react-html/cjs/react-html.production.js = 202.84 kB 202.32 kB = 38.04 kB 37.98 kB
oss-experimental/react-server/cjs/react-server.development.js = 174.91 kB 174.29 kB = 31.61 kB 31.54 kB
oss-stable-rc/react-server/cjs/react-server.development.js = 159.16 kB 158.58 kB = 28.99 kB 28.93 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 159.16 kB 158.58 kB = 28.99 kB 28.93 kB
oss-stable/react-server/cjs/react-server.development.js = 159.16 kB 158.58 kB = 28.99 kB 28.93 kB
oss-stable-rc/react-server/cjs/react-server.production.js = 106.51 kB 105.97 kB = 19.49 kB 19.44 kB
oss-stable-semver/react-server/cjs/react-server.production.js = 106.51 kB 105.97 kB = 19.49 kB 19.44 kB
oss-stable/react-server/cjs/react-server.production.js = 106.51 kB 105.97 kB = 19.49 kB 19.44 kB
oss-experimental/react-server/cjs/react-server.production.js = 117.02 kB 116.42 kB = 21.10 kB 21.03 kB
test_utils/ReactAllWarnings.js Deleted 62.88 kB 0.00 kB Deleted 15.69 kB 0.00 kB

Generated by 🚫 dangerJS against 1d8abc5

Copy link
Member

@kassens kassens left a comment

Choose a reason for hiding this comment

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

running out of fields

what does that mean?

PR looks good though.

context: ContextSnapshot, // the current new context that this task is executing in
treeContext: TreeContext, // the current tree context that this task is executing in
componentStack: null | ComponentStackNode, // stack frame description of the currently rendering component
thenableState: null | ThenableState,
isFallback: boolean, // whether this task is rendering inside a fallback tree
legacyContext: LegacyContext, // the current legacy context that this task is executing in
// DON'T ANY MORE FIELDS. We at 16 already which otherwise requires converting to a constructor.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kassens Fastest way to construct an object in all VMs is inline objects. However only up to 16 fields. After that we need to switch to using a constructor instead to avoid V8 deopting them. These objects are not super rare so too many fields is not good anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Cheers, assumed it was something like this but didn't know the case or limit.

@sebmarkbage sebmarkbage merged commit 6d2a97a into facebook:main Jul 1, 2024
139 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 1, 2024
We're running out of fields and this one we can avoid at runtime in any
modern builds.

DiffTrain build for [6d2a97a](6d2a97a)
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