LiveView is great, but it's sort of becoming the default way to render everything--even static pages! TFA is a good example of this, where they use a Live view to render...a static list of icons.
The problem with this is twofold:
- LiveView is not free. It seriously affects people with unstable connections, for example. It creates a new class of silent bug at the client/server interface, where the client just sees "broken" pages (instead of 500 pages).
- It adds cognitive overhead. We bloody know how to do server side rendering. We've been doing it for 30 years (!). It's a good model. Don't make me learn something else, please.
Phoenix, which is a jewel of a framework, is risking becoming an "SPA-like" framework, with a new paradigm, and a whole lot of overhead to learn, footguns you've never encountered before, bizarre failure modes, etc.
I mean, TFA even has a section where they talk abut an obscure but that "...is a doozy, so I will save you some hours of debugging."
We don't need this!
One of the things that made Phonix/Elixir great is how simple and opinionated the core team has been. Conventions are Very Strong, but not magic. Unfortunately, LiveView is so cool (it really is!) that no conventions were built around it and it's now used for everything.
IMHO LiveView should be used with a very clear heuristic:
- If the page is static, render a static page.
- If the page is dynamic, and the content changes depending on calculations happening server side, use LiveView. It truly shines here.
- If the page is dynamic, and the content changes depending on actions performed by the client, use JS.