Live data from Hacker News

Htmx is part of the GitHub Accelerator

htmx.org

351–360 of 520 posts

Re: Htmx is part of the GitHub Accelerator

#351
post #233

Earlier quoted context omitted.

Or it's because you weren't Facebook. Like angular, react got the huge initial boost in popularity because of the brand behind it.

Absolutely, brand recognition is hugely important in whether something's a success. It can also go the other way, great ideas and tooling simply die because the brand is tainted. Not everything Microsoft has produced is terrible, but for a while there it seemed all developers I knew couldn't see past the brand even if the tooling/products/ideas were solid. I feel it's gotten better since Nadella took the reins, but t…

I agree - I'm a greybeard, so it's a bit of a bizarre world to me where Microsoft is actually a lovely, valued open source brand and probably the most ethical (depending on your definition) of all the big tech companies these days.

Time to go snow skiing in hell, I guess. It's deeply frozen over.

Re: Htmx is part of the GitHub Accelerator

#352
post #294

Earlier quoted context omitted.

Dear god. Have we forgotten about the ACCEPT header? If you get a request with ACCEPT application/json, return json. If you get one with text/html, return html.

I don't think using the accept header is a good idea. The main reason is that it doesn't necessarily play well with proxies. Most notoriously, Vary: Accept is not supported by Cloudflare (with the exception of images). This means it's not safe to use the accept header if your site will ever be backed by Cloudflare, as you could end up returning cached HTML to a JSON client or vice-versa. https://developers.cloudflare…

I’m not a fan of vendors “not supporting something” as a reason to not use something. Either get a new vendor, put pressure on the vendor, or ignore the feature you want to use.

I personally don’t care about what cloudflare does because I don’t use them.

The rest is RTFM for whatever API you are calling and you usually have to send auth or cookies anyway, so an accept header isn’t that big of a deal.

Re: Htmx is part of the GitHub Accelerator

#353
post #272

Earlier quoted context omitted.

Will HTMX 2.0 have a smaller bundle size since you are removing things? I don't think HTMX is too big or anything but I have a love tiny libraries. And on that note do you think that a smaller striped down version of HTMX is feasible like petite-vue is for vue

I don't think the bundle size will shrink too much, especially if we include the morph-style merge, which is somewhat complicated yes, I think you could do a stripped down htmx that doesn't support a lot of the stuff htmx does, particularly life cycle events and more elaborate swapping mechanism for example, most response headers could be just done as the HX-Trigger response header + some client side scripting histor…

Sounds like reasonable places to strip out stuff while keeping the fundamental features. I think the history support would be important enough to keep though.

Re: Htmx is part of the GitHub Accelerator

#354

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…

i typically have a middleware component that decides whether to render the "chrome" around a given response, so my controller methods aren't junked up with it

worth thinking more about though

Re: Htmx is part of the GitHub Accelerator

#355
post #81

Earlier quoted context omitted.

Impossible is a strong word. I've looked at their API and I can certainly imagine ways to do everything you list above in HTMX. I would need to build and use it in anger to know if it's a good way to do so but I can imagine scenarios where it definitely is. The point about a JSON API is a good point and if you need a public API then you should probably factor that into your decision making but not everything has this…

> The point about a JSON API is a good point In a well-designed system, these two are not mutually exclusive but simply two facets of the same request pipeline. The JSON API simply serializes the model as JSON. The HTMX-specifc API applies a template/transform over the model and returns HTML instead. If one thinks of hypertext as another serialization target, it's easy to see how one would easily be able to serve bot…

Oh definitely. You could control it with the `Accept: text/html` http header too so you can use the same endpoint. But as I said, you need to take that into consideration if you adopt htmx.

Re: Htmx is part of the GitHub Accelerator

#356
post #333

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…

Not the point if your post but it's amazing how influential the Fireship team is! A true developer influencer, without being a cult of personality.

yeah, he was the one that really started the madness:

https://star-history.com/#bigskysoftware/htmx&bigskysoftware...

his video posted on july 7th

Re: Htmx is part of the GitHub Accelerator

#357

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…

I can’t believe you aren’t crediting your hilarious and pervasive ~~psyops~~ meme campaign

Re: Htmx is part of the GitHub Accelerator

#358

Coming from the Unity world, I find frontend development on the web weird as hell. When accounting for the limited amount of time and mental load people have, wouldn't the best bang for your buck be doing react/vue/js?

Arguably you’ve got to learn HTML, so why then add learning React/etc on top of that? HTMX is more limited, but also _radically_ simpler to modern frontend development.

You have to learn whatever templating system you’re using on the backend as well, so not really much simpler.

Re: Htmx is part of the GitHub Accelerator

#359
post #330

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…

How do you organize a backend for a htmx based frontend? Specifically getting templates that serve as reusable components, but also endpoints (there is some proliferation of endpoints which I remember from my days with ASP.NET MVC partials.

So you start by just re-sending the entire page but with content changed. Generally you'd use query parameters, like say you have a page with a table and you need to sort it. Add to your query parameters what order you want them in, re-render the whole page.

Then once you've got it figured out you just return the part of the template that you actually need to. Makes sense when you think of it as a progressive enhancement on a plain html page.

Re: Htmx is part of the GitHub Accelerator

#360

Earlier quoted context omitted.

Much of your business logic can live in the backend, and it keeps your frontend really tiny. The idea is to generate HTML on the backend, instead of using a front-end framework to generate HTML on the client from an API call. You can also do the same in Node if you want to, I currently have a TS website that is mostly templated HTML in production (without htmx). Htmx would be perfect for that site.

> Much of your business logic can live in the backend, and it keeps your frontend really tiny. Ah, so "with htmx you can use any language" is true because its users are no longer using a programming language per se for the front-end, but instead are defining logic with htmx's DSL?

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