I've been loving the experience with Liveview. I'm currently working on an mvp for a client with it and its been amazing.
1. no friction thinking for thinking about communication between the frontend and backend.
2. js interop has been great. The hooks system allowed me to seamlessly plug in dropzone and stripe elements while keeping the rest of the frontend as elixir.
3. I can have the frontend pages react to pubsub channels and react to events from other parts of the system and update the page instantly.
Is latency an issue? Applications that are only used within an organisation or within a company of a local region, where Latency wont be an issue. I am wondering if say your App is hosted in US while the user is in Singapore or Japan, what the experience will be like when you have an RTT of ~200ms.
Otherwise I really like the idea of LiveView / LiveWire / StimulusReflex, cant wait to see it mainstream.
Yes, it definitely can be. LiveView will create real problems when the user is many hops from the server. I say this as someone who has gone all in, but currently we're UK based and only serving the UK market. Multi-region scaling for liveview will certainly be 'interesting'.
Interesting, can you elaborate somewhat? What is the type of issues you are facing?
Isn't the issues pretty much the same for normal single page apps as well? Most single page apps require data loads for many actions causing maybe not interface latency, but rather data load latency.
I don’t have any experience about scaling Multi-region, but I think for these kinds of ‘apps’, the way to keep response times down is to have multi-region DB and servers. Is that true?
Not straightforward as it sounds. Where is a center for all of those nodes? The edge server part is easy with Fly.io, but distributed "problem" and latency are still not great for realtime application selling worldwide.
The latency between the edge servers and the database server will give you bad UX with current "mount/3 gets called twice" strategy. Going from edge to db twice is really bad in my experience. Now you would think about adding read-only postgresql nodes on at least 3 nodes (US, EU, and Asia), $$$$.
The diff payload is also hard to get right. Morphdom is fast (not that pretty), `toString(diff)` is really slow in my application (impossible to implement smooth virtualized list, even served on localhost)
Does Liveview have baked in support for optimistic UI updates? If not, does anyone know of such a framework (any language, really) that does? That has been the deal breaker whenever I looked into similar frameworks.
sadly it does not. but you really need to either have very limited update scopes or the framework would need to bake in your business assumptions in order for offline mode to work properly. It essentially requires being able to run some business rules client-side
True enough! To me the true unrealized potential of these frameworks is abstracting away where and how exactly all the Rails/Laravel/Elixir business logic runs. If something need to run on the client, I want the framework to create the necessary JS of my backend code for me.
While I am sure there is a shit load of edge cases that would make this very hard to fully solve for all cases, I feel like a generic promise-like-structure shared between backend and frontend would already go a long way here.
It needs a universal template spec. Something like Markojs (but they can only be rendered by nodejs server), but sever languages know how to render (ssr) with data, and client know how to rehydrate into parts of client side program.
1. no friction thinking for thinking about communication between the frontend and backend.
2. js interop has been great. The hooks system allowed me to seamlessly plug in dropzone and stripe elements while keeping the rest of the frontend as elixir.
3. I can have the frontend pages react to pubsub channels and react to events from other parts of the system and update the page instantly.
3. super fast with SSR.