When using external libraries like motion.dev with LiveView, we'd ideally have a way to trigger those animations similar to how we do a JS.transition. The important part is that we'd want to support locking the elements to prevent them from being patched while the animation is running.
I think we could extend the JS commands (on the client) to also support a locking API, which we could then handle similar to how we handle locked elements for regular server events (patching a clone in the background and applying the updates on unlock). We should also handle those locked elements in phx-remove to allow custom animations when an element is removed.
cc @chrismccord @bcardarella
When using external libraries like motion.dev with LiveView, we'd ideally have a way to trigger those animations similar to how we do a
JS.transition. The important part is that we'd want to support locking the elements to prevent them from being patched while the animation is running.I think we could extend the JS commands (on the client) to also support a locking API, which we could then handle similar to how we handle locked elements for regular server events (patching a clone in the background and applying the updates on unlock). We should also handle those locked elements in
phx-removeto allow custom animations when an element is removed.cc @chrismccord @bcardarella