3 ms·
When I've seen LiveView mentioned in the past, the one major problem seems to be its reliance on sockets, which causes problems in certain environments and also
by garyrob 3y ago
When I've seen LiveView mentioned in the past, the one major problem seems to be its reliance on sockets, which causes problems in certain environments and also can cause too much latency on slow internet connections.
An example of the kind of problems is at [1]. It's not hard to find other such discussions.
The other thing I wonder about is cross-platform. If you're using something like React or Flutter there are various solutions. But I haven't run across anything substantial that's oriented towards Phoenix LiveView.
[1] https://elixirforum.com/t/live-view-fallback-with-no-websocket/26068/18 https://elixirforum.com/t/live-view-fallback-with-no-websock....
- tomtheelder 3y agoThe fallback to polling is generally a good solution. I think the sorts of problems that dev ran into are very much the exception, not the rule, given the kind of absurd environment they were working in. Also worth calling out that LiveView was _very_ new when that post was made. The latency issue is a real one. Long polling can also help there, but realistically if a substantial portion of your user base is on poor connections you’re going to be much better off with a traditional server rendered web application than something like LiveView or a SPA. I’m not sure what you mean about cross-platform. LiveView is for building web apps, so there’s only really one platform to speak of: the browser.
- garyrob 3y agoThanks, that's helpful. > I’m not sure what you mean about cross-platform. LiveView is for building web apps, so there’s only really one platform to speak of: the browser. Similarly, React is for web apps but React Native has emerged such that your knowledge and some code can carry over, and now there's even React Native for Web so that you can write React Native and run it on the web in a way that at least tries to maximize code portability. It sounds like there hasn't been an emergence of equivalent tools with LiveView... but that's fine. As you say, LiveView is for the web and if that's the one thing you're targeting, especially for an internal app so internet connectivity is reliable, it's fantastic and possibly the best solution that exists now. There's certainly nothing wrong with making a great tool to full a particular (major) need!!