aholachek / react-flip-toolkit

A lightweight magic-move library for configurable layout transitions
MIT License
4.02k stars 135 forks source link

Multithreading animations #212

Open cheeck8131 opened 1 year ago

cheeck8131 commented 1 year ago

I work with multi-threaded animations, would it make sense for me to make a contribution to add the possibility of parallel non-blocking animation rendering?

aholachek commented 1 year ago

Hey, interesting, do you mean moving the animation calculations to a web worker? Or something else?

cheeck8131 commented 1 year ago

My very first suggestion is to use .animate() from WAAPI (you need to calculate keyframes in advance, you can do it in the main thread and in a web worker)

WAAPI does not freeze while you do in main thread heavy operations

waapi does a smooth transition on any values, which makes it easier to calculate the accuracy of a Spring value, where a lot of performance goes.