News for hackers. Stuff that matters.
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:14PM (#40709818)
hey folks, i'm the creator of htmx

this isn't much of a feature upgrade, but we took the opportunity to clean up a few things and drop IE support, which will help us slim down the library over time

hopefully it's an easy upgrade for most htmx users, upgrade guide is here:

https://htmx.org/migration-guide-htmx-1/

happy to answer any questions

Re:Htmx 2.0.0 has been released by jpgvm on Monday June 17, 2024 @03:39PM (#40710107)
As someone that has long since soured on frontend things despite having tried everything from the start - mootools, jQuery, backbone.js, SproutCore, Ember, React, Vue, etc.

I genuinely think htmx is the only one I have liked even after I built something substantial in it.

To me that is big, to be able to walk away from a significant amount of time with something and say "yeah! I want to use that again!" instead of some variant of "it's the least bad option" is both rare and cherished so thanks for all the hard work.

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:44PM (#40710147)
:) glad to hear it, definitely appeals to some people (and disgusts some other people!)
Re:Htmx 2.0.0 has been released by aquariusDue on Monday June 17, 2024 @04:18PM (#40710588)
I'll join the others in praise of HTMX, it's a joy adding dynamic functionality to any website now. Thank you!
Re:Htmx 2.0.0 has been released by recursivedoubts on Tuesday June 18, 2024 @11:59AM (#40719332)
:) thank you i hope you continue to find htmx useful
Re:Htmx 2.0.0 has been released by emmanueloga_ on Monday June 17, 2024 @04:13PM (#40710524)
Oddly specific. Why implementing "forEach" and "toArray" instead of using the functions from Array.prototype? [1] I can see `Array.from` used elsewhere on the code.

---

1: https://github.com/bigskysoftware/htmx/blob/master/src/htmx....

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:14PM (#40710533)
IE support, haven't removed some of the shims, planning on doing so over time
Re:Htmx 2.0.0 has been released by lenkite on Monday June 17, 2024 @03:53PM (#40710249)
What is your opinion on https://github.com/unpoly/unpoly as a competitor ?
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:59PM (#40710348)
unpoly is a great library that sets the standard for progressive enhancement

i often recommend it for people that want a more "batteries included" hypermedia-oriented library

Re:Htmx 2.0.0 has been released by bun_terminator on Monday June 17, 2024 @03:26PM (#40709966)
Thank you. htmx has me (a c++ dev) back in the web game. I can finally build entire web frontends without a single line of explicit js.
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:31PM (#40710030)
really great to hear, i love that htmx helps folks that have been knocked out of web development get back into it
Re:Htmx 2.0.0 has been released by gaganyaan on Monday June 17, 2024 @03:32PM (#40710044)
Are there any efforts to push functionality like this into the HTML standard? It would be nice if htmx eventually became unnecessary as browsers implemented it, and the work you're doing with proving it out in the wild seems like a crucial part of that.
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:35PM (#40710076)
yes, there are, alex petros, an htmx maintainer, gave a talk at Big Sky Dev Con on the shortest path to htmx-like functionality in HTML here:

https://www.youtube.com/watch?v=inRB6ull5WQ

we are talking w/the chrome developers about these ideas, i'm cautiously optimistic

Re:Htmx 2.0.0 has been released by Alifatisk on Monday June 17, 2024 @04:20PM (#40710601)
> we are talking w/the chrome developers about these ideas

I hope this does not become a chrome-only feature in that case

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:26PM (#40710661)
agreed, but the chrome team is in communication w/the other browser makers and often drives new standards (e.g. https://developer.mozilla.org/en-US/docs/Web/API/View_Transi...)

their latest features have started leaning into improving the hypermedia infrastructure of the web so i'm optimistic

Re:Htmx 2.0.0 has been released by asimops on Monday June 17, 2024 @04:25PM (#40710646)
Do you also plan on talking with the Mozilla people? And with Apple? Or will this be a kind of big daddy Google knows what's best for you, ads included?
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:28PM (#40710689)
I don't have contacts in those groups, but chrome is in contact w/them and has pushed forward hypermedia-friendly features e.g. https://developer.mozilla.org/en-US/docs/Web/API/View_Transi...

i have told my chrome team contacts about bugs in other browsers (e.g. safari not properly updating completion results when datalist elements are replaced asynchronously) and they have communicated these issues to those teams and gotten them fixed

if anyone reading this from other browser teams is interested in getting in contact w/me they can email me at carson at bigsky dot software

Re:Htmx 2.0.0 has been released by niutech on Tuesday June 18, 2024 @10:54AM (#40718524)
HTML already allows a lot of HTMX functionality with just 166 bytes of JS glue code, see HTMZ: https://leanrada.com/htmz

You can make tabs, accordions, carousels, modals, popovers and even Pure HTML Out-Of-Order Streaming (PHOOOS) using only HTML & CSS: https://kodus.pl

Re:Htmx 2.0.0 has been released by recursivedoubts on Tuesday June 18, 2024 @11:59AM (#40719327)
yep, it's an interesting idea

we are planning on implementing a minimalist version of alex's ideas from "The Birth & Death of htmx" talk as a POC for people to look at too.

Re:Htmx 2.0.0 has been released by formo on Wednesday June 19, 2024 @02:00AM (#40725283)
Please do.
Re:Htmx 2.0.0 has been released by nickpeterson on Monday June 17, 2024 @04:00PM (#40710365)
Another, “I really like htmx” comment, currently using it for an internal corporate webapp, it’s great.
Re:Htmx 2.0.0 has been released by dpe82 on Monday June 17, 2024 @03:51PM (#40710232)
Thanks for all your hard work; htmx is a breath of fresh air and an escape from the morass of needless complexity.

My only question: how can I get a set of those sweet sweet floppy disks?

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:59PM (#40710354)
working on it, need to see if the disk guy will dropship
Re:Htmx 2.0.0 has been released by llmblockchain on Monday June 17, 2024 @03:50PM (#40710215)
Does this release have head-support built in or still requires an extension? I thought 2.0 was going to release with head support...
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:00PM (#40710360)
we went back and forth on it but ultimately concluded that it bloated the core too much so we kept it as an extension
Re:Htmx 2.0.0 has been released by highpost on Monday June 17, 2024 @04:06PM (#40710450)
Re:Htmx 2.0.0 has been released by nop_slide on Monday June 17, 2024 @04:12PM (#40710513)
Looks like it moved to here

https://extensions.htmx.org/

But this is weirdly hard to find on the new site as searching just opens a scoped google search.

Probably would be good to setup redirects to the new extensions site.

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:18PM (#40710584)
yes, need to improve that aspect of the docs, sorry!
Re:Htmx 2.0.0 has been released by nop_slide on Monday June 17, 2024 @04:35PM (#40710763)
no need to apologize :)

big congrats on the launch!

Re:Htmx 2.0.0 has been released by llmblockchain on Monday June 17, 2024 @05:18PM (#40711193)
As long as hx-boost is in core, it would make more sense to have head support in core? It's difficult to really leverage hx-boost without being able to manage the head in responses.
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @05:35PM (#40711327)
yeah, i go back and forth on it a lot

could still fold it in at some point in the 2.x line!

Re:Htmx 2.0.0 has been released by gws on Monday June 17, 2024 @03:31PM (#40710024)
No question but I wanted to say, I was pulling my hair out trying to figure out which js framework was less of an overkill, and finding htmx was pure joy
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @03:43PM (#40710145)
:) that's great to hear, i hope you find it useful
Re:Htmx 2.0.0 has been released by DLA on Monday June 17, 2024 @03:23PM (#40709932)
Huge congrats on the major number release. HTMX is simply wonderful. Using it for a major project as we speak!
Re:Htmx 2.0.0 has been released by jack_riminton on Monday June 17, 2024 @03:29PM (#40710009)
Would love to hear more about how you’re using it
Re:Htmx 2.0.0 has been released by DLA on Tuesday June 18, 2024 @10:21AM (#40718197)
We are building an enterprise application that manages (create, update data) and interacts with (read, display, enable user to browse via linked entities) a large-scale knowledge graph. In some views we have live updates from the server with SSEs (alerts, logs, etc.). Everything is rendered server side with Go + stdlib templates, Material Design Bootstrap for CSS, and HTMX for all the in interactive bits like fetching and rendering an entity's properties panel, enabling add/edit for entity or edge properties, and so on. Search updates results with HTMX. Entity/property edits are done with HTMX "panels".

The entire experience using Go + Fiber (gofiber.io) + templates + HTMX (htmx.org) is fantastic. This approach has allowed us to create a beautiful modern application that's highly performant, interactive in all the places you'd expect, and simple code, deps, devops, etc.

Re:Htmx 2.0.0 has been released by jack_riminton on Tuesday June 18, 2024 @02:43PM (#40720787)
Sounds great thanks
Re:Htmx 2.0.0 has been released by synergy20 on Thursday June 20, 2024 @07:36AM (#40737476)
do you use alpinejs for better client side reactivity?
Re:Htmx 2.0.0 has been released by DLA on Wednesday June 26, 2024 @09:42PM (#40806470)
We use the alpinejs for when we choose not to round trip the server (like data validators, for example) and for cases when we need to do some client side JSON work. Mostly htmx handles what we need. You could also consider it’s client-side template rendering extension, as needed.
Re:Htmx 2.0.0 has been released by jmorgan on Monday June 17, 2024 @04:22PM (#40710615)
Thank you for building htmx!
Re:Htmx 2.0.0 has been released by mrinterweb on Monday June 17, 2024 @04:37PM (#40710778)
Do the docs https://htmx.org/docs/ reflect 2.0 or 1.x?
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @04:38PM (#40710787)
2.x
Re:Htmx 2.0.0 has been released by droptablemain on Monday June 17, 2024 @05:36PM (#40711334)
He's the creator, but not the CEO. That title belongs to me...and you.
Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @06:09PM (#40711669)
Re:Htmx 2.0.0 has been released by logankeenan on Monday June 17, 2024 @05:49PM (#40711466)
Have you considered replacing xhr with fetch? I believe it would allow htmx to be used in even more places. Fetch can be hijacked so returning data to the htmx framework isn't limited to the network. You could "run" a server in the browser or have a native app render HTML as well.

Perhaps, there's already a good way to hijack xhr that I'm unaware of too.

Edit: Relevant link: https://logankeenan.com/posts/client-side-server-with-rust-a...

Re:Htmx 2.0.0 has been released by recursivedoubts on Monday June 17, 2024 @06:02PM (#40711592)
yeah, looked at it, unfortunately fetch() and xhr have a non-intersecting set of features (in particular, upload progress for xhr) so we decided not to touch it

i may restructure the internals to allow for mocking out responses using events, it comes up, especially w/ extensions

Re:Htmx 2.0.0 has been released by logankeenan on Monday June 17, 2024 @06:07PM (#40711645)
That'd be great, and I'd love to help in any way I can! Feel free to @mention me on Github. https://github.com/logankeenan

Thanks for making htmx!

Re:Htmx 2.0.0 has been released by w4 on Monday June 17, 2024 @07:09PM (#40712244)
Not a question, but I just wanted to say that HTMX is a joy to work. I’m using it in production to slowly replace VueJS wherever full SPA interactions aren’t needed, and it has made development so much simpler. HTMX is such a breath of fresh air from the over-engineered jenga tower that web dev has evolved into over the past decade.

Thank you!

Re:Htmx 2.0.0 has been released by recursivedoubts on Tuesday June 18, 2024 @11:57AM (#40719316)
:) great to hear
Re:Htmx 2.0.0 has been released by synergy20 on Thursday June 20, 2024 @07:31AM (#40737438)
aren't mixing vuejs and htmx making things more complicated?
Re:Htmx 2.0.0 has been released by w4 on Thursday June 20, 2024 @07:39PM (#40744683)
Not really. We were lucky that we used a hybrid multi-page architecture that makes the transition easy to manage. HTMX and VueJS are being used on different views with different routes/endpoints, so we can re-write any VueJS-based views one at a time.

This architecture was chosen partly because I am a boomer who remembers when websites were HTML files uploaded via FTP and couldn't understand why we shouldn't just return HTML for pages that didn't need app-style functionality, partly because we wanted something easy to manage with a small number of devs (HTML+vanilla js shines here), and partly because SPAs were new-ish when we first began development and the ecosystem was very immature and a long way from coalescing around a single winner (as it has now with React).

So in this case, HTMX is used with HTML templates and ordinary routing, while VueJS is isolated to single purpose SPA-style views with their own endpoints (for example, WebRTC video). And I suspect that we will even be able to eliminate the Vue-based pages altogether with a combination of HTMX and vanilla js if we want to, with how good vanilla js has gotten.

Re:Htmx 2.0.0 has been released by stereo on Tuesday June 18, 2024 @02:29AM (#40714660)
Your front page still says “IE11 compatible”.
Re:Htmx 2.0.0 has been released by niutech on Tuesday June 18, 2024 @10:46AM (#40718443)
As for slimming down over time, HTMX 1.0 was 26KB minified, now version 2.0 is 48KB minified. Why has it blown up by 184%, when it dropped IE support? Why don't keep it lightweight? Compare it with e.g. Petite Vue, which is 16KB minified.
Re:Htmx 2.0.0 has been released by recursivedoubts on Tuesday June 18, 2024 @11:57AM (#40719314)
htmx 1.9.12 was 44kb:

https://bundlephobia.com/package/[email protected]

and 2.0.0 was 45.3:

https://bundlephobia.com/package/[email protected]

i think that the better web components support blew is up a little. there is a reasonable amount of fat we can cut around IE support that is still in there, planning on doing so over the next few months & slowly

17ms over emerging 4G (and hopefully cached forever after that) doesn't freak me out too much

Re:Htmx 2.0.0 has been released by niutech on Tuesday June 18, 2024 @04:50PM (#40722092)
I was referring to HTMX 1.0.0, which was 26KB: https://bundlephobia.com/package/[email protected]

It's not only about bandwidth, but JS code has to be parsed and executed, which takes CPU time, which is especially affecting low end mobile devices. Compare HTMX with e.g. Ajaxial, which is only 5KB minified: https://ajaxial.unmodernweb.com

One more suggestion: use `<script src="https://unpkg.com/[email protected]" defer>` in `<head>` (https://htmx.org/docs/#installing).

Re:Htmx 2.0.0 has been released by recursivedoubts on Tuesday June 18, 2024 @06:25PM (#40722729)
ah, yeah, i don't know what to tell you, i've gone through the code base a bunch and there isn't much i feel like i can take out that would make much of a difference without a major step back in functionality: history support is a big one, input gathering has gotten more complex as i behave the way forms in HTML actually work, i have a lot of events that i fire, there's the queuing behavior of requests, etc.

my understanding from the browser engineers is that javascript files are compiled and kept in a cache for the browser, and i never see compilation or execution times in htmx profiles unless someone is processing a ton of htmx attributes (1000+ row tables w/ loads of hx-* attributes per row) which is an orthogonal problem

end of the day i don't think grinding out another few K on the minified source is gonna make a big diff, although we do plan on doing things like moving to modern closures (i assume gzip nukes most of that advantage, idk)

i think a minimal preact-like htmx might be interesting, not as minimal as htmz, but something close. might be worth looking at if you are interested, the concept isn't hard and w/ different design decisions you could prob keep it really small

Re:Htmx 2.0.0 has been released by knighthack on Saturday June 29, 2024 @09:28PM (#40834526)
Hey Carson! I'm using HTMX on quite a number of internal tools. It's completely revolutioned the way we've done things, especially coupled with Django. Extremely grateful for your work - you're a net positive for humanity.