it is a great hypermedia library that focuses on progressive enhancement, and has some really nice features built in (e.g. layers)
highly recommended!
Sep 25, 2022 • 8 tweets • 2 min read
just because I hear this "HTML is slow" criticism so much, I threw together a simple flask app that returns a full HTML, partial HTML & JSON rep of a somewhat large contacts table (100 contacts, four columns)
this is serializing an array of simple Python domain object into HTML via Jinja templates for HTML & returning a raw dict for the JSON (which Flask calls jsonify() on)
note that I'm *not* claiming HTML serialization is faster, I would expect it to be a bit slower in most cases
Sep 16, 2022 • 4 tweets • 1 min read
if you are coming to htmx from SPA-land, you may wonder how to manage access tokens like JWT
in htmx, it is going to be much easier to establish a session via a login page, as in older web apps, and then let the natural cookie infrastructure of the web take care of things
mixing in complex front end state management of cookies is going to be annoying and error-prone
instead, you should run all server interactions through your server, authenticated via a session cookie & do server <-> server interactions behind that
a different way of thinking!
Jun 26, 2020 • 6 tweets • 3 min read
@niall_obrien you should build your web app against one set of URLs & JSON API against another
the web application URLs should be cache-happy w/ highly tuned, specific data access (SQL, etc.) for the important UIs
The JSON API should be flexible & open (GraphQL) but w/ rate-limiting, etc
@niall_obrien this also means you can have your application code running on distinct server infrastructure, and not get taken out by a bad API client