14 ms·
Dependency management fatigue, or why I ditched React for Go+HTMX+Templ
- deleted 2y ago[deleted]
- askonomm 2y agoSimilarly, my favorite web stack these days is good ol' PHP for the API and HTMX for the front-end. It keeps everything simple and all the complexity in one place. Love it.
- phplovesong 2y agoHaxe compiled to JS and PHP is my goto for traditional web apps. I get the type safety and access to a vast ecosystem. Bonus, i can share code both on the client and server.
- christophilus 2y agoDo you use haxe for your day job, or just on side projects. If professionally, I’d love to read a write up of how you use it.
- askonomm 2y agoI like to keep things as vanilla as I can because historically using languages that transpile into other languages has been quite horrible in my experience (for debugging reasons among many other things).
- schwartzworld 2y agoIt’s a little weird to say you’re ditching React, when your issues are not with React but other dependencies you’ve adopted. The choice to write a backend in Go that handles routing was always there.
- lordgroff 2y agoThat was kind of my take on this article as well. We're comparing libraries with lots of breaking-API churn vs. libraries that don't do as much, in another language. When it comes to React itself, only breaking changes I ever experienced were 17->18 and that was such a simple fix it's not worth talking about.
- kerblang 2y agoI had the impression that hash routing in React was deprecated and a React-based back end is almost a mandate now... Wondering what options people are actually taking?
- schwartzworld 2y agoThat's not a React thing, but a React Router thing.
- ggregoire 2y agoI've been using react-router for almost a decade without any issue. I deploy the apps as static websites on S3.
- martinsnow 2y agoI've never used SSR and i have quite a few react apps under my belt. Why would you need to introduce it as a full stack app?
- sleazebreeze 2y agoNot at all mandated. Buying into React server-side rendering will get you into a morass of complexity. Traditional SPAs with history-based routing still work just fine.
- christophilus 2y agoAgreed. I’ve been using Preact on an entirely client-side SPA with a simple RPC-like backend all in typescript for 5 years or so. I can’t think of a single major dependency that has changed significantly in that time. But, I did make an effort to minimize my dependencies.
- bsnnkv 2y agoI have very similar feelings to the author. I think it was back in 2019ish that I gave up on React & co for good. Since then I have built a number of web apps on a relatively spartan stack of Actix, Tera and HTMX, and they have all stood the test of maintainability over time and have a core group of diehard users. Last week I shipped another new web app[1] I got an idea for in <24h to closed alpha testers and in <7d to a public beta with no issues or fanfare. Perhaps part of the increased velocity is my having gone deep and learned the ins and outs of this stack over multiple years and projects, but it is important to note that I probably would never have gained this level of mastery over these tools if I were constantly being hit with what the author calls "dependency management fatigue". [1]: https://blucerne.app https://blucerne.app
- pdimitar 2y agoI'd love to read some blog posts on your process. Actix never struck me as super easy, at least when I checked it some 2-3 years ago.
- bsnnkv 2y agoI'd highly recommend reading some articles by Luca Palmieri[1], or even buying his book[2]. Although I didn't learn this stack by working through his book, whenever I had questions through the years, my searches usually led me to his articles which are often excerpts from the larger book. The high level of API stability and lack of churn in the Actix ecosystem makes the book a particularly good investment for someone looking to settle on this stack in my opinion. In keeping with the topic of this submission, I doubt I'd be comfortable spending money on a similar book about building web apps with React. [1]: https://www.lpalmieri.com/posts/2020-08-09-zero-to-production-3-how-to-bootstrap-a-new-rust-web-api-from-scratch https://www.lpalmieri.com/posts/2020-08-09-zero-to-productio... [2]: https://www.zero2prod.com https://www.zero2prod.com
- pdimitar 2y agoSuper helpful, thank you. My finger is hovering on the "Buy" button but I have to ask: how up to date is the book to the current Actix version / API? EDIT: Frak it, I just bought it. :D
- pawelduda 2y agoThe real dependency management hell was ~10 years ago when npm, webpack, etc. became popular (TBH not just dependency, JS in general). I feel nowadays things are better
- airstrike 2y agoThere's a curious expression in Brazil which translates to "taking the goat out of the living room". A parable tells the story that people in a living room were complaining about everything and crying out loud how miserable they were. Someone then brings a goat into the room and chaos comes about. After enough time, the goat is carried off of the room. People are now exactly as they were before, but they do not complain anymore. The just say that life is now much better without a goat in the living room. Things may be better today, but that doesn't mean they're necessarily good. Even after climbing a couple circles away from the very bottom of dependency management hell, we're still condemned to endless suffering.
- rectang 2y agoThank you. My life is better for having read through this long discussion to stumble upon this profound and hilarious fable. I will now remove the goat from the room and go do something productive.
- airstrike 2y agoLOL we aim to please! I think of it often, so I'm glad others found it useful and liked it as much as I do
- ggregoire 2y agoWhile I also think react-query should have kept v5 compatible with the v3 API (even if the new API is better, keep the old one optional, at least for a while), the migration is fairly easy and quick to do, and more importantly, it's not mandatory at all. I still have apps running v3 and v4 without any issues. Also, v3 to v5 is a bump of two major versions, it obviously implies breaking changes [1] (can't tell for Go but this happens in most part of the industry, see for example Python v2 -> v3, SQLAlchemy v1 -> v2 or psycopg v2 -> v3) and it's not like they release a new major version every week. As someone who do a good amount of frontend dev, I feel like the "dependency management fatigue" sentiment, which is very common on this forum, is way too much inflated. Just keep your dependencies to a reasonable number, pick solid dependencies that don't break their APIs every year, and don't upgrade just for the sake of it. Like you surely do with your backend environment too. [1] https://semver.org https://semver.org
- rjzzleep 2y agoThe thing with the react community is that this constantly happens with random things. You cannot at all compare python v2 -> v3. The react community has 10 python v2->v3 situations in any given year. The only reason why it works, is that Facebook and by extension the react community think it's okay to hire massive Frontend development teams.
- ggregoire 2y ago> The react community has 10 python v2->v3 situation in any given year. That is not my experience. Maybe you could share with us some examples? My most important dependencies, after React itself and TypeScript, are react-router (which released v6 in 2021) and react-query (which released v5 in 2023). I don't remember other major breaking changes in recent years, at least with the dependencies I'm using.
- tisc 2y agoEslint version 9 has been causing some headaches, as it broke all existing plugins.
- wetpaws 2y ago[dead]
- pftg 2y agoReact just doesn't meet our needs, and switching from server-side rendering to it wouldn't really benefit us.
- deleted 2y ago[deleted]
- duxup 2y agoI like reading these articles. Yet so often I have these thoughts that (feel free to replace react with anything): - Yeah why was that in react anyway? - Is the fact that the project grew into a mess a react thing or just typical project is developed over time and turns into a mess because humans. - Are these problems "react" problems or ... choices? - Is the new system better fundamentally, or better because everything got re-written after the fact / all the lessons learned were applied to it from the start? Sometimes there are answers in the articles, sometimes not.
- mark242 2y agoThe problem is not so much React as it is the JS ecosystem, but React is just very visible when you have these issues because there are so so so many packages being imported. And the root of the problem is peer dependencies and the JS community's lack of backwards compatibility and maintenance. Take any decently-sized JS application, whether React or whatever else. Put it in Github. Turn on dependabot. Watch your pull requests go up by 5-10 PRs per week, just to bump minor versions, and then watch how 1 of those PRs, every single time, fails because of a peer dependency on a lower version. This has been a problem forever in the community, and there's no good solution. There's also just no feasible way to make a solution due to the nature of the language and the platform itself. You just have to absorb that problem when you decide to use eg Node for your backend code or React/etc for your frontend code.
- skydhash 2y agoFor node and other technologies like react, I would prefer less, but fatter libraries that could be optimized at compile time. All those micro packages coming from nowhere and getting updated every day is a big pain.
- chrysoprace 2y agoOr better yet, no dependencies! The built-in's for both JavaScript and the browser APIs are getting better and better every day, but people still reach for things like Lodash and Date libraries when the equivalent functions are built into the language and runtime itself.
- solardev 2y agoSome things are easy now, but some things still require multiple lines of code: https://youmightnotneed.com/lodash https://youmightnotneed.com/lodash. If you only need one or two, sure, just write your own, but if you're maintaining a big project... why waste time debugging these common utility functions? You'd basically just be reinventing lodash, but with fewer community eyes and tests on it. Whoever inherits that is gonna need to debug all your util functions when something inevitably goes wrong. Like for _.pickBy(), none of these are very readable (https://stackoverflow.com/questions/54743996/converting-lodashs-pickby-in-to-javascript https://stackoverflow.com/questions/54743996/converting-loda...), another implements it wrong and leaves out the predicate (https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore?tab=readme-ov-file#_pickby https://github.com/you-dont-need/You-Dont-Need-Lodash-Unders...), etc. Why do this to your project and fellow devs when it can easily be a single tree-shaken function imported from a popular, well-maintained lib? If anything, ECMA should just absorb more lodash functions into the standard lib, like they've gradually done with some of the array functions. But common things like that shouldn't be up to each individual programmer & team to reinvent all the time. It just needlessly expands the maintenance surface and causes subtle bugs across teams & projects. JS Date is in an even worse place. If you ever need to work across time zones on both the server and the client/browser, native JS date is totally unusable because it "loses" the original time zone string and just coerces everything into (basically) utc milliseconds. The Temporal API is supposed to fix that, but I've been waiting for that for nearly a decade: https://tc39.es/proposal-temporal/docs/ https://tc39.es/proposal-temporal/docs/. That proposal links to https://maggiepint.com/2017/04/09/fixing-javascript-date-getting-started/ https://maggiepint.com/2017/04/09/fixing-javascript-date-get..., which explains some of the weaknesses of the current JS date system.
- wigster 2y agomade me smile - i don't know anything about the go+htmx+templ stack i thought i'd check out the htmx docs... htmx 2.0 has been released! there is no escape! ;-)
- erikpukinskis 2y agoTanner builds libraries with a huge amount of functionality. But IMO he is not great at API design. His packages often have leaky abstractions which need to be patched over time. React Table and React Query are powerful but end up simultaneously doing too much and not doing enough, because their boundaries are in the wrong place. What’s wonderful about React is that it’s _not_ a framework. It does one thing well, and then stops at a well thought out, well documented, well tested boundary. I try to only adopt libraries that also meet that standard. It means you have a lot fewer libraries you can lean on, but it means the API surface you build on will be more stable for longer.
- pests 2y ago> It does one thing well I'd love to know what that is and I'm a long term React user myself.
- jeffmcmahan 2y agoIt maps state to a set of reasonably efficient DOM updates that you generally don't have to manage or think about. Go play around with Angular 1, or BackboneJS, or try building a working SPA with jQuery, and you'll get a sense of the breakthrough that react represented in 2013.
- aniforprez 2y agoI worked with AngularJS back in 2014-15 and it was hell. We used to regularly have accidental performance dips because of the way it reacted to changes in values. IIRC it used to do two scans of all variables in all the controllers on many browser events, one for checking if something had changed and updating everything else and one for checking if the previous check changed anything that would require further updates. I don't remember the specifics now cause it's been so long but it got really costly really fast for complex applications (we were building real time WebRTC telephony interfaces). React was so much better because it came with restrictions on what changes were being checked and Angular was a total rewrite in Typescript with heavy performance improvements over AngularJS. The virtual DOM stuff truly was a revelation over everything everyone else was doing at the time.
- jeffmcmahan 2y agoReact is not responsible for the stack of poorly maintained third party packages one chooses to use alongside it. You don't actually need a router, or redux, or other "state management" nonsense. Your application code can/should handle that stuff, and it won't break, and it won't change unless you change it.
- andybak 2y ago> React is not responsible for the stack of poorly maintained third party packages one chooses to use alongside it. It's not whether or not it's responsible. It's whether you suffer this pain if you choose a different framework/platform/language. Coming from a Django/Python perspective - the Javascript ecosystem post-npm just feels pathological in this regard.
- Joel_Mckay 2y agoIn general, minimizing complexity usually pays off in the long term. My only issue with Go is getting the old bootstrap C version compiled for a new port... so it can build a modern release. In that area, the whole paradigm of needing only Go hits hard as a dependency reality check in some use-cases. JavaScript frameworks just follow a well known trajectory... =3 https://en.wikipedia.org/wiki/Second-system_effect https://en.wikipedia.org/wiki/Second-system_effect
- wild_egg 2y ago> My only issue with Go is getting the old bootstrap C version compiled for a new port Genuinely curious — how often have you had to do that? What platforms are you running that Node has binaries for but Go doesn't? I've been writing Go for 12 years and it's never taken more than a couple minutes to download and install the latest version.
- Joel_Mckay 2y agoThat is the catch, you need Go for the next release of Go... So no recent Go, means no new Go... and no deprecated Go in C means no Go to or fro... makes sense now... No? lol =3 If you are porting Go, than you may find it has a legacy dependency on the deprecated version (rarely used except for the porting use-case) which is a problem on some platforms. To list Node issues would be pointless, as most already re-discover them within minutes. =3
- xutopia 2y agoRails has Hotwire/Turbo, Phoenix has LiveView, others use various methods like Htmx to get away from the SPA nonsense a majority of us are living with.
- shreddit 2y agoHmm, I wished the author would have gone a little deeper into why Go+Htmx+Templ is better than just rant about why react is bad. Which isn’t even a react specific problem but more of a npm ecosystem one. I also ditched react on my side projects but for a whole different set of reasons.
- RapperWhoMadeIt 2y agoHi, author here! I think that is a very valid criticism. I wanted to keep the article concise, but I should have elaborated more on why Go+HTMX+Templ solves the dependency management fatigue. As I said in the article, it is mainly anecdotal evidence, i.e. the experience from having to maintain projects with either React or Go+HTMX. For example, in the Go+HTMX project I handle state management and routing solely with the Go stdlib (which is very very stable IMHO), I don't have to ever worry that a dependency update will force me to perform painful refactoring work. Maybe in a future article I can expand on these points, thank you for the feedback :)
- narrator 2y agoThe never-ending cycle of Javascript libraries continues. It's an HN cliche at this point : https://news.ycombinator.com/item?id=32914452 https://news.ycombinator.com/item?id=32914452 In fact, it reminds me of Joseph Tainter's theories in Collapse of Complex Societies. Additional civilizational complexity adds value until it starts producing negative marginal returns and then the complexity collapses and reverts to simpler forms.
- WD-42 2y agoIn just finished migrating a fairly large client project SPA with a Django backend to just straight Django + HTMX with some Alpine sprinkled in for reactivity. Went from 100s of JavaScript dependencies to 5. It feels like a massive weight off my shoulders. The SPA felt like a ticking time bomb.
- robertoandred 2y agoNow you have new dependencies which are their own ticking time bomb.
- WD-42 2y agoNo, I don’t. No new deps server side. Htmx and Alpine are self contained. They have no transitive dependencies, they don’t even require a build step. Worst case I can just vendor them.
- robertoandred 2y agoJust because something is self-contained doesn't mean it isn't a ticking time bomb.
- yawaramin 2y agoAnd also, just because something isn't self-contained, also doesn't mean it isn't a ticking time bomb. Great, now everything is a ticking time bomb. Enjoy!
- WD-42 2y agoSure, given enough time everything will rot. But there's a huge spectrum here. HTMX for example - for it to suddenly stop working browsers would have to collectively drop backwards support for their most basic of features. Now with the SPA it's very possible to have a Vue2 -> Vue3 situation, or just someone pulling a left-pad. Not to mention the build system requiring specific versions of nodejs, etc. And this is just to keep things running, not to speak of adding new stuff. It's not even really comparable.
- lpapez 2y agoNever heard about Templ before, so I went ahead to investigate it and... Wow, they reinvented PHP!
- arkh 2y agoI'm just waiting for the reinvention of php in the react ecosystem. And maybe later on a redo of HipHop.
- int_19h 2y agoNot really. PHP is not HTML-aware the way this thing seems to be, which is a fairly significant difference in practice. Notice how there's no special syntax to toggle between "this is code" and "this is output". This looks more like .NET Razor, but for Go.
- oldgregg 2y agoI love the go+alpine+htmx+templ GAHT stack as long as I have defined and limited interaction needs. Things get tricky when you need more complex interaction because there isn't much example/LLM code out there for complex situations. Then you end up having your view code split between the server and some random JS on the front end and it kinda kills the simple GHAT fun.
- darepublic 2y agoNot a fan of Tanstack. It's fine if you want to ditch react but I have to question your judgement in usage of packages like wouter and tanstack. There is a way to develop with react that requires just a handful of other dependencies and this is not the way
- aniforprez 2y agoI evaluated Tanstack for a project and it's got a lot of annoying issues with doing way too much and way too little simultaneously. I feel Tanner Linsley moves between these numerous projects a bit too much leaving the API surface of them all half baked. Specifically in my case it was the table that simply did not fit some use cases we wanted. We ended up going with react-aria instead. Very flexible, very focused on accessibility and very simple and extensible APIs and components. https://react-spectrum.adobe.com/react-aria/index.html https://react-spectrum.adobe.com/react-aria/index.html
- flanbiscuit 2y agoSo they got tired of the rate of change from 2 dependencies: Wouter and TanStackQuery, so they changed their app architecture and now they have new dependencies: HTMX and Templ. HTMX v0 to v2 in 5 years: https://www.npmjs.com/package/htmx.org?activeTab=versions https://www.npmjs.com/package/htmx.org?activeTab=versions Enough of a breaking change that they have a v1 to v2 migration guide: https://htmx.org/migration-guide-htmx-1/ https://htmx.org/migration-guide-htmx-1/ Templ is still on v0 with no breaking changes yet, but lots of minor and patch releases: https://pkg.go.dev/github.com/a-h/templ?tab=versions https://pkg.go.dev/github.com/a-h/templ?tab=versions To compare with the original packages they were complaining about: Wouter. v1 to v3 over 6 years https://www.npmjs.com/package/wouter?activeTab=versions https://www.npmjs.com/package/wouter?activeTab=versions TanStack/react-query: as npm package: 'react-query': v0 to v3 over 5 years as npm package: '@tanstack/react-query': v4 to v5 over 2 years https://www.npmjs.com/package/react-query?activeTab=versions https://www.npmjs.com/package/react-query?activeTab=versions https://www.npmjs.com/package/@tanstack/react-query?activeTab=versions https://www.npmjs.com/package/@tanstack/react-query?activeTa...
- dizhn 2y agohtmx's only major change is dropping internet explorer support.
- lyu07282 2y agoThis is kind of fascinating, they posted a migration guide that explains what code has to be updated, at the end of which they mentioned the dropped IE support. So your brain must've just ignored the code diffs above when responding, because it likes htmlx so much. 2 Examples: 1. "Convert any hx-on attributes to their hx-on: equivalent: [..] hx-on="htmx:beforeRequest: alert('Making a request!') [..] becomes: [..] hx-on:htmx:before-request="alert('Making a request!')" Note that you must use the kebab-case of the event name due to the fact that attributes are case-insensitive in HTML. 2. The htmx.makeFragment() method now always returns a DocumentFragment rather than either an Element or DocumentFragment
- 2y ago
- yayoohooyahoo 2y agoI wish backward compatibility was a thing in js library development but clearly there's nothing fun in keeping things working, so developers break API all the time for no reasons. I don't how many time I was dealing with a breaking changes for trivial things like making an API prettier, renaming a few functions, a few parameters here and there because it suits the author's aesthetic sensibilities. They're of course perfectly free to do this and being open source they don't owe anything to anybody, but I still wish that there was some degree of responsibility towards the end user. Or else why even release the code publicly? End users don't care *at all* how pretty the API is, we just want things to work.
- johnny22 2y ago> Or else why even release the code publicly? So folks who would rather not have to write the functionality themselves can use it (like myself). Nobody is forcing you to use any of this.
- causal 2y agoI always feel like these HTMX examples just shift complexity to other parts of the stack. JSX is a really elegant way to avoid templating, but we're back to templating with HTMX, and you can easily reintroduce a complex set of libraries just trying to handle that with any scale. Routing, state management, auth, components, theming, API access, and more are all still problems that people add libraries for and those problems don't go away just because you've abandoned the ecosystem with the most libraries.
- kelvinjps10 2y agoBut for those problems there are decades old frameworks like django and Ruby on rails, laravel etc that solve these issues in a simpler way
- raincole 2y agoI don't even know what problem this author has with React and how switching to HTMX is going to help them (after reading the article twice). > Some of the worst offenders in this respect were wouter (a React router package) and TanStackQuery (which I was using to fetch, cache and manage state from the backend). Ok so don't use wouter and TanStackQuery...?
- recursivedoubts 2y agoYou do collapse an implementation layer by using HATEOAS[1], which can save overall complexity in the system: https://htmx.org/essays/a-real-world-react-to-htmx-port/ https://htmx.org/essays/a-real-world-react-to-htmx-port/ It's mainly an interactivity/simplicity tradeoff, sometimes the right trade other times not. A lot of people are using JSX on the server side w/htmx because it's a good and familiar templating option on the server side. [1] - https://htmx.org/essays/hateoas/ https://htmx.org/essays/hateoas/
- causal 2y agoWait did I just get a response from Carson himself? :) Though my comment belies it I'm a big fan of the work - I started following Intercooler a decade ago and I'm happy to see how far things have come. I'm curious about HTMX + JSX, any recommended examples there?
- littlecranky67 2y ago> No, my webapp wasn’t getting any additional benefits. I was already happy with the functionality of these packages. Then why did you upgrade in the first place. Clearly there were no security issues (and those hardly play a role in Frontend world, especially in those library Tanstack and Wouter). It seems people just want to upgrade to the latest version, just to upgrade to the latest version without any benefit. I do .NET development, and I skip major versions all the time, instead of upgrading every year.
- WorldMaker 2y agoFrontend security issues do exist and can be big problems. Especially in SPA designs where the frontend runs a massive in-memory database of an entire application state. (As many of them do, especially if you are using things like frontend routing and ad hoc backend DB querying as both example libraries are about.) .NET has a security support policy that LTS versions (currently even version numbers) are supported for a couple of years and non-LTS versions (currently odd version numbers) for a year after they've been released. A lot of frontend packages don't have the maintenance budget to offer support plans on anything but the most recent major version (in part because many of them are open source and low contributor count; their own problems for the ecosystem). Don't discount security/support maintenance concerns in the frontend. Also, yes, it is a problem that many frontend packages in the ecosystem don't have maintenance policies as strong as the best backends.
- froddd 2y agoOn such popular and packages, one should reasonably expect security holes to be found and made public with relatively little delay. At that point, upgrading becomes relevant.
- nosefurhairdo 2y agoThe packages referenced in this article do not have known security vulnerabilities in the latest minor/patch versions of their previous majors. So the author is still complaining about an unnecessary update.
- 2y ago
- rasmus-kirk 2y agoCheck out htmx playground, helped me learn it better: https://lassebomh.github.io/htmx-playground/ https://lassebomh.github.io/htmx-playground/
- rasmus-kirk 2y agoCheck out htmx playground, helped me get a better grasp of it: https://lassebomh.github.io/htmx-playground/ https://lassebomh.github.io/htmx-playground/
- pjmlp 2y agoUnfortunately too many SaaS products only support React based SDK.
- oellegaard 2y agoIn general, and this applies to many language communities, you are encouraged to include all kind of garbage dependencies into your project. Adding dependencies should be something you consider carefully. Every line of code has a maintenance cost - a dependency has it times 1000. Effectively you are adding technical debt in many cases. For instance I just developed a new react app with just react and react-router. My colleagues suggested react-query but why add this when you can do all you need with a few lines of code and fetch?
- hypnotist 2y agoI feel like. there should be a framework based on go where you just compile the and ship one binary to a server.
- wild_egg 2y agoThat's Go's out-of-the-box experience. Maybe you're looking for something to scaffold projects? There are plenty around, I've been using https://gowebly.org https://gowebly.org
- rickette 2y agoWhy Templ? What's wrong with idomatic html/template.
- christophilus 2y agoIt gets clunky really fast if you’re building anything complex. Also, Templ gives compile time errors in situations where the built in templates would give you runtime errors.
- swyx 2y ago> Is it necessary to literally break the API of a fundamental component in a React webapp 5 times ?!?! i cant speak to tanstack specifics but just fyi to general HN audience that it is very normal to bump a major version just because a major dependency bumped a major version (eg Typescript or React), and often its just a sign of deprecating legacy apis than breaking anything core.
- RadiozRadioz 2y agoDeprecating "legacy APIs", from the perspective of the API users, _is_ breaking core functionality. Functionality that existed previously is now gone, that is a breaking change. Additionally, bumping a major version because a dependency changed isn't a common practice to my knowledge. In fact I'd say it's incorrect. You bump a major version if _your_ API has breaking changes. If one of your dependencies changed but you've adapted in a way that is transparent to your users, that is a patch not a major.
- acemarke 2y agoIt can be more complex than that. When we shipped React-Redux v8, we rewrote our internals to drop our own subscription management logic, and switched to React's new `useSyncExternalStore` hook instead. However, `uSES` only was added with React 18, and we still wanted to support earlier versions of React that had hooks (16.8+, 17). So, we defaulted to using React's "shim" package that provided a backwards-compatible implementation of `usES`, at the cost of a bit of extra bundle size. Once React 18 reached sufficient adoption, we wanted to drop the use of the `uSES` shim package and use the built-in version, but that required React 18 as a minimum dependency. So, we did that in a major, React-Redux v9. Code _using_ React-Redux never changed in the slightest - it's still the same `useSelector` calls either way. But given that anyone attempting to mix React-Redux v9 and React <=17 would have it break, that was clearly a major version bump for us.
- swyx 2y ago> Deprecating "legacy APIs", from the perspective of the API users, _is_ breaking core functionality. Functionality that existed previously is now gone, that is a breaking change. gotta love hyrums law
- jakubmazanec 2y agoIt seems to me that a lot of people are forgetting that when updating to next major version of a package, breaking changes are expected - that's the whole point of major version number in SemVer [1]. What they actually want is seamless updates (or never changing APIs, but that not possible in most situations, and also not what you want as a package developer - you want to be able to correct your API design mistakes). That requires a lot of work from the package developers. Look for example how people at Remix do it: breaking changes are hidden behind future flags [2], so you a user can turn them on one by one and adapt their code on gradually without surprises. Another solution is creating codemods for upgrades. But how many open-source package developers are willing do to this extra work? Same story with peer dependencies - they're completely fine, if package developers know how to use them. As always, don't be mad at React, don't curse Npm, it's not their fault. There is no great package without great effort. [1] https://semver.org/ https://semver.org/ [2] https://remix.run/docs/en/main/guides/api-development-strategy#unstable-apis-and-future-flags https://remix.run/docs/en/main/guides/api-development-strate...
- eqvinox 2y ago> It seems to me that a lot of people are forgetting that when updating to next major version of a package, breaking changes are expected No, I don't think that's the problem here. The author completely understands and accepts that a new major version will break their code. They're asking whether there's actually a benefit to these breaking changes. > seamless updates […] That requires a lot of work from the package developers. Well, the lower something is in the stack, the more likely developers seem to be to put in that work. The Linux kernel syscall API is sacred, so are most Win32 base interfaces. libc/VCRT almost as much. Python versions a little bit less. GUI toolkits and SSL libraries break a bit more frequently but tend to just be parallel install. But the more you move up the stack, the more frequent breakage you get. Same in the browser. Basic DOM is backwards compatible to the stone age, but the more things you pile on the more frequent API/update breakages become. It's really a kind of obvious logic, since the lower something is in the stack, the more things above it indirectly snake down dependencies, and the more pressure to not break things there is.
- deleted 2y ago[deleted]
- deepsun 2y agoGo dependencies are not much different. You mostly import directly from github.com, and it's a pain to review all the changelogs. Compared to Java/.Net that traditionally have fewer better tested dependency updates.
- robertoandred 2y agoI was tired of dealing with dependencies, so I adopted new dependencies!
- bionhoward 2y agoShout out to TRASH stack: Tailwind Rust Axum/Askama SQL storage HTML frontend
- CaliViking 2y agoIsn't this also a Single Page Application (SPA) problem? To me, it looks like we are building monolithic Javascript applications that are running in a browser execution engine. HTMX seems to be much more componentized.
- molszanski 2y agoIDK, I haven't changed the react dependencies in 5 years. Everything is the same and I am happy.
- molszanski 2y agoshameless plug If anyone is looking for IoC + async dependency injection in react components I've made a tiny lib that does wonders for me in a an `iti+mobx` combo https://itijs.org/docs/with-react/react-full#async-request-for-multiple-items https://itijs.org/docs/with-react/react-full#async-request-f... https://stackblitz.com/edit/github-3g8pzp?file=src%2FApp.tsx https://stackblitz.com/edit/github-3g8pzp?file=src%2FApp.tsx
- hitekker 2y agoI've been enjoying Web Components with lit-html (and not lit) so far. The developer experience is definitely worse compared to Vue, but I feel there's less ideology and careerism. Plus, Claude generates some pretty nice code out of the box!
- nine_k 2y agoIt's great when you can just pick a simpler tool, and it turns out to be an adequate tool. When you don't need the benefits which React provides for building very complex interfaces, there's no reason to put up with its complexity. There are kinds of applications though where React is indispensable, and HTMX would become unmanageable spaghetti. Stuff like Facebook (the original authors of React), GMail, Jira, etc. Such complex applications (not "websites") are relatively rare. If yours is not of this class, do explore simpler solutions unless you enjoy React and would write it for fun (and even then).
- recursivedoubts 2y agoi think you could do at least the basics of facebook, gmail and jira pretty well w/htmx: they really aren't all that interactive and are mostly text and images examples of things you couldn't do well w/htmx are google sheets and google maps, see: https://htmx.org/essays/when-to-use-hypermedia/ https://htmx.org/essays/when-to-use-hypermedia/
- eezing 2y agoMy favorite offenders are the CJS to ESM (only) conversions.
- gloosx 2y agoAuthor's frustration comes out of his personal not-necessary dependency choices, but of course his final choice was to blame the technology itself. I have one suggestion for those who are struggling with wouter, or react-video-player, or react-stank-tank-fetch or any other dependency, 100% safe way to start a successful project: npm init npm install react react-dom webpack @babel/core @babel/preset-env @babel/preset-react alias npm="echo do not use" that's it; you don't need them; they can be replaced with few hooks in 100 lines of code to fit your needs; just write javascript code, react hooks and components; don't install weird dependencies, they won't make it faster or more convenient in the long runl; if there is any other dependency everybody wants and needs, you will see it was last updated 9 years ago on GH and still works great to this day
- morbicer 2y agoThis would be an idea worth considering if you didn't pick babel which will drag a half of universe with it https://bundlephobia.com/package/babel-core https://bundlephobia.com/package/babel-core Use raw esbuild or swc; or be hassle free with Vite... or something else less cursed. I am grateful for Babel, it opened up the js development to new syntax but it's a beast from the past times. (The same applies to webpack) Transitive dependencies of those are exactly the thing Dependabot will nag you about day and night.
- gloosx 2y ago>babel which will drag a half of universe with it Why should I care about 500KiB of development dependencies, they won't end up inside the build anyway? I don't see any value in vite or other build tool since I know how to write a webpack config I need in 3 minutes, and it is the same process for almost 10 years now, just npx webpack init, adjust the config slightly and never touch it again, there is no option which is too complex or hard to grasp, just the typical output/input/modules/plugins, and you never need to update it without a good reason to. Just dependabot nagging is never a good reason to start manically updating your build dependencies
- morbicer 2y ago
- ThinkBeat 2y agoThis is good and it goes us a taste. I hope the author will write a new post when he has used the new solution on a large project (not a personal) preferably with seceral devs working on the same code.
- user3113 2y agoI used htmx for my side project https://rapidforge.io/ https://rapidforge.io/ along with Golang. I don't think you even need templ but its personal preference at this stage. I was suprised how fast I was able to finish front end work. Only part I use React was for drag and drop editor.
- anonzzzies 2y agoWe ditched react and nextjs(broth of satan himself that it is) mostly (clients we are trying to lose) for clog/cl and go/live/htmx (we rewrote two of our largest products). Days are relaxed now, sleep is better, people are no longer stressed, updates no longer lead to depression and therapy.
- ramon156 2y agoWhile I believe you, what do you mean with no more stress? We're using Node.JS + React for a simple integration. I don't have experience in React, but it doesn't seem too bad so far. I do prefer Go or Elixir but as a backend engineer I don't mind it
- anonzzzies 2y agoWe minded react somewhat less than the ever ongoing misery churn of nextjs. But it's specifically about updates/upgrades of packages that just break things for no reason (visible and invisible; like I mentioned in another post; often the author cannot explain in coherent language why they broke everything).
- p_l 2y agoI didn't expect CLOG to be mentioned in this thread at all :D Can you share some more about your use of it?
- anonzzzies 2y agoOne of the major issues with the npm (etc) ecosystem is, that people are breaking even across minor versions for no viable reason. Aka a function call has been changed and the author cannot explain to me why it is no longer backward compatible, other then 'it works for me'. It's their good right but I don't get it. Also, some packages are just 'done' besides the security fixes, but that doesn't give you kudos or vc money as people 'think the project is dead' if no updates for a week, so stuff gets changed and useless commits are done.
- deleted 2y ago[deleted]
- nenadalm 2y agoI have no experience with Go, but I use Clojure(Script) for the same reason - stable language + stable libraries. Clojure ctreator also gave talk on code breakages and why it's bad: https://m.youtube.com/watch?v=oyLBGkS5ICk&t=1114s&pp=ygUVc3BlYy11bGF0aW9uICBjbG9qdXJl https://m.youtube.com/watch?v=oyLBGkS5ICk&t=1114s&pp=ygUVc3B...
- brucehauman 2y agoSorry but dependencies are choices. Rewriting on a new stack with less dependencies is just choosing less dependencies. People seem to believe that using React requires using all the other shiny libraries. Right sizing your implementation to your needs is important. But it’s not Reacts fault, it’s the false impression that you can accrete things without cost.
- Sheenadykstra12 2y ago[dead]