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.
A one-line package broke `npm create-react-app`
361–370 of 478 posts
Re: A one-line package broke `npm create-react-app`
#362Earlier 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…
Re: A one-line package broke `npm create-react-app`
#363Call 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.
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`
#364Earlier 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.
Re: A one-line package broke `npm create-react-app`
#365Earlier 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.
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`
#366As always: vendor your dependencies.
Re: A one-line package broke `npm create-react-app`
#367I 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.
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`
#368Earlier 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.
Re: A one-line package broke `npm create-react-app`
#369You 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.