Conversation
Details of bundled changes.Comparing: 4773fdf...d60577c scheduler
Generated by 🚫 dangerJS |
|
ok, this particular behavior is because we don't recalculate time: react/packages/react-reconciler/src/ReactFiberScheduler.js Lines 1947 to 1952 in 4773fdf So in the test "advance time" doesn't actually advance anything for the scheduler, and that's why test gives confusing results. |
|
Even if we recalculated time in the test (which I'm not sure how to do), the actual issue I'm trying to debug is here: When something expires, we keep doing all expired work. But we don't show it to the user so from their perspective we're just freezing the browser. Not very useful. Seems like we should yield sometimes (always?) if we just flushed something that expired. I tried just adding a Remembering |
|
This might have to do with the "terminal updates" work @acdlite is doing. Or maybe not. I don't know if this is still a problem but it came up in my time slicing demos. |
I don't know if this is a bug but this behavior seems weird.
The sequence is:
My expectation is this should only flush update 2 (it's the one that expired). Update 3 hasn't expired yet.
However, this flushes update 3 instead. If I revert #13503, this flushes both 2 and 3. I can't get it to only flush 2, but that seems like the desired behavior.
By itself flushing 3 isn't that bad. The real situation I was trying to reproduce is when we expire another update while rendering a just-expired update, and that kicks off another rendering cycle without yielding. But I couldn't get to reproducing that because even a more basic scenario above didn't work as I expected.