Live data from Hacker News

A one-line package broke `npm create-react-app`

github.com

361–370 of 478 posts

Re: A one-line package broke `npm create-react-app`

#361

Earlier quoted context omitted.

I think all of the above might already be libraries on npm. From what I remember, npm has isInteger, isPositive, is-odd, is-even.

All of the packages you mentioned are maintained by the same guy.

Have you seen his twitter? It's incredibly cringey. I don't understand how someone could be so arrogant to claim millions of companies use his software, when his software is isFalse. Not to mention his hundreds of packages that literally just output an emoji.

Re: A one-line package broke `npm create-react-app`

#362

Earlier quoted context omitted.

What's "yarn zero installs"? Googling did not do it for me.

That might be referring to Yarn's "offline mirror" feature. When enabled, Yarn will cache package tarballs in the designated folder so that you can commit them to the repo. When someone else clones the repo and runs `yarn`, it will look in the offline mirror folder first, and assuming it finds packages matching the lockfile, use those. This takes up _far_ less space than trying to commit your `node_modules` folder, a…

The other similar approach is to build in containers - and use Docker layers to contain the dependencies.

Re: A one-line package broke `npm create-react-app`

#363

Call me crazy, but... I don't add things to my projects without looking at the source. Mostly because it saves me from shit like this. If I see something is small enough, and easy enough to reason about, I'll just copy-pasta that motherfucker with a comment citing the source and date it was pasta'd (license permitting). Things like this are so not worth a package, ever, it's something when you see it you go "oh yeah,…

Unless the packages you're adding are trivial I seriously doubt you're looking that close. Are you really going to code review 20000 lines of someone elses code every time you're adding something? 100,000? Also their dependencies? Those are very reasonable numbers by the way.

I said I look at them, I didn't say I inspect every single line of them. My point, which you've missed, is that simply looking at the code before you add it (spend a even a couple minutes) saves a lot of problems (like the one in create-react-app).

FWIW, I also won't add something to my project if I see it has a ton of dependencies on stupid shit. Literally, I gave up on react after realizing `create-react-app` is what the community recommends. I'm glad I did too. It's an insane amount of bloat, for nothing included but a view renderer, and if that's how that community rolls... I'm gonna have to pass.

Re: A one-line package broke `npm create-react-app`

#364
post #352
post #338

Earlier quoted context omitted.

It wouldn't work even if everything were native – see my reply above.

That applies for browsers, yes (though I'd argue is a rare edge-case), but create-react-app is a Node.js application.

create-react-app isn't even using is-promise directly. It's several hops in the dependency graph away.

Re: A one-line package broke `npm create-react-app`

#365
post #270

Earlier quoted context omitted.

create-react-app contains over 1000 packages. How long would it take to review all of those?

Too long. Therefor create-react-app is not useable for anything other than toy or hobby projects.

This.

The problem isn't reading 1000+ dependencies, the problem is the 1000+ dependencies... There's no way, setting up a view renderer, in the context of a webpage, requires a 1000+ dependencies. I honestly did this exact thing with `create-react-app` and it's one of the reasons why I don't use/choose react. Too much bloat for no batteries included.

Re: A one-line package broke `npm create-react-app`

#367
post #73

I feel the real issue here is downstream package consumers not practicing proper dependency pinning. You can blame the Node ecosystem, the maintainer of the package, etc. but there are well-known solutions to prevent this kind of situation.

So you would exchange security for stability, if you use package pinning then you will end up with fosilized packages in your product, which will have all maner of security issues that have alresdy been fixed.

If a package doesn't provide a stable branch that will receive security updates then it's not mature enough to be used anyway. That's the sensible middle ground between bleeding edge and security, unfortunately most packages/projects aren't mature enough to provide this.

There's a reason companies stick with old COBOL solutions, modern alternatives simply aren't stable enough.

Re: A one-line package broke `npm create-react-app`

#368
post #236

Earlier quoted context omitted.

Then again, this broke a package that, by its very nature, isn't running in production. And the problem was solved within three hours. So I'm not sure how much everything-used-to-be-great-nostalgia is justified here.

Someone rolls out code where a serious bug fell through QA cracks, and appears to be breaking a mission-critical path. Your biggest client is on the phone screaming FIX IT NOW. Three hours is an eternity.

Let’s add: appears to be breaking mission critical path that also slipped through cracks in QA. Mistakes happen, run CI/CD before getting to the mission critical path.

Re: A one-line package broke `npm create-react-app`

#369
Dependencies in almost any software system are fundamentally built on trust.

You trust that minor version upgrades won't break the system, or that malicious code won't be introduced. But we're human... things break.

This can happen in any ecosystem, but npm is particularly vulnerable because of it's huge dependency trees. Which is only possible due to the low overhead of creating, including and resolving packages.

That's why npm has the "package-lock" file, which takes a snapshot of the entire dependency tree, allowing a truly reproducible build. Not using this is a risk.

Post reply on HN