4 ms·
I am tired of people using the smallest "Hello World" example to demonstrate how something is better than React -- "See, you don't need all these things to get
by g947o 10mo ago
I am tired of people using the smallest "Hello World" example to demonstrate how something is better than React -- "See, you don't need all these things to get a website up and running!"
Of course it will work. I can vibe code the most terrible web framework you have seen within 20 minutes and claim it is better than React, but what does it prove?
> You write zero JavaScript
> The whole library is ~14kb gzipped
Oh sure, if there is nothing else in your UI, and if your Python/Go/whatever backend server has 0 dependency, which almost never happens.
- foldr 10mo agoIn fairness, the article has a section titled “The Numbers” which links to this: https://htmx.org/essays/a-real-world-react-to-htmx-port/ https://htmx.org/essays/a-real-world-react-to-htmx-port/
- g947o 10mo agoDifferent teams/projects have different needs and require different solutions. While it's good it worked in their favor, I am quite confident that someone else can tell a completely different story. In fact, there are some comments in this very HN discussion that detail their negative experience with htmx. I would not use one or the other to "convince" anybody to go with either solution like what this article attempts to do.
- testermelon 10mo agoDisliking evangelism is something most of us can relate. I give you that. And everything you said is very reasonable. But have you tried it though? Don’t you think it’s time to give your story? Slam your needs to htmx and see what comes out of it’s ruins?
- g947o 10mo agoI did something similar to htmx over a decade ago, so I know what it's about. And everything I need to say is already said by others in a more elegant way. > Don’t you think it’s time to give your story? I am afraid that's completely irrelevant to my comments here. If you read my posts carefully, you'll notice that I haven't said a single negative thing about htmx itself, because I want to very cautious in giving opinions. Everything I said was specifically about the horrible arguments in this article.
- komali2 10mo agoRight, it's also bothered me that the Vue docs spend so much time showing how it's a "progressive" framework. "Just use it for one component!" And show examples of how it can be lazy loaded in for your special complex spot that needs vue. Like c'mon, if I'm using Vue, I'm using Vue. Same for React. Strap me into the native state management solution for your framework, your router, your preconfigured bundler. I'm not here to mess about or I'd have just stuck with vanilla.
- jtbaker 10mo agoNot having to deal with npm and a build step can remove a huge barrier to adoption for a large number of potential adopters, or people that just want some lightweight interactivity in an app.
- mos_basik 10mo agoYep, can confirm. I first used Vue in 2016 to write some simple calculators for my group's use in Eve Online. Without its "progressive" affordances, I don't think I would have gotten anything off the ground. I had no idea how to set up a build pipeline at that point, and I think Vue was new enough that there weren't many vue-specific tutorials so I'd have been learning from React tutorials and trying to figure out what to change with zero JS background.
- Austizzle 10mo agoThat's what got me into Vue and I still use build less Vue all the time for tiny little sites that aren't worth setting up a whole CI process for. It's really lovely that it's an option. Just like how easy jQuery was to get started with back in the day, but a whole framework
- mikepurvis 10mo agoTo put a bit more colour on this, I think the fear of most devs with an ultra-simple framework like this is that eventually you hit a wall where you need it to do something it doesn't natively do, and because the only thing you know is these magical declarative hx-whatever attributes, there's no way forward. I appreciate the basic demos, but I think what would really sell me is showing the extensibility story. Show me what it looks like when I need it to do something a bit beyond what it has in the box. Where do I add the JavaScript for that? Is it raw, inline, or are we back to packages and bundling and a build step? Am I building application JS, or some kind of extension or plugin to htmx itself? How chained am I going to be to its specific paradigms and opinions? The page says htmx isn't for writing a true SPA like Google Docs, but where's the line? Show me an app that has pushed up against the limits of this system, and what happens in that scenario.
- CooCooCaCha 10mo agoWhat I don’t get is why I’d use it if I can’t write a reasonable complex SPA with it. React is easy for small websites so why would I use a separate framework when I can use one framework for everything?
- mixmastamyk 10mo agoI recently tried a hello-world in react. It made ten network requests on page load and probably had a sizable first download. That’s why web pages are so slow today.
- CooCooCaCha 10mo agoHello world in react is just a few lines of code that mounts a react component to a dom element. There should be zero network requests beyond the initial download of html and js. You’re either doing something wrong or not actually doing a hello world.
- mixmastamyk 10mo agoI don’t know but vite was involved, looks like it was setting up live updates. This is part of the problem, you can’t just include a script apparently.
- adamzwasserman 10mo agoDecisionMe is one the apps I created using htmx. I am not the owner of the company, so I cannot comp you, but I can promise in good faith: this is not a toy app.
- deleted 10mo ago[deleted]
- yoyohello13 10mo agoFor what it's worth. Our intranet apps run on a combination of Python + HTMX. We haven't run in to anything we couldn't do yet. The paradigm of swapping parts of the DOM in and out is very easy to work with.
- weiliddat 10mo agoHere's a real-time-ish planning poker written in Go + Htmx in ~500 LoC App (can take a few seconds to spin up if dormant): https://estimate.work/ https://estimate.work/ Source: https://github.com/weiliddat/estimate-work https://github.com/weiliddat/estimate-work
- ceuk 10mo agoI mean I built a pretty featureful P2P planning poker app using React and it's around 1300 lines of typescript. More, but I don't think it's a mind-blowing difference and I wasn't playing code golf when I wrote it. I wouldn't have used redux if I was! https://github.com/ceuk/planning-poker https://github.com/ceuk/planning-poker
- weiliddat 10mo agoOh cool, very interesting approach! Did a quick test, since before this I also used some very ad-heavy p2p solution, and I see similar issues there. Not sure if you're looking for feedback, but these were all issues I considered before settling on a server-based HTMX long-interrupted-polling approach, which if you think about having server + client + realtime-ish features in the context of "just htmx" + tiny LoC is pretty cool (well I think it's pretty cool :D) In the WebRTC p2p approach, without some sort of sync protocol that validates the state of data: - the host must be online / already there to join a room; the host leaving the room means everyone gets kicked! - if you rejoin a room and don't receive updates, you get a partial view of the data - if you have data connectivity issues, you get a partial view of the data - you must have a WebRTC capable browser and Internet connection
- ceuk 10mo agoYeah I set out to build something with WebRTC rather than to build a planning poker app if that makes sense. Just wanted to test out the tech. Having said that, I do still use this off and on and personally the limitations don't bug me too much. Would be a nightmare for more mission-critical software though
- epolanski 10mo agoThere's also the opposite camp: when you show very complex scenarios being simple in some technology but the hello world is harder. e.g. effect-ts which makes error handling, dependency injection, concurrency, retries, stack safety, interruptions, etc, simple but the hello world already hits people with "wait, it's 6 lines of code to print hello world!? Trash".
- AstroBen 10mo agoCheck out Fizzy from 37signals. They used a similar HATEOAS approach to build it with Hotwire https://www.fizzy.do https://www.fizzy.do source: https://github.com/basecamp/fizzy https://github.com/basecamp/fizzy I don't think this is a better approach than React. It's just an approach. It's viable. It's fine
- calhotel 10mo agoNo one is forcing you to use it. I haven't used it myself, but htmx looks to be a good solution for many web applications.
- g947o 10mo agoIs this comment relevant at all???