-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Animated: Setup scheduleAnimatedCleanupInMicrotask
Feature Flag
#48878
Conversation
This pull request was exported from Phabricator. Differential Revision: D68527096 |
…cebook#48878) Summary: Creates a new `scheduleAnimatedCleanupInMicrotask` feature flag to experiment with deferring the `AnimatedProps` cleanup using the microtask queue. This is different from the previous approach of deferring invocation of the completion callback, which impacted the timing of composite animations such as `Animated.parallel` and `Animated.sequence`, because we are deferring detaching the `AnimatedNode` graph instead. This will only impact the timing of completion callbacks as a result of invalidating `AnimatedProps` (either by passing in new `AnimatedValue` instances or unmounting the component). This should minimally impact scheduling and have lower risk of user-visible behavior change because React already provides minimal guarantees around when updates are committed (and effects attached/detached). This also enables us to significantly simplify the current convoluted dance we do to optimized around reference counting in the AnimatedNode graph. Changelog: [General][Changed] - When an Animated component is updated or unmounted, `AnimatedNode` instances will now detach in a microtask instead of synchronously in the commit phase of React. This will cause the completion callback of finished animations to execute after the commit phase instead of during it. Differential Revision: D68527096
e29ce1b
to
5f23d95
Compare
This pull request was exported from Phabricator. Differential Revision: D68527096 |
…cebook#48878) Summary: Pull Request resolved: facebook#48878 Creates a new `scheduleAnimatedCleanupInMicrotask` feature flag to experiment with deferring the `AnimatedProps` cleanup using the microtask queue. This is different from the previous approach of deferring invocation of the completion callback, which impacted the timing of composite animations such as `Animated.parallel` and `Animated.sequence`, because we are deferring detaching the `AnimatedNode` graph instead. This will only impact the timing of completion callbacks as a result of invalidating `AnimatedProps` (either by passing in new `AnimatedValue` instances or unmounting the component). This should minimally impact scheduling and have lower risk of user-visible behavior change because React already provides minimal guarantees around when updates are committed (and effects attached/detached). This also enables us to significantly simplify the current convoluted dance we do to optimized around reference counting in the AnimatedNode graph. Changelog: [General][Changed] - When an Animated component is updated or unmounted, `AnimatedNode` instances will now detach in a microtask instead of synchronously in the commit phase of React. This will cause the completion callback of finished animations to execute after the commit phase instead of during it. Reviewed By: rickhanlonii Differential Revision: D68527096
5f23d95
to
0b27c08
Compare
This pull request was exported from Phabricator. Differential Revision: D68527096 |
This pull request has been merged in 50b75a7. |
This pull request was successfully merged by @yungsters in 50b75a7 When will my fix make it into a release? | How to file a pick request? |
Summary:
Creates a new
scheduleAnimatedCleanupInMicrotask
feature flag to experiment with deferring theAnimatedProps
cleanup using the microtask queue.This is different from the previous approach of deferring invocation of the completion callback, which impacted the timing of composite animations such as
Animated.parallel
andAnimated.sequence
, because we are deferring detaching theAnimatedNode
graph instead. This will only impact the timing of completion callbacks as a result of invalidatingAnimatedProps
(either by passing in newAnimatedValue
instances or unmounting the component).This should minimally impact scheduling and have lower risk of user-visible behavior change because React already provides minimal guarantees around when updates are committed (and effects attached/detached).
This also enables us to significantly simplify the current convoluted dance we do to optimized around reference counting in the AnimatedNode graph.
Changelog:
[General][Changed] - When an Animated component is updated or unmounted,
AnimatedNode
instances will now detach in a microtask instead of synchronously in the commit phase of React. This will cause the completion callback of finished animations to execute after the commit phase instead of during it.Differential Revision: D68527096