by thibaut_barrere · 7y ago · 0 comments
- LiveView (which I use in production & have recommended for upcoming projects too) is a complete game changer, not because it allows to remove javascript, but because it removes a boundary (between the client & the server), making development & maintenance much faster since you only have one layer, and also making very rich features easier, because you can remain stateful during the processing (if you have interactive rich UIs with e.g. file upload & processing then live reporting as you process the file, this will remind you of desktop programming, in a good way)
- While the initial setup of apps can be a bit cumbersome to my taste (like the SwitchTower period of Rails - e.g. you'll need a build server or a Docker image typically), the mental model of programming is quite simple in a lot of cases afterwards. I would say that junior developers can be onboarded quite easily (I'm starting to train some), and maintenance is quite sweet at this point.
I can warmly encourage you to try Elixir out (a nice way to get started by the way is to code ExUnit tests to try out the language, see https://github.com/thbar/elixir-playground/blob/master/test/... as a boilerplate to get started).
LiveView is the haven for apps that are focusing on B2B and internal tools in organizations. Because it doesn't have to support offline usage, and cost effective since you don't have to have a frontend team.
The user's actions are sent to the Backend via WebSocket, and the Backend rerenders (parts of) the view and sends them to the user.
So "Welcome to $mysite, $username." would initially send the full rendering but if the data changes it would only send "Hacker News,lawik" over the wire. Somewhat simplified.
This covers it quite well: https://www.youtube.com/watch?v=8xJzHq8ru0M