Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

We avoid visiting the same async node twice but if we see it again we returned "null" indicating that there's no I/O there.

This means that if you have two different Promises both resolving from the same I/O node then we only show one of them. However, in general we treat that as two different I/O entries to allow for things like batching to still show up separately.

This fixes that by caching the return value for multiple visits. So if we found I/O (but no user space await) in one path and then we visit that path through a different Promise chain, then we'll still emit it twice.

However, if we visit the same exact Promise that we emitted an await on then we skip it. Because there's no need to emit two awaits on the same thing. It only matters when the path ends up informing whether it has I/O or not.

@meta-cla meta-cla bot added the CLA Signed label Oct 29, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Oct 29, 2025
@react-sizebot
Copy link

Comparing: 0fa3250...515b922

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 = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 605.41 kB 605.41 kB = 107.21 kB 107.22 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 664.38 kB 664.38 kB = 117.09 kB 117.09 kB
facebook-www/ReactDOM-prod.classic.js = 688.25 kB 688.25 kB = 121.13 kB 121.13 kB
facebook-www/ReactDOM-prod.modern.js = 678.67 kB 678.67 kB = 119.49 kB 119.49 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 515b922

@sebmarkbage sebmarkbage merged commit 4f93170 into facebook:main Oct 29, 2025
246 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.

3 participants