5 ms·
Normal HTTP request latency is much better in Phoenix that in Rails. You can't do much about the intervening network latency but I'd expect a LiveView app to be
by rkangel 5y ago
Normal HTTP request latency is much better in Phoenix that in Rails. You can't do much about the intervening network latency but I'd expect a LiveView app to be snappier.
Good practice seems to be the PETAL stack (https://thinkingelixir.com/petal-stack-in-elixir/ https://thinkingelixir.com/petal-stack-in-elixir/) using Alpine.js to sprinkling in some client side UI stuff that doesn't need to go via the server.
LiveView isn't intended to replace SPAs. If you have a lot of UI interaction where the UI changes "shape" in response to user interaction then no you probably want JS. For a lot of things people are doing they don't need that though.
Implementing a form in LiveView is a use case that completely shines. You implement all your validation once on the server and use that same validation code (the ecto changeset stuff) to do your live UI messages in the client. It also doesn't matter if it takes 100ms for the text box to go red and say "password too short" in that use case. You can get a 'live' friendly and helpful interactive form with all the user feedback you want and it costs you barely more than the effort to do just the server side stuff, and without any risk of mismatching validation.