The API adds two new functions: start_view_transition(socket, options), needed to trigger page transitions + same document transitions on update.
and JS.start_view_transition(js, options), needed when using JS.navigate() or similar.
The current implementation is still a bit hacky and the passed options are not fully conistent yet, but before polishing this more I’d ideally like to get some buy in from any members of the phoenix team first.
I’m also open to any suggestions on how to improve this or on use cases that couldn’t be implemented using this API.
I’m a bit sad I got no replies here…
Not sure if its ok to tag you, but @chrismccord@steffend, I’d greatly appreciate if you could provide any feedback, thanks!
Going for a more generic approach also makes sense to me, but I’m not so sure if it’s needed. Do you know any other applications for this other than view transitions?
If not, going for the more specific implementation seems nicer to me from a user perspective, as it would make it easier to document.
But I totally understand if you want to keep it generic from a maintenance perspective, as that requires less knowledge.
Either way, thank you very much for adapting my example and implementing an alternative, I’d also be quite happy with this solution!
The reason why I don’t want to go for a view transition specific API for now is that I don’t want to decide on an API without having more experience using them. When people start using view transitions more and more, we should look into a nicer API for sure.
Thank you both for pushing this forward! I have a few SPA-like LV apps, also currently seeking for the best way to pack them as AppStore apps (e.g. with Capacitor, Flutter or a custom shell) with proper native feel, and these transitions would be a game changer so I’d absolutely love to see these possible. Can’t wait for the above PR to land in LV.