Live data from Hacker News

Htmx 1.0.0 Release

htmx.org

41–50 of 62 posts

Re: Htmx 1.0.0 Release

#41

I'm the creator of htmx, glad to see this make HN. Happy to answer questions.

Congratulations! I've been using Intercooler for a while now and haven't tried htmx yet, but am looking forward to switching over. I really appreciate that you're continuing to work on tools that make this approach to webdev easier.

I know the post says not to do it, but I'm planning to convert an existing project from Intercooler. Anything specific that I should watch out for while doing it, or recommendations for new capabilities that I could take advantage of as part of the switch?

Re: Htmx 1.0.0 Release

#42

I'm the creator of htmx, glad to see this make HN. Happy to answer questions.

htmx sounds great! I am interested in this from the security angle. If browsers were to natively support htmx (or something similarly declarative), it might reduce the need for Javascript and hence improve security.

Re: Htmx 1.0.0 Release

#44
I recently tried to use htmx because i like the idea. I made a table where you could click lines to expand them. Now, clicking a line would request the subcontent and insert it, easy-peezy. But now i want you to be able to click the line again to close. Hmm, in htmx this means that i’ll have to return a new parent line from the server as well... guess ill make a special template for that. Repeat this a few times and my backend templates were getting so many special cases that i just switched back to jQuery.

Perhaps i just need to learn more “htmx-like” code patterns, but they didn’t come that naturally to me.

Re: Htmx 1.0.0 Release

#45
post #3

> It's worth mentioning that, if you prefer, you can use the `data-` prefix when using htmx I don't know why people who make frameworks either prefer invalid HTML, or if they do allow people to write valid HTML they seem to show the invalid code in the docs You are not allowed to invent any old attributes you want and add them to any element and have it be valid HTML, but you can invent any attribute you want so long…

Custom attributes are used since many years now and work on every browsers. Maybe the spec should be updated to reflect the usage.

Re: Htmx 1.0.0 Release

#46

Earlier quoted context omitted.

:) It's very different than stimulus. htmx extends HTML as a hypertext, it isn't tied to any particular backend and doesn't have any binding concepts. It's really a complete different concept. I'd recommend reading the docs: https://htmx.org/docs/

Sure okay, the DSLs are different. So who’s the target audience? I’m curious to know the typical developer attracted to libraries like this. That is t saying it’s bad or anything. It’s different enough I have a genuine curiosity

In our agency augmented HTML (Htmx/Intercooler, AlpineJS, etc.) is very useful for web designers, they can go further with interactions and behaviors while staying in a HTML/CSS environment. Also it helps a lot in the communication between the design and developer teams, because there is a lot more understanding of what's going on.

Re: Htmx 1.0.0 Release

#49

I recently tried to use htmx because i like the idea. I made a table where you could click lines to expand them. Now, clicking a line would request the subcontent and insert it, easy-peezy. But now i want you to be able to click the line again to close. Hmm, in htmx this means that i’ll have to return a new parent line from the server as well... guess ill make a special template for that. Repeat this a few times and…

The htmx way to do this would be something like this (assuming a contact model per row):

The summary rows would handle a click to load the detail HTML for the contact, and replace the entire row

  
     ...
  
The detail rows would handle a click to load the summary HTML for the contact, and replace the entire row

  
     ...
  
So you would flip the row back and forth between summary and detail views. This would involve two templates server side, which seems about right, and would place the logic inside separate and fairly simple server side logic.

Note that here the URLs are encoding the row state, so we are using Hypertext As The Engine of Application State (HATEOAS) without thinking too hard about it.

Re: Htmx 1.0.0 Release

#50
post #41

I'm the creator of htmx, glad to see this make HN. Happy to answer questions.

Congratulations! I've been using Intercooler for a while now and haven't tried htmx yet, but am looking forward to switching over. I really appreciate that you're continuing to work on tools that make this approach to webdev easier. I know the post says not to do it, but I'm planning to convert an existing project from Intercooler. Anything specific that I should watch out for while doing it, or recommendations for n…

Shouldn't be too hard unless:

- you got deep into the custom headers

- you used ic-action heavily

- you used the path-dependency mechanism heavily

On a sibling comment I mentioned some new features in htmx:

- no jQuery dependency

- trigger filters: https://htmx.org/attributes/hx-trigger/

- HTML validation integration: https://htmx.org/docs/#validation

- Out of band swaps: https://htmx.org/docs/#oob_swaps

- htmx has a more advanced swapping mechanism (swap and settle, not documented well yet) that makes it easier to use CSS transitions

Happy to help out with the transition if you jump on the discord:

https://htmx.org/discord

Post reply on HN