10 ms·
Htmx 2.0.0 has been released
- recursivedoubts 2y agohey 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/ https://htmx.org/migration-guide-htmx-1/ happy to answer any questions
- DLA 2y agoHuge congrats on the major number release. HTMX is simply wonderful. Using it for a major project as we speak!
- jack_riminton 2y agoWould love to hear more about how you’re using it
- DLA 2y agoWe 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.
- jack_riminton 2y agoSounds great thanks
- synergy20 2y agodo you use alpinejs for better client side reactivity?
- DLA 2y agoWe 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.
- bun_terminator 2y agoThank 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.
- recursivedoubts 2y agoreally great to hear, i love that htmx helps folks that have been knocked out of web development get back into it
- gws 2y agoNo 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
- recursivedoubts 2y ago:) that's great to hear, i hope you find it useful
- gaganyaan 2y agoAre 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.
- recursivedoubts 2y agoyes, 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 https://www.youtube.com/watch?v=inRB6ull5WQ we are talking w/the chrome developers about these ideas, i'm cautiously optimistic
- Alifatisk 2y ago> we are talking w/the chrome developers about these ideas I hope this does not become a chrome-only feature in that case
- recursivedoubts 2y agoagreed, 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_Transitions_API 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
- asimops 2y agoDo 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?
- recursivedoubts 2y agoI 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_Transitions_API 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
- jpgvm 2y agoAs 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.
- recursivedoubts 2y ago:) glad to hear it, definitely appeals to some people (and disgusts some other people!)
- llmblockchain 2y agoDoes this release have head-support built in or still requires an extension? I thought 2.0 was going to release with head support...
- recursivedoubts 2y agowe went back and forth on it but ultimately concluded that it bloated the core too much so we kept it as an extension
- highpost 2y agohttps://htmx.org/extensions/head-support/ https://htmx.org/extensions/head-support/ is returning 404.
- nop_slide 2y agoLooks like it moved to here https://extensions.htmx.org/ 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.
- recursivedoubts 2y agoyes, need to improve that aspect of the docs, sorry!
- nop_slide 2y agono need to apologize :) big congrats on the launch!
- llmblockchain 2y agoAs 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.
- dpe82 2y agoThanks 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?
- recursivedoubts 2y agoworking on it, need to see if the disk guy will dropship
- lenkite 2y agoWhat is your opinion on https://github.com/unpoly/unpoly https://github.com/unpoly/unpoly as a competitor ?
- recursivedoubts 2y agounpoly 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
- nickpeterson 2y agoAnother, “I really like htmx” comment, currently using it for an internal corporate webapp, it’s great.
- emmanueloga_ 2y agoOddly 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.js#L728-L755 https://github.com/bigskysoftware/htmx/blob/master/src/htmx....
- recursivedoubts 2y agoIE support, haven't removed some of the shims, planning on doing so over time
- aquariusDue 2y agoI'll join the others in praise of HTMX, it's a joy adding dynamic functionality to any website now. Thank you!
- recursivedoubts 2y ago:) thank you i hope you continue to find htmx useful
- jmorgan 2y agoThank you for building htmx!
- mrinterweb 2y agoDo the docs https://htmx.org/docs/ https://htmx.org/docs/ reflect 2.0 or 1.x?
- recursivedoubts 2y ago2.x
- droptablemain 2y agoHe's the creator, but not the CEO. That title belongs to me...and you.
- recursivedoubts 2y agoso true https://htmx.ceo https://htmx.ceo
- logankeenan 2y agoHave 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-new-approach-to-ui-development/ https://logankeenan.com/posts/client-side-server-with-rust-a...
- recursivedoubts 2y agoyeah, 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
- logankeenan 2y agoThat'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 https://github.com/logankeenan Thanks for making htmx!
- w4 2y agoNot 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!
- recursivedoubts 2y ago:) great to hear
- synergy20 2y agoaren't mixing vuejs and htmx making things more complicated?
- w4 2y agoNot 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.
- stereo 2y agoYour front page still says “IE11 compatible”.
- niutech 2y agoAs 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.
- recursivedoubts 2y agohtmx 1.9.12 was 44kb: https://bundlephobia.com/package/htmx.org@1.9.12 https://bundlephobia.com/package/htmx.org@1.9.12 and 2.0.0 was 45.3: https://bundlephobia.com/package/htmx.org@2.0.0-beta4 https://bundlephobia.com/package/htmx.org@2.0.0-beta4 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
- niutech 2y agoI was referring to HTMX 1.0.0, which was 26KB: https://bundlephobia.com/package/htmx.org@1.0.0 https://bundlephobia.com/package/htmx.org@1.0.0 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 https://ajaxial.unmodernweb.com One more suggestion: use `<script src="https://unpkg.com/htmx.org@2.0.0 https://unpkg.com/htmx.org@2.0.0" defer>` in `<head>` (https://htmx.org/docs/#installing https://htmx.org/docs/#installing).
- recursivedoubts 2y agoah, 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
- knighthack 2y agoHey 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.
- jerrygenser 2y agoLove the upgrade music. Wish more libraries would add upgrade music with major releases
- jph00 2y agoI just want to take advantage of this news to say: I love HTMX so much! :D It makes web development fun again. I can still use all the fancy js libs I want -- but my main logic lives on the server, using plain HTTP and HTML. Really clear and simple.
- deleted 2y ago[deleted]
- Devasta 2y agoHTMX is like a glimpse into the road not taken, where HTML is the main language of the web instead of JS. Sometimes the grass really is greener on the other side, and I hope as an industry we make the switch.
- kyrra 2y agoI believe he makes some good arguments that we really still need both, but HTML could be more powerful and allow for less JS. This is a good essay on the topic: https://htmx.org/essays/when-to-use-hypermedia/ https://htmx.org/essays/when-to-use-hypermedia/ Definitely one place htmx can be abused is oob-swap: https://htmx.org/attributes/hx-swap-oob/ https://htmx.org/attributes/hx-swap-oob/, which allows any given HTMX request to replace any part of the page. It sort of destroys the concept of locality of concern that HTMX pushes for.
- oblio 2y agoMy cynical take: this is by design. Those web committees are staffed by companies that each have their non-web platform they're pushing (or were, until it died, see Microsoft), so even the most well meaning members are somehow contorted into compromises that make the web as a platform a bad technical choice in terms of actual design, but the best one in terms of flexibility and of course ubiquity. It's completely stupid HTML, by default, doesn't have basic controls found in EVERY UI toolkit since circa 1980. The standard examples being ListView and TreeView.
- jwells89 2y ago> It's completely stupid HTML, by default, doesn't have basic controls found in EVERY UI toolkit since circa 1980. The standard examples being ListView and TreeView. This is one of my greatest frustrations with the web as a platform. These controls are so basic they should just be there, eliminating the need to sift through dozens of third-party implementations all with wildly varying feature sets, performance profiles, framework compatibility, levels of upkeep, etc to find one that works for your project.
- 2y ago
- kyrra 2y agoI thought the 2.0.0 release was a bit of a joke from the BigSkyDev conference, as he was doing stuff like this: https://twitter.com/htmx_org/status/1799661735781261592 https://twitter.com/htmx_org/status/1799661735781261592 There's even some sweet ascii art on the disk: https://twitter.com/jcs224/status/1799586838161621339 https://twitter.com/jcs224/status/1799586838161621339 Great to see the continued love of this framework. (don't throw anything at me)
- recursivedoubts 2y agoreleased exclusively on floppy disk for the first week! :)
- deleted 2y ago[deleted]
- fghfgh65h5 2y agoHTMX + static site generators is DOPE. If we had just these two things back in the 90's...
- baggachipz 2y agoI'm probably totally ignorant, but how would htmx work with a static site generator? Isn't the whole point of htmx that it extends the front end to dynamically interact with the server and get responses to inject?
- hedgehog 2y agoOn a documentation site, photo gallery, etc, it is very reasonable to use something like htmx to implement navigation without triggering full page loads.
- mbreese 2y agoYou could have static elements pre-rendered, but only loaded on demand. For example, if you had a blog with comments, you could have the comments pre rendered in htmx fragments, but only loaded when they are clicked. Or a photo gallery with thumbnails that are enlarged when clicked. At least, that’s one way it could work.
- victorbjorklund 2y agoI used it on a couple of static sites. Sometimes you just want that "SPA" navigation without a full page reload but you dont need a full JS framework
- baq 2y agowe did... almost in the 90s. one example which I distinctively remember using before AJAX was a word: https://github.com/twisted/nevow/blob/master/nevow/stan.py https://github.com/twisted/nevow/blob/master/nevow/stan.py
- recursivedoubts 2y ago@dang, i know there is an htmx filter on HN due to so many posts, but it'd be nice if this one could go to the top, it's a major release
- jack_riminton 2y ago+1, if there’s so many posts then there’s clearly pent up demand to talk about it
- buckedunicorn 2y ago[dead]
- ctxcode 2y agoi havent used htmx yet, but it sounds like a breath of fresh air. no npm library with 1000 dependencies with slow build times. just plain simple js library like the good old days ^_^
- wruza 2y agoHtmx users, can you please share your backend stacks and approaches? Me specifically interested in templaters for node (+ts) and your thoughts on endpoint management, but all ideas are welcome I guess.
- otherflavors 2y agoperl + Template Toolkit (using the underdocumented support for the fragment pattern with EXPOSE_BLOCKS), before finding htmx we used Jemplate, which let you compile Template Toolkit templates into Javascript functions
- Raticus79 2y agoI'll be trying things out with FastAPI and Jinja templating
- simonbarker87 2y agoNestJS with Handlebars templates. I don’t love Handlebars but I have past experience with it so was the most pragmatic choice. I’m interested in trying EdgeJS as a templating alternative to HB but haven’t got round to it yet. I’ve added a NestJS error handler that looks to see if the request came from an htmx request and then serve the error response as html, if not then it sends back json since I do have json api end points as well in the back end.
- pondidum 2y agoGo: go templates and fiber for http serving. I have a mini framework for adding some structure to the templates (folder per feature: contains controller, templates, etc, and some naming conventions)
- simonbarker87 2y agoOne of the happiest days of coding in the last 10 years for me happened in September last year when I added htmx to an internal self serve web app I develop for our company. With the addition of maybe 5 htmx attributes I was able to delete about 500 lines of client side JS. The app is now chock full of htmx interactions and has very little client side JS for the size of the app and it’s a joy to work on. Without htmx I would not be able to turn around features as quickly as I do for the wider team so thank you, thank you, thank you. I’ve been in web dev for 20 years and this feels like what we should have made all along. The one area I would like to see some development is the file upload experience, I’ve had to do something a bit weird to get htmx and dropzone playing nice.
- renegade-otter 2y agoI would say, this and the CSS grid/flex system has made web development almost... enjoyable.
- cztomsik 2y agocan you comment on what those 500 lines actually were? react+redux?
- smegsicle 2y agoall htmx does is replace divs on the page, so probably just code that did that
- gofreddygo 2y agocan anyone comment on what 500 lines of react+redux actually do ?
- LkpPo 2y agoAlso what line N+1 does, please.
- simonbarker87 2y agoIt was all normal JS code to handle a complicated form we have on a customer facing portal page. By moving to htmx I was able to rely on the server side to handle basically everything with only a small addition of code to what it was already doing.
- mikemitchelldev 2y agoReact's had such dominance for the last 10 years. I'm glad there's an alternative.
- KnutThroughAway 2y agoVue? Svelte? Preact? Solid? Even Angular is much saner than React. Nobody needs to use React. Never had to. HTMX is no alternative for highly interactive web apps, btw.
- jononor 2y agoHas anyone here used htmx for embedded devices? That is to provide web UI served by the device, for configuration / data access / control? Can you share the experience and if you would use it again?
- digitalsin 2y agoIt has already been pirated by various groups and made available for download assuming you have the bandwidth. Unbelievable. Big Sky has to make money somewhere.
- recursivedoubts 2y agounfair!
- xakpc 2y agohtmx works great with dotnet btw (wrote a series on that)
- xakpc 2y agoas htmx CEO I approve this message
- Ayesh 2y agoI knew about Htmx and that HN loves it. But this post is what I actually got to take a good look, and oh my god it felt like such a fresh breath! We have a few jQuery-era websites (that still work today because why not), and Htmx could be where we trim hundreds of lines.
- bradgessler 2y agoAnybody know if there’s something like HTMX that plugs into Turbo? Every time I start using a stimulus controller, I have the thought that it should be more like HTMX instead.
- gedw99 2y agoWell done https://extensions.htmx.org/ https://extensions.htmx.org/ Has a big where the “no-load” extension is listed twice
- RobotCoder 2y agoMy hot take: We initially used this library to allow us to iterate faster. But its is a pain once you reach a certain point, where it doesn't make sense to have this type of logic in HTML. I especially don't like how this library does error handling. I feel like this is the new jQuery. There is better way to represent interaction logic with open JS standards like Web Components.
- deleted 2y ago[deleted]