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

Always reset baseQueue #30990

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rickhanlonii
Copy link
Member

Found a bug where if the baseQueue is not empty, and we do a render-phase update, we won't update the base state within the same sync render (like for a layout effect update, but probably also for passive effects for discrete events).

Copy link

vercel bot commented Sep 17, 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 Sep 23, 2024 4:04pm

@react-sizebot
Copy link

react-sizebot commented Sep 17, 2024

Comparing: 5d19e1c...7c0d89a

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.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 508.62 kB 508.62 kB = 90.98 kB 90.98 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 = 513.56 kB 513.56 kB = 91.71 kB 91.71 kB
facebook-www/ReactDOM-prod.classic.js +0.02% 603.01 kB 603.11 kB +0.02% 106.69 kB 106.72 kB
facebook-www/ReactDOM-prod.modern.js +0.02% 579.24 kB 579.34 kB +0.03% 102.79 kB 102.82 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against cc5de7f

@josephsavona
Copy link
Contributor

Nice job distilling the repro and finding the root cause! Thank you!

@rickhanlonii rickhanlonii changed the title [Test] Add test for nested render baseQueue bug Always reset baseQueue Sep 19, 2024
Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

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

This makes sense to me, the existing behavior seems pretty clearly suboptimal since it can go back in time and render a previous value.

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