5 ms·
It sounds a lot like Laravel Livewire[1] Also a lot like React Server Components that we saw on HN yesterday[2] It seems like this is the next wave of web app
by llimos 6y ago
It sounds a lot like Laravel Livewire[1]
Also a lot like React Server Components that we saw on HN yesterday[2]
It seems like this is the next wave of web apps. Hopefully once the hype settles, we'll be able to decide which approach is best for which project.
[1] https://laravel-livewire.com/ https://laravel-livewire.com/
[2] https://news.ycombinator.com/item?id=25497065 https://news.ycombinator.com/item?id=25497065
- dsego 6y agoI wonder how recruiting companies will continue selling frontend react rockstars and backend nodejs warriors who can write endpoints. And yes, that's how they differentiate between frontend and backend, because knowing how to format your json urls (which is not real REST) is backend work and react is frontend.
- etxm 6y ago> not real REST Rarely admitted, but absolutely truth.
- sodapopcan 6y agoLivewire, of course, having been heavily inspired by Phoenix LiveView https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html
- bnt 6y agoTho, LiveWire is AJAX, while LiveView and Stimulus Reflex are Sockets. LW is a pleasure to work with for small pieces of interactivity.
- dnautics 6y agoI believe (but could be wrong) that liveview degrades to http long poll.
- deleted 6y ago[deleted]
- sodapopcan 6y agoIt does indeed!
- dnautics 6y agostill not sure if the degrading code is there, but you can definitely configure it to USE long-poll.
- banjomet 6y agoHow does Hotwire compare to Phoenix LiveView?
- flixic 6y agoFor one, LiveView doesn't send HTML over the WebSocket channel. It sends a highly optimized diff structure that is applied to HTML.
- nickjj 6y ago> How does Hotwire compare to Phoenix LiveView? It seems the same to me. It's much different based on a preliminary reading of Hotwire's docs. Live View uses websockets for everything. If you want to update a tiny text label in some HTML, it uses websockets to push the diff of the content that changed. However you could use LV in a way that replaces Hotwire Turbo Drive, which is aimed at page transitions, such as going from a blog index page to contact form. This way you get the benefits of not having to re-parse the <head> along with all of your CSS / JS. However LV will send those massive diffs over websockets. Hotwire Turbo Drive replaces Tubolinks 5, and it uses HTTP to transfer the content. It also has new functionality (Hotwire Turbo Frames) to do partial page updates too instead of swapping the whole body like Turbolinks 5 used to do. Websockets is only used when you want to broadcast the changes to everyone connected and that's where Hotwire Turbo Streams comes in. IMO that is a much better approach than Live View, because now only websockets get used for broadcast-like actions instead of using it to render your entire page of content if you're using LV to handle page transitions. IMO the trade off of throwing away everything we know and can leverage from HTTP to "websocket all the things" isn't one worth making. Websockets should be used when they need to, which is exactly what Hotwire does. I could be wrong of course but after reading the docs I'm about 95% sure that is an accurate assessment. If I'm wrong please correct me!
- sb8244 6y agoFwiw, you can use long polling for LiveView if you wanted. That could completely remove websockets as everything happens over http. Hotwire will benefit from caching better than LiveView, because frames are distinct URLs. But I haven't personally need that.
- mstipetic 6y agoI've just been getting into it, and am completely loving it, especially the elixir part. It feels like the whole OTP/erlang part of it (basically single codebase microservices and patterns that come with it) has proper engineering and principles behind it, and it's something I've been missing for a long time in our profession
- clementmas 6y agoCaleb Porzio (creator of Livewire) made videos about "Server-Side Applications": https://laracasts.com/series/javascript-techniques-for-server-side-developers https://laracasts.com/series/javascript-techniques-for-serve... His work inspired me to build my app (TravelMap) with SSR views: https://clem.travelmap.net https://clem.travelmap.net
- jamesvandyne 6y agoOff topic from the main thread, but Travel map looks really good. Reminds me of all the travel blogs I used to read when I was in high school / college dreaming about getting out and exploring the world. Great work!
- twsted 6y agoVery good work!