8 ms·
Is Htmx Gaining in Popularity?
- andrewfromx 3y agowondering if that up and to the right is going to continue? Is it winning?
- CharlesW 3y agoAccording to that site htmx is used on 7,188 "currently live" websites, which is 0.008% of jQuery's installed base, and around half the number who've starred it on GitHub. So yes, htmx is winning.
- absoluteunit1 3y agoI’ve also noticed a rise in programming content creators discussing it. I’ve also explored it briefly a couple days ago (with a Go server) and it’s actually really really convenient to work with. My next project will definitely be in Go + htmx + tailwind and MySQL/PostgreSQL I’m excited about working with plain html again and not having to deal with over bloated js projects. Dependency issues will be a thing of the past
- robertoandred 3y agoNo dependencies, except for htmx and whatever else you need to make it work.
- yawaramin 3y agoWe didn't say 'no dependencies', we said 'dependency issues'. Htmx is a single <script> tag in your page, your custom JS is another one. That's it, unless you have specialized needs that can only be solved by more client-side JS.
- afavour 3y agoNo one said no dependencies. htmx itself has no dependencies which would make me a lot more comfortable adding it to a project.
- absoluteunit1 3y agoSorry for confusion; when I said “dependency issues will be a thing of the past” I was referring to large js projects where your dependency list is 50+; updating one dependency to a new version can be a very cumbersome task Using htmx will be breath of fresh air if you’ve ever had to deal with complex dependency issues
- DoesntMatter22 3y agoI used it on a project and I liked it but then I got into situations where I needed to pass a bunch of data back to the rendering page and it got really messy. The author says on the HTMX page that if you have this type of situation then HTMX is probably not the greatest fit. Also as the project got larger there was a lot of issues with like "Wait, why isn't this loading? Oh man someone changed the name of a div I was using". It's just not as clear when things stop working compared to most JS frameworks (which I hate, hence my interesting in HTMX). I think for smaller projects it can be decent though.
- arcanemachiner 3y agoI think it would be a good idea in these situations (many cooks in the kitchen) to use a data attribute for each HTML element that uses HTMX, such as `data-htmx-id` to reference your elements instead of just using the `id` attribute (which already carries a lot of contextual baggage). This would solve a couple potential issues: - Identifying that the element is used for HTMX swaps - Warning anyone that changing this attribute will break said HTMX swap
- DoesntMatter22 3y agoSure, there are ways to work around it but it's just fairly brittle in that way, those measures help but on a large project people are going to be breaking things relatively frequently.
- deleted 3y ago[deleted]
- mostlysimilar 3y ago> I got into situations where I needed to pass a bunch of data back to the rendering page and it got really messy. Could you not fetch that data separately from the patterns htmx provides and do some light parsing/rendering logic client-side?
- 3y ago
- ricardobeat 3y agoIf you’re aiming for simplicity, how did tailwind make it to the list? Why not use plain CSS?
- codemonkey-zeta 3y agoNot OP, but for me but for me it eliminates one more decision - naming. I don't want to think about class names or follow a convention like BEM (and probably set up linter rules so I don't do it wrong). I like sscs / BEM in some projects, but it's just one more thing to think about. With utility classes you don't think about it, you style the page as you go inline in the class attribute. The biggest hurdle is learning the utility class names, but there are good cheatsheets for that and my editor already autocompletes all the tailwind classes for me, plus whatever other classes I may have defined. I think HTMX and tailwind fit well together because I also see HTMX as a kind of "utility framework". It augments the standard html elements with additional capabilities using attributes and HATEOAS.
- Brajeshwar 3y agoIf you are not writing S/CSS or styling anything beyond what Tailwind/Boostrap (or other frameworks) already has, then it is as simple as it gets. The last time I was involved (actually writing) in a Tailwind project was in 2018. However, today, I can just look at the documentation and do a design all the way without writing any S/CSS at all.
- absoluteunit1 3y ago^This. After using it for the first time in my last next js app; played around with the basics of tailwind when I built typefaster.app and it’s my favourite css library. Also, their discord is very active and very very helpful
- a_subsystem 3y agoLive reload means I can inline edit classes as styling to quickly create components and not have to context switch to a css file/section. It feels easier to create structure and style as I go.
- wild_egg 3y agoGo + htmx + tailwind + SQLite is my current stack and it's the most enjoyable web dev experience I've had in a decade. SQLite adds an extra level of simplicity and convenience that I can't endorse enough
- hospitalJail 3y agoI wonder how much of this is familiarity. I grew up in the LAMP world, throw in laravel, and I can basically copypaste and whip stuff up. I know Apache isnt cool anymore, but I can do all sorts of crazy stuff with it after using it for 15 years. I'm not opposed to change from mariadb/mysql since the syntax is the same. I dread switching from laravel though. Maybe I should since I hate debugging php... and Laravel major versions are so destructive that basic outdated tutorials will have you frustrated.
- absoluteunit1 3y agoI’ve only been professionally developing for 3 years now and I’m starting to realize it’s all about familiarity; I think of it as “wear whatever shoes fit you best for the marathon” I mentioned Go + htmx in my original comment because I use Go at work and we do a lot of templating with the .gohtml and I absolautly love it. The ecosystem of go is what I love about it most Although I do get tempted by shiny things often; I try to remind myself to stick to a couple tools/languages
- absoluteunit1 3y agoOn interesting I like SQLite; i never thought to use it for web projects though. Any tips or advice on trying to use SQLite for web dev? What platforms do you use for deploying web apps with SQLite ?
- andrewfromx 3y agoCorrect me if I’m wrong but sqlite has no support for concurrent users right? You would have to have a mutex or queue system in production to make sure only one thing at a time tries to run sql?
- riidom 3y agoI checked one website in that list, it uses CraftCMS, which apparently has htmx bundled. (https://github.com/craftcms/cms/tree/main/src/web/assets/htmx/src https://github.com/craftcms/cms/tree/main/src/web/assets/htm...) Would be interesting to know which other CMS'es make use of htmx (and to what degree).
- pacifika 3y agoI started a WordPress integration. https://github.com/svandragt/htmxpress https://github.com/svandragt/htmxpress Early days but there is some interest.
- pictur 3y agoInstead of this ridiculous package, you can use packages with more stable specifications such as alpine.
- arcanemachiner 3y agoI've seen this misconception a lot, but HTMX and Alpine do two different things. Alpine enables client-side reactivity and does not require a round-trip to the server. Say, clicking a button and incrementing a counter on the page. HTMX enables something more akin to server-side reactivity. You could use it to modify, say, a single element in a list of elements. The crucial difference is that HTMX makes a call to a server. This means you would use it when you need to read/write data to/from the server. Alpine provides client-side reactivity. HTMX provides server-side reactivity.
- wrapperup 3y agoYup. It's pretty common to see Alpine + HTMX used together since they are both HTML first. I've heard web components work well with HTMX too.
- slig 3y agoFireship published a short video about it couple of days ago. Hopefully it'll gain even more popularity.
- andix 3y agoI never worked with HTMX, but I think that frameworks like next.js or Astro, that can render server side and client side with the same code, are superior. HTMX may work well for many websites though, especially if they are using mostly static content with limited interactivity.
- jjdeveloper 3y agoI wanted to go down this route but Astro can’t render table rows without being wrapped in a table tag. Which killed this as an option for me
- Etheryte 3y agoWhy would this be the deal breaker of all things? If necessary, you can tack on both the semantics and the layout properties to any container really.
- flagrant_taco 3y agoAstro renders JSX to html, what happened when you tried to render a table row without a wrapper table rag? And more importantly, what is a table row doing outside of a table?
- jjdeveloper 3y agoAstro removes the html tags and just renders text, so I can’t return a new table row for simple crud setup. Only when it’s a valid table does it not strip out the html.
- flagrant_taco 3y agoOh that's interesting, never seen that happen before but I must have just never run into that use case
- mrcwinn 3y agoWe're using it in production and really like it. We're very intent on removing as much React/JavaScript as possible (given the user experience we want to build). On another note, +1 to Phoenix LiveView if that stack can work for you.
- nickpeterson 3y agoI’d love to but selling elixir is such a nonstarter for most companies. I really wish there was a way to make elixir have a python moment where suddenly everyone is fine with internal teams using it.
- w4 3y agoSame here (albeit Vue, not React). It’s excellent.
- slimebot80 3y agoRemix Run is not listed? https://trends.builtwith.com/javascript https://trends.builtwith.com/javascript EDIT: under frameworks https://trends.builtwith.com/framework/Remix https://trends.builtwith.com/framework/Remix
- FractalHQ 3y agoSvelte is already so lean and provides so many QOL improvements to the whole JS/HTML/CSS experience itself that I haven’t found time to try out HTMX, but I’m keen to learn it. I imagine it would be great to stash in the armory for a rainy day. Unfortunately, my use cases almost always require way more firepower than your average website… so I’m not sure when that rainy day might come, but I dig the spirit and simplicity around HTMX.
- throwaway2990 3y agoI prefer vue over svelte but at this point anything is better than react.
- diob 3y agoDoes it work well when users have poor internet connections?
- akdor1154 3y agoNo, but neither do most SPAs.
- ssss11 3y agoNever used it - can anyone tell me how you use htmx with localStorage and webrtc?
- andrewfromx 3y agonormal javascript functions that htmx would just call: <button hx-post="/api/data" hx-swap="outerHTML" hx-trigger="click" hx-ext="localStorageHandler">Save Data</button> <script> function localStorageHandler(element) { // Get the input value const inputValue = document.getElementById('inputField').value; // Save the value to localStorage localStorage.setItem('myData', inputValue); } </script>
- ssss11 3y agoOk cool thanks!
- toastercat 3y agohtmx is often touted as an alternative to React/Vue/Svelte/etc., but is it more realistic to say htmx+backend is the alternative? In the same vein as hn.svelte.dev [1], can someone provide a htmx equivalent or some similar non-trivial demo? [1] https://hn.svelte.dev/ https://hn.svelte.dev/
- tmnvix 3y agoFor a developer already satisfied with a mature backend framework such as Django or Rails but hesitant to embrace the ever-changing JS ecosystem on the backend, it makes sense to view HTMX as an alternative to React/Vue/Svelte/etc. Given this, it makes sense to me that HTMX is popular amongst Django developers especially.
- ovao 3y agoCould someone explain the graph to me? My interpretation of the Y axis (without a legend) is that it’s the number of sites using Htmx among the top 10k/100k/1M sites, but if that’s the case, that doesn’t jive with the numbers detailed in the site totals section. E.g., this lists Htmx as being used in 143 of the top 100k sites, but in the graph it’s currently at or just below 100 on the Y axis.
- jonathan-adly 3y agoN=1 - but been building on htmx for our startup since Sep 21. We got acquired a month ago with successful exit. One of the best technical decisions we took.
- darkteflon 3y agoLove to hear more about the reasons why? Long admired it from afar but never been game enough to jump ship.
- jonathan-adly 3y agoBest thing is the dev productivity and speed of shipping. Basically, 1 person does what 3 people would do at half the time. There is a bit of challenge with separation of concern as the team gets bigger, but definitely worth it.
- dimgl 3y agoIs the app you built with it heavily dynamic? I'd love to consider HTMX for my team given the sheer volume of React code that we're having to write.
- jonathan-adly 3y agoYea - super dynamic actually with web sockets and server sent events all over the place. All what your would expect from a modern SPA SaaS.
- nickpeterson 3y agoI’m trying to push it for enterprise internal apps that do a lot of crud operations along with SQLite. It’s really only a hunch at this point, but I’m guessing it will let my mostly back-end oriented dev team more comfortably deliver web app functionality.
- mdm12 3y agoIt may be sacrilege to say this, but I have adopted Retool in my organization for the purposes of quick-and-dirty internal apps that are essentially thin GUIs around internal data stores. It has worked out well for us and even stodgy backend engineers like myself can be productive with it.
- rodolphoarruda 3y agoI'm thinking of using it with either n8n or Directus in the backend storing data in SQLite.
- mardix 3y agoIf you want the bells and whistles for the UI, fine, React/Vue/Svelte will help. If you just want something that achieves the goal, without bringing new skills or dependencies, HTMX is the way. I've used HTMX with Alpine for a backend application, and they help on making the application more dynamic, along with Tailwindcss a lot of the frontend effort is complete.
- clementmas 3y agoI'm glad to see more options to render content on the backend using stable backend languages (not Next.js). I've seen too many slow React websites that could have been rendered with simple PHP or else.
- deleted 3y ago[deleted]
- auct 3y agoIf someone think htmx is too much or htmx syntax is meh check my libraries uajax and ajax-button on github
- gumballindie 3y agoWould he great if it gained popularity and finally have react and clones fade out of mainstream development. It’s gotten to a point where react is just bad practice.
- gema_naranyala 3y agoAlready have experience building nested dropdowns and reactive search bars with Express, Liquid Templates, and Tailwind. This is a completely different sense of enjoyment, try to build a reactive modal element that displays a form in it where there is reactive value from the server.
- herewulf 3y agoI'm curious if an eventual goal of the project is for native htmx support in the browser? And cut out JS entirely?
- InvOfSmallC 3y agoI'm using it for a personal project and I'm loving it. I was wondering if anyone had "issues" due to the fact that some components (in my case a date and time picker), use some javascript to show the calendar. I don't see anyway to load it outside of when I load the actual componenet, and if I click the same button twice, it gets loaded as much generating js error because component was loaded the first time. I can of course put some global variables to check and avoid reloading, but it seems to be so patchy. There must be a better way.
- kokizzu5 3y agostill prefer Svelte '__')