spicychickensauce

spicychickensauce

I’ve previously explored what is possible today with hacks to implement view transitions in our apps:

I have since created a fork to implement proper support.
I’m quite happy with it and hope this can make it into phoenix.

Here is the fork: GitHub - spicychickensauce/phoenix_live_view at implement-view-transitions · GitHub
Here is a demo app using the fork: LiveView View Transitions Demo · GitHub
And here is a quick video of that demo: https://imgur.com/a/OvhnSVm

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.

Showing Posts 1 to 5

spicychickensauce

spicychickensauce OP

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!

steffend

steffend

Phoenix Core Team

Sorry, I didn’t find the time to look at it earlier. Because I’m not too familiar with view transitions, I tried to work on a more generic API that allows you to do this without being specific to view transitions. See Add onDocumentPatch callback and allow specifying event dispatch phase by SteffenDE · Pull Request #4043 · phoenixframework/phoenix_live_view · GitHub and the linked gist where I adapted your example to use this new API.

We’ll have to see what other maintainers think about it, but it looks like a good solution to me!

spicychickensauce

spicychickensauce OP

Wow, that’s very nice, thank you very much!

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!

steffend

steffend

Phoenix Core Team

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.

karolsluszniak

karolsluszniak

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.

— All posts loaded —

Where Next? Top

Trending in Proposals: Ideas Top

woylie
We are seeing a lot of warning logs like this: navigate event to "https://someurl" failed because you are redirecting across live_sessio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews