You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
I've decided to remove the optimization of the UI Runtime to request a
native animation frame only when it has JS animation frame queue
pending.
The optimization itself is marginal and on the other hand it lead to bad
patterns of calling `flushMicrotasks` imperatively. Because Shared Value
side-effects (running the input-outputs graph) are executed in the
microtask queue, changing a shared value via JSI without any animations
going wouldn't trigger any visible changes. For this reason i.e.
`useAnimatedSensor` called `flushMicrotasks` to make sure that the
sensor registers and is not held in the queue forever.
## Test plan
- Bokeh example works ✅
- Sensors on physical device work ✅
- Runtime run loop tests pass ✅
// Function `requestAnimationFrame` adds callback to an array, all the callbacks are flushed with function `__flushAnimationFrame`
50
-
// Usually we flush them inside function `nativeRequestAnimationFrame` and then the given timestamp is the timestamp of end of the current frame.
51
-
// However function `__flushAnimationFrame` may also be called inside `registerEventHandler` - then we get actual timestamp which is earlier than the end of the frame.
0 commit comments