5 ms·
PHP/Laravel have something similar to this now called Livewire https://laravel-livewire.com/ https://laravel-livewire.com/ The author, Caleb Porzio (https://ca
by francislavoie 7y ago
PHP/Laravel have something similar to this now called Livewire https://laravel-livewire.com/ https://laravel-livewire.com/
The author, Caleb Porzio (https://calebporzio.com/ https://calebporzio.com/), was inspired by Phoenix LiveView to build something something like this for his preferred language/framework.
- ashton314 7y agoI’m curious to see how well it scales. One of the big selling points for Phoenix LiveView is that the BEAM is able to handle millions of concurrent connections.
- tazard 7y agoThanks for sharing, this looks really interesting. I keep hearing about LiveView, but not knowing Phoenix, it never really clicked for me. This really clarifies it for me.
- mcintyre1994 7y agoThat’s a nice writeup of the same sort of concept, not surprised to hear it coming from the Laravel community. > 4. PHP re-renders the Blade template and sends back the HTML I’m curious if it does serverside diffing too. From the LiveView talks it sounds like it sends tiny diffs across the wire rather than a lot of html each time.
- francislavoie 7y agoCurrently the diffing is done client-side, but on a recent podcast Caleb mentioned he went back to see how LiveView is doing things now and I'm sure he'll look into lightening the payload sizes similarly.
- mwcampbell 7y agoThis looks very different from LiveView. In particular, as explained in Livewire's documentation on state management [1], state is either stored in a back-end service like Redis, or re-sent to the server with each request, depending on the type of property. And according to the home page, Ajax requests are used. With LiveView, a persistent WebSocket connection is used, and state is stored in memory in an Erlang process. [1]: https://laravel-livewire.com/docs/state-management/ https://laravel-livewire.com/docs/state-management/
- francislavoie 7y agoIt was initially implemented with websockets but that meant having to actually run a websocket server alongside the PHP app to work. Caleb went the simple route by just sticking to AJAX instead. It's a difference in how PHP is typically run (mod_php or fastcgi) vs how Erlang runs (standalone server). On his blog, he posted some videos earlier this year about the process of coming up with what eventually became Livewire, as well as a bunch of discussion on his podcast No Plans To Merge.