3 ms·
While I agree in theory, in practice I find that the frontend still has all sorts of warts that don't quite make it a great solution (yet). I mean, it's better
by mercer 7y ago
While I agree in theory, in practice I find that the frontend still has all sorts of warts that don't quite make it a great solution (yet).
I mean, it's better than having to maintain both server- and client-side logic and state (and having to sync all that), and definitely better than the days where we also had to manage DOM diffing manually.
But I still get headaches from the NPM/node ecosystem, the build steps, having to decide whether logic goes on the client, server, or both, and to some extent javascript itself. And you can never fully let go of the server-side of things.
I'm very intrigued by the alternative idea of moving (almost) everything to the backend, and maintaining the dynamic bits by sending all events to the server and sending back diffs based on that which update the page. Phoenix'/Elixir's LiveView made some great progress in this area, and from what I hear other ecosystems are experimenting with the same thing.
It's not a panacea: if you need offline functionality you're gonna have to deal with js and everything that comes with it. But in many projects that's not a deal-breaker, and in practice the approach actually leads to smaller payloads sent between client and server, and significantly simpler codebases.
- imtringued 7y agoKeeping the view state in the server is what Java Server Faces did and trust me you don't want to repeat that same mistake.
- mercer 7y agoHere's an interesting response from Elixir's creator (and contributor to LiveView) specifically about JSF: https://elixirforum.com/t/phoenix-liveview-is-now-live/20889/73 https://elixirforum.com/t/phoenix-liveview-is-now-live/20889... I don't know JSF so I can't really argue this point, but I'd really love to hear what you think about the argument Jose put forward and where you might disagree!
- chessturk 7y agoI kept a real nasty implementation of this alive for the last two years while building a REST api and React frontend to replace it. I learned a good lesson, though: no logic in template files! Ever!