3 ms·
The downside as I understand it is the extra work to manage UX for connections with high latency and/or going offline, correct?
by password4321 4y ago
The downside as I understand it is the extra work to manage UX for connections with high latency and/or going offline, correct?
- freedomben 4y agoYes, the downside is basically offline. When offline the LiveView app doesn't work because it can't update it's DOM. A decent solution I've enjoyed is using Alpine.js. It fits very neatly into the LiveView philosophy and can do nearly all UI updating easily. It still minimizes the amount of JS you have to write but you get good client-side update behavior. High latency isn't an issue if you do it correctly by using the loading classes and what not so that the user knows they are waiting for some data to load. It's pretty much identical to a typical React SPA that has to show loading indicators while waiting for a JSON call to complete.
- a_bored_husky 4y agoYou aren't suppossed to use LiveView for every interaction, only the ones that require the server to be involved somehow just like a regular SPA. For pure client-side interactions LiveView has some utilities like LiveView.JS or you can use a lib like AlpineJS.
- sergiotapia 4y agoTo me that's a non-issue. How are you going to access a website without internet anyways? If you're talking about "slow" internet, then use Alpine JS to run truly client-side things in those very rare cases.
- sph 4y agoLive View might still be applicable in some latency sensitive contexts: one of the first Live View demos was a server-side rendered animation hosted in US that played at a smooth 60 fps in Europe. There are very few problems Live View isn't good for, and conversely, there are very few problems client-side single-page application are necessary for.
- password4321 4y agoThese days the issue is mostly mobile clients, but even then offline support is unusual for sure.
- wstuartcl 4y agoYes and no. It handles crappy connections ok -- it will auto reconnect as needed. As far as full offline -- it has interfaces to easily alert the user via UI that they are disconnected, however, just like 99.999% of non liveview apps when you are offline things start breaking (load just about any static page site and submit a form or navigate when offline).