Live data from Hacker News

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

github.com

171–180 of 478 posts

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

#171
post #62

Earlier quoted context omitted.

I was wrong about what this was I have edited this comment

Why would a Rust wrapper around the C++ project that is V8, which implements a garbage-collected programming language and environment, "use less ram" just by virtue of some parts of it being written in Rust?

[deleted]

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

#172

Earlier quoted context omitted.

No. Other languages don't publish/import packages that are one line of code . I have never seen an issue like this with any other language that I've worked with. Any sane developer that needed a one-liner like this would just manually implement it. Not to mention that these sorts of functions are unnecessary in languages with a good stdlib or statically typed languages like rust, etc.

I have posted one liners to crates.io that were eventually put in the stdlib.

True this problem also exists in Rust, even going so far as people "claiming" and SELLING nice package names.

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

#174

Earlier quoted context omitted.

My company's current production electron app has 360 npm dependencies. We have CI for the UI but not for the USB/FFI stack, so any time we have to touch that code everyone blanches. > innumerable backdoors in the JavaScript ecosystem. Same goes for Python and CPAN. Any "click here for fancy module" installer has this problem.

You don't need so many dependencies with python. Python is a batteries included language, and so are most python libraries.

I fully disagree.

Open up any serious Python project and you'll find significant dependencies. Math, graphics, IO, stats, ML... anything you really want to do requires dependencies. In fact, one of my biggest issues with Python is the cross-platform incompatibility of many packages which makes it a terrible choice for my deployment. (Even worse if the project has Cython components!)

I often end up having to scour github for forked pywheels that aren't vetted. Which are then cloned ad infinitum.

Its a tradeoff between extensibility and open source / free software, and robustness.

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

#175

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,…

tbh, it's something that should be included in a standard library (not a third party package or dependency)

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

#176

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,…

I wish I had as much time as you. Looking through the source code of the millions and millions of lines of code that get packaged with any modern application before you add things to your projects sounds daunting!

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

#177
post #170

every package can be a one line package if you minify it. lines of code as a metric for code quality is always relative. The fact that this is a one line package has nothing to do with the outcome. a one-line code change in a 5000 line dependency could just as much have messed up create-react-app. The size is irrelevant.

how about "single function" instead?

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

#178
post #106

Earlier quoted context omitted.

Know what happens every time people like you say this here on HN? They post the one-liner they would have manually implemented in their code base and it's wrong . The one that comes to mind is the "is-negative-number" package. Yes, the geniuses of Hacker News, after finding out there was an npm package for determining whether something was a negative number, could not correctly implement that function. You and everyo…

> COULD NOT CORRECTLY IMPLEMENT THAT FUNCTION As opposed to blindly trusting and adding a dependency for a random library with a one liner? I don't think the "don't roll your own crypto" argument really applies here. Of course we can come up with hypothetical situations where developers are incompetent or don't test their code at all. This includes armchair analysis for a post on HN, by non-javascript developers. I w…

A package with over 11 million weekly installs vs. a brand new implementation by a coworker, when I might not necessarily be around for the code review? Absolutely. I would blindly trust the package 100% of the time. Zero hesitation.

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

#179

There is something aggravating about the first comment in an issue like this posted minutes after the issue was created to say “is this fixed yet?”

The worst part is that it was posted 10 minute later... I understand bumping a year old issue, but cmon give it a few minutes at least.

It was posted after chore: fix is-promise, they may have not realized that it's just some random pingback that github shows there, and not a message that somebody has committed a fix.

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

#180
post #106

Earlier quoted context omitted.

No. Other languages don't publish/import packages that are one line of code . I have never seen an issue like this with any other language that I've worked with. Any sane developer that needed a one-liner like this would just manually implement it. Not to mention that these sorts of functions are unnecessary in languages with a good stdlib or statically typed languages like rust, etc.

Know what happens every time people like you say this here on HN? They post the one-liner they would have manually implemented in their code base and it's wrong . The one that comes to mind is the "is-negative-number" package. Yes, the geniuses of Hacker News, after finding out there was an npm package for determining whether something was a negative number, could not correctly implement that function. You and everyo…

You may be shocked to find that there are very novice developers as well as those with 20+ years of experience who frequent HN. Using a few poorly written comments is a strawman, unless the comments you're referring to are written by the same people you're addressing here.
Post reply on HN