11 ms·
I'm not sure what's exactly problems which liveview tech solves. In real world applications, it's always "polling", because you're not sure when server finishe
by revskill 4y ago
I'm not sure what's exactly problems which liveview tech solves.
In real world applications, it's always "polling", because you're not sure when server finished your request.
Or liveview is for toy application ?
Note: You seems mislead the point here, to build interactive apps, of course you can just use websockets. What's more liveview solve ? I guess liveview = html + websocket.
- Touche 4y agoHuh? LiveView is for interactive apps. It's not finished until the user leaves the page. It's not polling.
- Cyph0n 4y agoIt is not polling - it relies on Websockets.
- realusername 4y agoIn realworld apps you have a lot of "dynamic" areas which are just "click there, ask the server for the changes and reflect that on the web page", this is where liveview is great. Another case are dynamic elements based on external factors not based on user actions (like for example the message counter on a social network), those are pretty annoying without liveview because you need to build a whole frontend event system just to change a number.
- revskill 4y agoAre you sure Facebook or Twitter is using liveview for their social feed ?
- nelsonic 4y agoFacebook or Twitter using LiveView wasn't implied by the comment. It's just an example use-case.
- realusername 4y agoI'm piking a need that is common even for small websites. I even had to implement a similar concept for a small job board.
- ing33k 4y agocheck out https://zcashblockexplorer.com/ https://zcashblockexplorer.com/ , it uses LiveView. https://zcashblockexplorer.com/mempool https://zcashblockexplorer.com/mempool
- sb8244 4y ago"What problem does React solve? You can just use HTML and jQuery to build websites." To me LiveView is not about interactive apps so much as it is a way to build applications, period. You can build in a way that may bring you more joy, performance, and dev speed than you could otherwise. Interactivity is a side effect, and it's a great one. But I wouldn't recommend LiveView if someone only wanted interactivity. I'd recommend LiveView if someone wants a different way to build than the React+API status quo.
- revskill 4y agoReact solves the composition of components, which lacks in HTML technologies. What about liveview ? That's the question. They're different.
- sb8244 4y ago"you just need to write better code to have composition with jQuery" To be clear I don't believe that, but that's analogous to what I hear when I see this. LiveView has composition of components, so there's an immediate answer to your question. You've already answered another piece with built-in soft real-time. In all honesty, if you have looked at LiveView and don't understand what it brings then I'm not sure if you looked sincerely.
- revskill 4y agoI know what it does. Instead of boilerplate to declare channels to handle live websocket, now you can just bind the real data to a DOM html. Isn't it ? Is there any more to bring ? React and similar technologies actually not just scrap your boilerplates, it's real abstraction (forget the DOM API) with state and componentation. It's not like you scrap your jquery boilerplate). I see people mess with DOM Api in their application, which is not the right way, because it's mixing different abstractions together to create a mess.
- sb8244 4y agoLiveView is also state and components. + It has a view of the DOM to optimize the data it sends over wire. It's a complete way to build complex apps. I've personally built fairly decent complexity SaaS (18mo of dev) completely on LiveView + some react when it made sense. Saying it's just HTML pushed over WebSocket is like saying React is just virtual DOM with components. There's much more to it when you get into it. Plus it's enjoyable. I had significantly more fun and development speed building on it than the typical React+API approach. That said it's still situational and I don't blindly recommend it to everyone. I think Elixir has one of the best graphql implementations (Absinthe), so I still recommend React+GQL as well.
- jjtheblunt 4y agoliveview is similar, in spirit, to how X11 apps had a client side library and a server side library (ultimately Xlib on one end), and were connected by a socket (bidirectional) over which minimal-ish data would fly back and forth to keep the client side displaying what the server wanted, and the server aware of events from the client side. liveview is also using a socket, whose existence springs to life via the "websockets" modernization where the client is a browser. and the traffic bidirectional over the socket again keeps the server side library aware of events, and the browser-side aware of UI alterations to display.
- Existenceblinks 4y agoNot all websockets are equal. If you've ever tried PhoenixChannel + PubSub .. you will know why. Also LiveView + Presence built on top of that with all niceties. And if you have more than 1 node, these also work in distributed fashion.