
Am Do., 10. Juni 2021 um 16:04 Uhr schrieb Chris Angelico <rosuav@gmail.com
:
On Thu, Jun 10, 2021 at 11:50 PM Thomas Güttler <info@thomas-guettler.de> wrote:
What's the advantage of htmx? When I want to build a good interactive web site, my general pattern is a back end with a well-defined API, and a front end in JavaScript that makes use of this API. That API is usually going to be based on either a RESTful (or roughly REST-like) JSON transactional system, or something like websockets, again carrying JSON payloads. HTML is the realm of the display, not the back end.
It depends on the use-case. If you want to create a "real" application like gmail, then it is ok to let the user wait 3 seconds until the page is loaded. But if you want your page to load fast, then the current best practice is server-side-rendering. I personally was a big fan of the "backend for frontend" solutions like GraphQL. But my mind changed. I prefer SQL+ORM and server side rendering today. HTMX gives you a way to create fast loading pages which are interactive. If you write many small methods returning small html snippets, then a f-string like solution with conditional_escape() support would be super cool. I held a talk about htmx at DjangoCon EU, here are the slides: https://docs.google.com/presentation/d/1Gx1UGVAgD2ALLOucsIm9myF5mDflbP06-M6_... But this is getting off-topic. Regards, Thomas Güttler