https://dockyard.com/blog/2018/12/12/phoenix-liveview-intera...
To the point that on my follow up project I ended up recomending for JSP with tag libraries instead, regardless of Sun advising them as deprecated and replaced by JSF.
WebForms never felt as complex as JSF.
I feel JSP like models with component libraries, or MVC are more closer approaches to the whole Web programming model.
But in more than ten years, offline mode have never been a requirement on any of the projects I worked on.
What I’m saying is that offline mode is just a feature like any other and it’s one with a huge cost in architecture complexity.
And, although it’s just my own opinion, I think if you want to be offline first, odds are that better stacks than the web exists for those needs.
The only use case I know is for map where you can download map so when you don't have 4G you will not be lost but that's the only use case I know.
They need to make sales order, survey, etc while offline and sync with our server whenever they get internet connection.
But yes we use pouch+couch to one way sync from our server to thousands device.
And from our sales force device to our server while we still save the data in pouch, we choose to use pwa's service worker to send directly to postgresql instead of pouchdb-couchdb sync.
Phoenix LiveView is a framework where it keeps websocket open with the client and renders DOM changes server side and passes it to the client [0]. Thus with fully server side development without any JS you can have almost full SPA experience.
[0] Have no experience with it, and only read about it some time ago, so don't judge me on the details, but the gist of the "LiveView" idea should be like that.
<%= live_patch "about", to: Routes.about_path(@socket, :index) %>
which creates: <a href="/about" data-phx-link="patch" data-phx-link-state="push">about</a>
The data attributes are read by the LiveView HTML and are otherwise ignored by a JSless broswer.Edited to fix glaring code sample error.
I don't see the point of going back to full server side, you have to scale more with more users.
The only benefit would be if it all worked without running JS in browsers, but it doesn't.
You can make it work when JS is disabled as well, you fall back to rendering regular HTML. It does require a little extra work, but it’s not insurmountable (e.g. using @conn instead of @socket).
>you have to scale more with more users
I might opt for additional optimizations once it gets bigger, but I’m not too worried about scaling Erlang processes.
I would much rather scale out my REST/Graph/RPC API instead of having to scale out a WS API.
And no, same hassle, same money spent. Thought about from the start server-side rendered pages are almost as cacheable as API responses will be. If you can't cache you're in for a world of expense at scale whichever way you go.