No todos los días veo una charla y me hace cambiar de opinión sobre una tecnología o enfoque:
«From React to htmx on a real-world SaaS product: we did it, and it's awesome!» https://www.youtube.com/watch?v=3GObi93tjZI #python#django#htmx
Forma parte de las charlas que se dieron en DjangoCon 2022.
Me ha sorprendido gratamente el enfoque de crear componentes en Django que sean renderizados a través de eventos de htmx.
Getting used to the #HTMX mental model of "every request returns an HTML response" can be difficult if you're used to just getting pure data back.
Amazingly, getting an HTML response makes it SO much easier to implement my rotation timer, because I can "calculate" the precise HTML that I want on the back-end, where I have the current state readily at hand. Which is, after all, the entire point of HATEOAS.
I get that it makes some stuff easier, but I'm not a huge fan of the fact that we've replaced virtualenvs with docker containers.
I guess I need to adapt the way I work and learn new tools, but I really hate having so many layers between me and my files. Makes debugging such a hassle 😿
(this toot brought to you by a 2h fight with docker that I apparently lost)
I've just posted a 2-part blog series on what I've dubbed "third way web development" a return to the power and simplicity of hypermedia but one that is able to meet modern UX demands that conventional wisdom says is only available in mainstream FE frameworks.
Right, #idiomorph¹ is now integrated into #Kitten² and enjoys first-class support via the <page> tag like #htmx itself, the htmx #WebSocket extension, Alpine.js, and Water semantic #CSS library.
It’s auto-loaded for you if you expose onConnect() handlers in your pages when using the new #StreamingHTML workflow.
(You must still manually add htmx-swap-oob='morph' to elements you want to morph. I might add syntactic sugar for this later.)
@andros In reality, HTMX is more than just fetch in Javascript 😅
The project goal from its website:
> "htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext" https://htmx.org/ #htmx#javascript#ajax#css#websockets#sse#html#hypertext
Very excited about the latest feature/workflow I’m adding to Kitten. I call it… 🥁
✨ Streaming HTML ✨
Implement back-end functionality and stream HTML updates to the client without writing any front-end JavaScript.
Just give your forms names and listen for them in an onConnect() handler you export from your page. Kitten handles everything else – setting up a WebSocket route for you, mapping triggers to events, etc. – thanks to Kitten + #htmx magic 🪄
Been having fun learning another web framework called Litestar, and it's pretty great. It already has a lot of htmx support built in (particularly around request and response helpers).
I decided to add Litestar support to jinja2-fragments, a little library that allows rendering of individual "blocks" from Jinja templates.
When returning a response, you can choose to send the entire template, or just one of the blocks contained within the template.
The #Glasgow2024#HugoAwards nomination process is now open, and I'm proud to say that the nomination site is an “I built that" thing; I was asked to provide the software rather last minute, and I'm pleased to see it in use like this.
Making a little Kitten app called Streamiverse that lets you create a curated streaming timeline of fediverse posts using the Mastodon API that can be consumed via WebSocket when teaching web development and creating demo apps during presentations, etc.
Previously, you could consume the public stream from a Mastodon instance directly but that feature was recently removed, breaking, among other things, the WebSocket sample app for Kitten.
It’s just a quick, small app (and it’s not done yet) but you can check out the source at https://codeberg.org/small-web/streamiverse if you want to get some idea of how simple it is to develop Small Web apps with Kitten¹.
> They either never learned, refused to learn, or didn’t find out where or even why things are done a certain way, and go diving to say “i can do better” before they even know what “better” is… much less have the ability to recognize how badly they are screwing themselves, and everyone else who gets suckered into thinking the nonsense is magically “easier”, “better”, or any of the other glittering generalities and propaganda
I just dropped fasthx on PyPI: @FastAPI and #HTMX the right (and easy) way. Supports any templating or server side rendering engine with builtin #jinja2 support. Decorator syntax, correct typing, flexibility, simplicity :)