Live data from Hacker News

Htmx in a Nutshell

htmx.org

61–70 of 414 posts

Re: Htmx in a Nutshell

#61

Earlier quoted context omitted.

But HTMX is a JS library. Anything done with it is basically done with JS.

Kernel is done with C. Everything is basically done with C. Even JavaScript.

That doesn't address the implications of something only working with JS at all.

Re: Htmx in a Nutshell

#62

howdy, I'm the creator of htmx, happy to talk about it

I love the model. I've been writing a golang app with the standard library template system and it works really well. One bit I've found slightly unintuitive is the swap and settled states. Took my a while to animate in a sidebar how I wanted. It was my fault for not groking it faster but perhaps some more examples or guides in that regard could be useful.

i agree

and here is a perfect place for you to contribute to the project! :)

Re: Htmx in a Nutshell

#63
post #7

Earlier quoted context omitted.

hx-post .. what? hx-put .. what? hx-delete .. what? I stopped scrolling as soon as I noticed I have to ask myself what am I posting to this URL? Maybe digging deeper I could find the reference docs explaining in very vague terms where the payload is coming from. But this was supposed to be simple.

https://htmx.org/docs/#parameters Simple doesn't mean "I should be able to intuitively understand this with under a minute of reading"...

With so many tools floating in this space the landing page MUST be clear enough. Sorry.

Re: Htmx in a Nutshell

#64

Earlier quoted context omitted.

I love the model. I've been writing a golang app with the standard library template system and it works really well. One bit I've found slightly unintuitive is the swap and settled states. Took my a while to animate in a sidebar how I wanted. It was my fault for not groking it faster but perhaps some more examples or guides in that regard could be useful.

i agree and here is a perfect place for you to contribute to the project! :)

Ha. Excellent point! I think I need to understand it better myself before I try to write something about it.

Re: Htmx in a Nutshell

#65
post #45

howdy, I'm the creator of htmx, happy to talk about it

Quick question, as it made me curious. Can I send the content that I want to swap to the server itself? Say I want to submit a form to the backend, will it only send form fields or is there a way to send the form html itself?

that would probably be best accomplished w/ a custom htmx:configRequest handler:

https://htmx.org/events/#htmx:configRequest

you could jam the outerHTML of the detail.target into the detail.parameters map, maybe based on the presence of an attribute...

Re: Htmx in a Nutshell

#66
> The fastest way to get going with htmx is to load it via a CDN

HTMLX is great and all, but loading it from a CDN is insecure and wrought with problems. Namely, the JS file in question could be hijacked and replaced with a malicious version that can steal data. It's unlikely, but still a plausible scenario. Also: the resource could just 404 and not be available due to work-in-progress scenarios on the CDN side.

I would much rather host it on my own domain that I control.

Re: Htmx in a Nutshell

#67
1. One of the most painful thing with SSR forms is passing the data back-and-forth between the server and client when there are validation errors. Sometimes the data is very sensitive and you have to return the form with some values (like SSN) empty and make the user retype that along with with whatever field(s) were the actual issue. I'm also curious about how file uploads would work.

2. REST/GraphQL/gRPC API. Often, if you want to open up your API to internal or external users it's a lot easier if the frontend was already written to deal with protobuf or JSON endpoints. Seems like it would be painful to add an API to an htmlx backend.

Is there a good way to address these with htmlx?

Re: Htmx in a Nutshell

#68
post #3

I am burnt out (but recovering!) with web dev and htmx is what I am using for my project. Django, DRF, Postgres, tailwind and HTMX. I am so tired of all the front end frameworks and all the complexity that gets added. At some point I think you need it and you get returns from it but hearing more people in the industry recognize and talk about how JS everything isn't always the answer gives me hope. I like what HTMX h…

I am so tired of everyone complaining about complexity in front end frameworks, as if this sort of thing doesn't exist in other languages and stacks, and as if frontend dev isn't as complex as other domains. Just ignore them or do something else.

Re: Htmx in a Nutshell

#69
I don't know any javascript, but is it really that bad of a language that you need new libraries every day and workarounds so that you don't have to write it?

Re: Htmx in a Nutshell

#70

Earlier quoted context omitted.

i agree and here is a perfect place for you to contribute to the project! :)

Ha. Excellent point! I think I need to understand it better myself before I try to write something about it.

hey now, I didn't understand what I was doing when I started htmx either...

not sure I do now, come to think of it

Post reply on HN