Live data from Hacker News

Why I Don't Use React Router

jkk.github.io

31–40 of 79 posts

Re: Why I Don't Use React Router

#31
post #5
post #3

Earlier quoted context omitted.

An idea of open source is that it's very likely that your own implementation is buggier, slower, and more poorly specified than the existing state of the art open source implementation. https://en.wikipedia.org/wiki/Wisdom_of_the_crowd https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Even if your code is better than the OSS alternative now, are you going to be able to maintain it at that level, given all of your other responsibilities? I'm dealing with a bunch of people now who did something like that. At the time they made these decisions they might have had good reasons, but now they're doing other stuff and the custom things they wrote are a huge liability. Don't write it unless you intend to…

At the same time, depending on external contributions has risks.

My rule is don't introduce code unless you intend to own it.

If it is big, hard to follow, and has crazy dependencies, maybe you don't want to own it.

Re: Why I Don't Use React Router

#32

I recently started working seriously with node.js (I've tinkered over the years since it was launched, and we provide some support for it in our products, but never actually built anything with it). I went looking for a library to deal with logins, authentication, password resets, etc. Normal stuff that most web frameworks have some solutions for. I found a package on npm that sounded like it did everything I wanted…

Please name, names. It'd really help me not to accidentally pull these things into my own repository.

I'd love it if, NPM would list total package size including dependencies.

Re: Why I Don't Use React Router

#33

Justin I think you are conflating a couple issues here: 1). OSS critiques should be more polite 2). People are stupid for not doing due diligence First, I agree criticism should be constructive. Yet there is nothing wrong with 100 people saying here they don't like React Router and in fact such feedback is crucial for the authors and the community. Maybe you agree; but ironically the tone of your post seemed have a b…

Yeah maybe. To me it feels like many in the community complain and shirk responsibility, and some stern words were needed to counterbalance that position. If the community wants stability in its projects, it needs to learn what it takes to achieve that.

Re: Why I Don't Use React Router

#34
post #12
post #9

We use React Router on our project. Looks like 4.0 does break pretty much everything. My thoughts on the upgrade are pretty much: - Do we actually need to upgrade? Old react router works fine. - If we do need to upgrade - how long will it take? If it's just a few hours to shift some code around, maybe it's not that bad. Especially if it's moving to a cleaner more "react" API. At the end of the day, we could write our…

> but save the upgrade for a day where we've got nothing else to do, or if an engineer has some free time. Or when you stumble on a show-stopping bug right before a deadline, that is only fixed in supported newer versions.

This can happen with any release of any open source project. The only surefire way of dealing with it is diving into the source and fixing it yourself.

Re: Why I Don't Use React Router

#35
I'm reminded of https://medium.freecodecamp.com/you-might-not-need-react-rou... which discusses how to write your own such functionality from scratch. I often find that before adopting third party code you really have to consider it and perhaps even leave it out and feel the pain before accepting that it's necessary and adopting it. And even once you do, you should be open to maintaining or replacing it. There's a cost to roll-your-own though, you might need to write additional documentation. For routing though, it's usually one function and easy enough to grok on its own.

Re: Why I Don't Use React Router

#36

I recently started working seriously with node.js (I've tinkered over the years since it was launched, and we provide some support for it in our products, but never actually built anything with it). I went looking for a library to deal with logins, authentication, password resets, etc. Normal stuff that most web frameworks have some solutions for. I found a package on npm that sounded like it did everything I wanted…

Please name, names. It'd really help me not to accidentally pull these things into my own repository. I'd love it if, NPM would list total package size including dependencies.

I've been using a chrome extension to inject a link to this npm dependency viewer whenever I'm on a module's page: http://npm.anvaka.com/#/view/2d/react-router

Really recommend it. As you can see, react-router's deps are actually extremely conservative. Webpack, another awesome project, gives a good example of a bigg dep tree: http://npm.anvaka.com/#/view/2d/webpack

Re: Why I Don't Use React Router

#37
post #5

Earlier quoted context omitted.

Even if your code is better than the OSS alternative now, are you going to be able to maintain it at that level, given all of your other responsibilities? I'm dealing with a bunch of people now who did something like that. At the time they made these decisions they might have had good reasons, but now they're doing other stuff and the custom things they wrote are a huge liability. Don't write it unless you intend to…

Even if your code is better than the OSS alternative now, are you going to be able to maintain it at that level, given all of your other responsibilities? If someone was able to produce better code in some way before, despite any OSS alternatives available at the time, why would anyone assume they could not also maintain and develop that code more effectively than the same OSS community and projects in the future? Th…

True, but Javascript libraries tend to be pretty small and deal with well-known concepts. Many experienced dev's have seen a router 10x by the time they've come to React-Router, and the entirety of the source code can be read in a single day.

If you both (a) have experience and (b) have read and understood the entirety of a library, then you are in the best position to claim that you can do it better in house.

The prevelance of libraries doing the same thing in Javascript shows that alot of people have different ideas, and due to culture decide to open source it instead of keeping it in-house.

Other communities do the reverse. There are probably a million homebaked Java frameworks that will never see the light of day because people in Java land don't think that MVC is so extra ordinary that they need to release their in-house needs specialized framework.

Re: Why I Don't Use React Router

#38
post #30

Earlier quoted context omitted.

You make a reasonable point, but can the current join-the-dots culture of software development and having fewer “developers” who can actually perform basic development tasks themselves really be entirely unrelated?

It's the "smart" ones who are the worst, unfortunately. But I think there space for both the cut and paste crowd and the deep knowledge folks. In most industries the tool makers are separate from the users. The latter aren't worthless or subhuman because they don't do the former. In most industries there's a place for fast people and there's a place for perfectionists. Tooling is not a volume business but needs a ver…

In most industries the tool makers are separate from the users.

True, but I’m not sure software development is one of those industries.

Someone who makes pencils is not necessarily an artist, and vice versa. They require different skills and have different goals.

But where do someone who draws with those pencils, someone who makes colour-by-numbers books, and someone who uses the pencils to fill in those colour-by-numbers books fit into this analogy?

Re: Why I Don't Use React Router

#39
post #31
post #5

Earlier quoted context omitted.

Even if your code is better than the OSS alternative now, are you going to be able to maintain it at that level, given all of your other responsibilities? I'm dealing with a bunch of people now who did something like that. At the time they made these decisions they might have had good reasons, but now they're doing other stuff and the custom things they wrote are a huge liability. Don't write it unless you intend to…

At the same time, depending on external contributions has risks. My rule is don't introduce code unless you intend to own it. If it is big, hard to follow, and has crazy dependencies, maybe you don't want to own it.

"My rule is don't introduce code unless you intend to own it."

Or more accurately, you do own it. Whether you intend to or not. All its bugs are your problem now. Each upgrade to the next version, with all those new bugs and features are your problems now. Any bug that other people haven't noticed yet, they're solely your problem now. Any extra code that your use-case didn't really need but opens up more surface area for hackers, it's your problem now.

Re: Why I Don't Use React Router

#40
post #20

Earlier quoted context omitted.

> I've gotten to where I only install stuff via npm when I'm on a free connection; I normally work on mobile broadband, which is very expensive You could always use this: https://www.npmjs.com/package/npm-proxy-cache It caches the package listings and the packages that you download. It will act as a pass through that with a limited TTL on the cache, but there is an option to fallback to the cache if you can't connect…

Does the 24 copies all get bundled into the final JS file in the case of a browser app?

Of course not.

Also the modules he lists here are mostly for tooling purposes.

Post reply on HN