Live data from Hacker News

Please just try HTMX

pleasejusttryhtmx.com

41–50 of 530 posts

Re: Please just try HTMX

#43
post #15

I am tired of people using the smallest "Hello World" example to demonstrate how something is better than React -- "See, you don't need all these things to get a website up and running!" Of course it will work. I can vibe code the most terrible web framework you have seen within 20 minutes and claim it is better than React, but what does it prove? > You write zero JavaScript > The whole library is ~14kb gzipped Oh su…

In fairness, the article has a section titled “The Numbers” which links to this: https://htmx.org/essays/a-real-world-react-to-htmx-port/

Re: Please just try HTMX

#44
post #6

Man I did try htmx, and I was hopeful, right until I saw how it polluted my codebase. I can't say I have the answers, but writing a pure Go app, I'm currently using one giant css file, custom styling and inline html. And now I'm at the breaking point. So I'm planning to move to tailwind and Go templates, but honestly, i was hopeful for htmx, so I need to properly see the usecase. Which i don't know is this. It remind…

> polluted my codebase

I'd love to hear more about that.

Re: Please just try HTMX

#45
post #24
post #21

If you never seen HTMX it is a small js library that lets you swap some part of your dom with the responses from your webserver. This means that in theory you (as a dev) don't need (to write any) js, nor do your users need to download a full page (for any interaction) like it's 1999. Your webserver replies with fully server-renderd HTML but just for the dom node (say a div) that you want to replace. It's fun for very…

> it is a small js library ... This means that in theory you don't need js I assume I'm not the only person left a little puzzled. Do you mean "don't need JS" as in like, a full-fledged JS framework?

They mean that you don't need to write JS, you can just add a script tag to your page

Re: Please just try HTMX

#47

Hey, I created htmx and while I appreciate the publicity, I’m not a huge fan of these types of hyperbolic articles. There are lots of different ways to build web apps with their own strengths and weaknesses. I try to assess htmx’s strengths and weaknesses here: https://htmx.org/essays/when-to-use-hypermedia/ Also, please try unpoly: https://unpoly.com/ It’s another excellent hypermedia oriented library Edit: the arti…

I'm curious if the author of the article is an HN reader, and if yes, how this comment is received.

Re: Please just try HTMX

#48
post #24
post #21

If you never seen HTMX it is a small js library that lets you swap some part of your dom with the responses from your webserver. This means that in theory you (as a dev) don't need (to write any) js, nor do your users need to download a full page (for any interaction) like it's 1999. Your webserver replies with fully server-renderd HTML but just for the dom node (say a div) that you want to replace. It's fun for very…

> it is a small js library ... This means that in theory you don't need js I assume I'm not the only person left a little puzzled. Do you mean "don't need JS" as in like, a full-fledged JS framework?

See the quickstart from htmx.org

    
      
      
        Click Me
      

When the user clicks the button the browser will take the result of the request to `/clicked` and swap the whole button dom node for whatever the server sent.

As a dev you get to write HTML, and need to learn about some new tag attributes.

Your browser is still running js.

Re: Please just try HTMX

#49
post #7

Sorry, but it's a no from me. htmx is a great idea, but it's not necessary anymore. We're very close to invokers being baseline (and even that is just an extension of the "composedPath includes -> invoke" pattern), and that will take care of plenty of what htmx was designed to do. Between features like that, and web components, I'm very happy to stick with "plain HTML" (no frameworks; my web components do not draw fr…

The standard invoker commands deal with the display of already loaded page content in the DOM.

HTMX deals with loading content into the DOM, not managing display of the DOM.

They serve two different roles and together should handle the majority of javascript framework use cases.

Web Components does cover some of the same use case as HTMX, but is intended for when a server is returning data rather than HTML. It is both more powerful and more complex.

> the specific example of just having a search box autocomplete can actually be fulfilled with a datalist element. It won't dynamically re-query results, but it will filter based on input. So it's a muddy example, at best, and that's probably not great for the point trying to be made.

A prefilled list is never an acceptable solution for a search box. A search box is meant to capture arbitrary input. A filterable datalist is not a search box.

Re: Please just try HTMX

#50
post #37
post #6

Man I did try htmx, and I was hopeful, right until I saw how it polluted my codebase. I can't say I have the answers, but writing a pure Go app, I'm currently using one giant css file, custom styling and inline html. And now I'm at the breaking point. So I'm planning to move to tailwind and Go templates, but honestly, i was hopeful for htmx, so I need to properly see the usecase. Which i don't know is this. It remind…

This is the thing. Htmx is great if you only consider the frontend. But it does require fixing up the backed to match. A framework like that needs to integrate the front & back ends fairly tightly to have good UX. You may be interested in Datastar which does this better IMHO https://data-star.dev/

Thanks I'll look into it, but on first glance I feel like I just got space blasted by the website! What happened to simple websites eh
Post reply on HN