Hacker News new | past | comments | ask | show | jobs | submit login

https://twitter.com/foxy4096/status/1691432812870828032?s=20

This is a boon to many django developers.

I remember few month ago I was making a post liking system, before htmx, I had to use jQuery to fetch the json api server and update the like count, but with the use of HTMX, oh boy it was like I was just writing plain html along with my django logic.

This is one of the greatest thing I've found.

Also, handling forms with HTMX is also very easy.

HTMX really improve both user and developer experience.




I've also found htmx a great way to retain server side rendering with minimising the recalculation cost of client changes.

By avoiding needing to add lots of client side logic to still get very low latency updates, it's given me the best of both worlds.

The way Django's template system works also makes it so easy to render a full page initially, then expose views for subcomponents of that page with complete consistency.

On a tangent, Django's async support is still half-baked, meaning it's not great for natively supporting long polling. Using htmx to effectively retrieve pushed content from the server is impeded a little by this, but I slotted in a tiny go app between nginx and gunicorn and avoided needing async he'll without running out of threads.


The other day I wrote an htmx extension for aws api. You could describe an element using the common htmx tag such as for confirmation, triggers etc, but the ajax fetched any aws object like ec2 instances, pipelines, whatever. It's awesome!


I'd be interested in learning more about this can you share any links?


It's still very early and a wip, I haven't published anything yet.

If I get the time I will publish and link it for you.

The way it works is by leveraging the existing aws client libraries to sign and (de)serialise parameters and responses, so you can do something like:

hx-ext="aws" hx-post="aws:ec2:us-east-1" aws-action="DescribeInstances"

and it will just work with any params such as form inputs or hx-vals etc

the reason i haven't posted it yet is i want to find a good way of mapping parameters since the aws api can have some notoriously complicated parameter formats


i'm very glad to hear you are finding it useful :)


Anyone using it with Phoenix and want to share their experience?


I would think in most cases someone using Phoenix would use LiveView for these sorts of dynamic updates instead of htmx.


I think HTMX makes alot of sense for content that is a bit static but still needs some update and interactivity. Im building a job site right now and using htmx for job postlistings, search etc. And liveview for logged in view of creating and managing job posts.


a lot of elixir devs dont even believe in liveview so that's a harder sell than a phoenix backend with some more popular framework on the frontend




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: