Phoenix LiveView uses JS because the core of the tech requires the server to compute diffs & the client to patch the DOM accordingly. This is why a JS package is needed alongside the other default package from Phoenix, which brings Phoenix Sockets & Channels capability (which builds on top of transports such as Websocket).Previously have seen:
https://github.com/patrick-steele-idem/morphdom
Can check:
https://www.npmjs.com/package/phoenix_live_view
johnisgood|2 years ago
I do not know how true it is today.
[1] https://news.ycombinator.com/item?id=31317545
[2] https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.html
ricketycricket|2 years ago
di4na|2 years ago
If you want to handle a websocket and have a 2 way bindings, then no way around it. But that is not phoenix fault. It is the reality of the browsers api. It is pretty minimal js though.