Live data from Hacker News

Htmx is part of the GitHub Accelerator

htmx.org

491–500 of 520 posts

Re: Htmx is part of the GitHub Accelerator

#491

hi there, as many of you know, i am the creator of htmx and I'm happy to answer any questions about it htmx has seen a surge in popularity, triggered by a video by fireship dev ( https://www.youtube.com/watch?v=r-GSGH2RxJs ) and a series of videos by ThePrimeagen, a popular twitch streamer on it hacker news readers might be interested in the essays I have written on htmx & hypermedia in general here: https://htmx.org…

One minor thing. This is not an issue directly with htmx, but more on the backend. This always feels clumsy for me: I land on the index page, and get the full site, then click on about page, and now htmx swaps the content for the about page. However if i refresh the url stays the same, but i now only get the content without the container. I know this can be solved with checking for a htmx header, but i feel like "the…

This annoyed me a bit but it's not a big deal.

You make two skeleton templates: One for full documents, one that has nothing in it except the parts that change (say, the meta > title, the body > main and the body > header > nav parts) each wrapped in a hx-swap-oob.

In general, out of band swaps are really, really convenient for non-hierarchical layout relationships.

Re: Htmx is part of the GitHub Accelerator

#492

Can anyone explain why Htmx is such a big deal? I really don't get their 'motivation' section on their landing page. I mean, for example, the first motivation it lists is 'Why should only and be able to make HTTP requests?', why is that an issue? And 'Why should you only be able to replace the entire screen?', I mean that hasn't been an issue since XMLHttpRequest or am I missing something?

> 'Why should only and be able to make HTTP requests?', why is that an issue?

I wouldn’t call it an issue, but maybe you would like individual elements to fetch their own data. Sure you can do the same thing with JS in the browser (calling fetch or XMLHttpRequest), but htmx lets one do it with attributes on tags.

The “replace the entire screen” business is a jab at React-like frameworks. Although they all claim to update only the DOM parts that change, it’s very easy for a codebase to [accidentally] force a full page redraw.

Re: Htmx is part of the GitHub Accelerator

#493
post #155

Earlier quoted context omitted.

The complexity is just shifted around from JS to HTMX (or hypothetically, html). Not a noticeable improvement.

I see it as much more, many things can be stripped out altogether. Client-side state management. Client-side input validation. Fallbacks for when data hasn't been loaded yet. Less async-based code, less coordination-required and event-driven code (this stuff happens but much easier and often code-free with HTMX). Its not a fit for every site or use case but more than any other front-end tool or library or framework,…

So you only do input validation on submit? Isn’t that user hostile?

This is what I don’t get about HTMX, you can’t give a good experience without client-side JS, sure some developers might love it, but that shouldn’t be the yardstick.

Re: Htmx is part of the GitHub Accelerator

#494
post #343

Earlier quoted context omitted.

Is this how Tailwind is supposed to work? I've never used it, but this sounds awful. How do you keep styles consistent across different areas of a website? Do you manually write matching styles into HTML every time you need them?

You use UI components. CSS alone can't do everything so trying to come up with class names in a .css file and then integrate them with components is wasted effort (for most things). The component is the atomic unit now.

I disagree that it’s wasted effort. Using stylesheets with components is actually very nice compared to traditional UI systems that mix style with functionality.

1. Most of us are using landscape displays. I can have my functionality on the left and my CSS on the right. If the style information is interspersed with the functionality at component level in the same file, I can’t do that and I can only see half the information at once.

2. It fits my working pattern. Usually when I’m editing styles I’m flying between the styles of many different components. If the style code was interspersed with the functionality this would be a lot slower - with stylesheets I just have to scroll.

Re: Htmx is part of the GitHub Accelerator

#495
post #360

Earlier quoted context omitted.

htmx extends html to generalize a behaviour that already exists, so it's as much a DSL as html itself is a DSL

Or Vue, yes! ("DSL" wasn't meant as a negative, I just didn't know what else one would call htmx additions.)

Yes but vue is far more involved than htmx though. Vue has its own way of architecturing your project. htmx is closer to a progressive enhancement of html

Re: Htmx is part of the GitHub Accelerator

#496
post #323

Earlier quoted context omitted.

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

Re: Htmx is part of the GitHub Accelerator

#497
post #167

Earlier quoted context omitted.

I was recounting the past. I'm sure it is "diverse" ( whatever that means ) now because it became kind of a industry standard for front-ends. Good to see diversity all around, I just wish there also would be diversity of thought and it comes to building web pages. But I guess that would lead to people admitting ~80% of all the stuff they build does not require React or equivalent js frameworks and that would be both…

It's an industry standard for people who like React. It's really that simple. This idea that they are so dominant and everyone is forced to use it is complete hogwash. JQuery and Wordpress still dominate the web completely.

Maybe you can explain this to my otherwise reasonable employer.

Re: Htmx is part of the GitHub Accelerator

#498

I like the look of htmx at first but then when I want to do something where I would usually reach for JavaScript (vanilla or framework), such as a dropdown button, I inevitably consider hyperscript and then I see an example like " " and decide I don't like having sentences in code like that and I move on to something else. Maybe I should give htmx a go without hyperscript or maybe I should give hyperscript more time.…

Yea that hyperscript code looks awful. How would it scale and handle complexity ?

Re: Htmx is part of the GitHub Accelerator

#499

hi there, as many of you know, i am the creator of htmx and I'm happy to answer any questions about it htmx has seen a surge in popularity, triggered by a video by fireship dev ( https://www.youtube.com/watch?v=r-GSGH2RxJs ) and a series of videos by ThePrimeagen, a popular twitch streamer on it hacker news readers might be interested in the essays I have written on htmx & hypermedia in general here: https://htmx.org…

Loved the memes on the essays page. It has motivated me into checking the project more thoroughly

Re: Htmx is part of the GitHub Accelerator

#500
post #453

Earlier quoted context omitted.

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.
Post reply on HN