-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: support multiple synchronous timings for act #4619
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
Conversation
rschristian
left a comment
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.
Adding a test case would be appreciated if you can
Sure, will do~! |
|
@rschristian |
rschristian
left a comment
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.
Indeed, we shouldn't attempt to directly use useSignalsEffect in our tests here but we should be able to emulate it, (roughly) recreating the case in which act works incorrectly.
It's unfortunately pretty late here & I'm doing this phone, but your tests might cover this well enough already. I'll try to carve out some time in the next few days (holiday season, might be next week) to look into it more (if Jovi can't) as I'm not super familiar here.
JoviDeCroock
left a comment
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.
The gist of what happens is
- update signal
- effect notifies (call options.raf)
- rerender happens
- useEffect deps change (call raf)
The tests sufficiently cover that
Co-authored-by: Jovi De Croock <[email protected]>
What this PR do?
As we talked here
There is a issue:
it just looks like the signal-effect update never gets flushed when there's a child depending on the signal, this might be because we first initiate a rerender in act which will queue up the useEffect and potentially override the scheduled one from the signal-effect.