3 ms·
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
by jstummbillig 6y ago
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.
- cultofmetatron 6y agosadly 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
- jstummbillig 6y agoTrue 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.
- Existenceblinks 6y agoIt 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.
- neillyons 6y agoNot baked in but you can use AlpineJS with LiveView as they both don't use a virtual DOM. You can do optimistic UI and interactions that don't warrant a round trip to the server like toggling a drop down. See the blog posts below. They explain it really well. http://blog.pthompson.org/liveview-tailwind-css-alpine-js-modal http://blog.pthompson.org/liveview-tailwind-css-alpine-js-mo... http://blog.pthompson.org/alpine-js-and-liveview http://blog.pthompson.org/alpine-js-and-liveview