Live data from Hacker News

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

github.com

471–478 of 478 posts

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

#471
post #467
post #464

Earlier quoted context omitted.

The problem was to get the promise out of the iframe when you shouldn't do this directly in the first place. This literally is an XY problem: "I need to do A but it's giving me bad results, what do I need to add?" - "Don't use A, it's bad practice. Use B instead and keep using built-in tools instead of hacking something together" In this case use instanceof instead of is-promise because it's a hack around the actual…

> when you shouldn't do this directly in the first place. There's absolutely nothing wrong with accessing the content of a same-origin iframe. I am sorry that you cannot admit to being wrong. > after their 6 weeks of some random bootcamp I have a Computer Science degree and 20 years of web development experience, long before npm existed. So fuck off.

I didn't even mean you but the general JS community but if you want to think I did, okay, feel free to do so.

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

#472

Earlier quoted context omitted.

Yes, that's largely my point. I'm not sure why it is surprising to see an ecosystem, twenty-five or so years younger than the one I compared it to, have the same problems as that one did twenty-five years or so ago.

It ain't surprising , but rather just disappointing, that an ecosystem can't or won't learn from the trials and tribulations of other ecosystems. EDIT: also, Node's more than a decade old at this point, so it is at least a little bit surprising that the ecosystem is still experiencing these sorts of issues.

Is it really though? Node is infamous for attracting large groups of people with notoriously misguided engineering practices whose egos far surpass their experience and knowledge.

I've been stuck using it for about 4 years and it makes me literally hate computers and programming. Everything is so outrageously bad and wrapped in smarmy self congratulating bullshit. It's just so staggeringly terrible...

So these kind of catastrophes every few months for bullshit reasons seem kind of obvious and expected, doesn't it?

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

#473

Earlier quoted context omitted.

Here's my off-the-cuff take that will not be popular. A function like this should be a package . Or, really, part of standard js, maybe. A) The problem it solves is real. It's dumb, but JS has tons of dumb stuff, so that changes nothing. Sometimes you want to know "is this thing a promise", and that's not trivial (for reasons). B) The problem it solves is not straightforward. If you Google around you'll get people sa…

>Or, really, part of standard js, maybe. I think this would be the solution. I feel like a lot of the NPM transitive dependency explosion just comes from the fact that JavaScript is a language with a ton of warts and a lack of solid built-ins compared to e.g. Python. Python also has packages and dependencies, but the full list of dependencies used by a REST service I run in production (including a web framework and O…

There's a rich standard library, you don't need a package to left-pad.

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

#474
post #421

Earlier quoted context omitted.

Here's my off-the-cuff take that will not be popular. A function like this should be a package . Or, really, part of standard js, maybe. A) The problem it solves is real. It's dumb, but JS has tons of dumb stuff, so that changes nothing. Sometimes you want to know "is this thing a promise", and that's not trivial (for reasons). B) The problem it solves is not straightforward. If you Google around you'll get people sa…

No. There is no reason why it should be a package by itself. It should be part of a bigger util package, which which is well maintained, tested, and with many maintainers actively looking at it, with good processes, such as systematic code reviews, etc. At work, our big webapp depended at some point indirectly on "isobject" "isobj" and "is-object", which were all one liners (some of them even had dependencies themsel…

Yep, in Java-land this would be in an Apache Common's (or Guava, etc) module with dozens and dozens of other useful functionality.

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

#475
post #427

Earlier quoted context omitted.

> The number of developers duplicates each 5 years You probably mean "double" here, but the bottom line is that there is zero data to back up that claim. He literally made up that number out of thin air to make his talk look more important.

It should be fairly simple to look up people describing themselves as developers in the census data I think?

Not as easy as you might think, since “developers” isn't particular to software and software developers have lots of other near-equivalent terms, the set of which in use changes over time, and many of them aren't unique to software, either.

OTOH, historical BLS data is easy to look up.

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

#476

Earlier quoted context omitted.

> The UHH is a fun read, yes, but the biggest real-world problem with the Unix Wars was cross-compatibility. Your Sun code didn't run on Irix didn't run on BSD and god help you if a customer wanted Xenix. OK, you can draw some parallel here between React vs. Vue vs. Zeit vs. whatever POSIX is a set of IEEE standards that have been around in one form or another since the 80s, maybe JavaScript could follow Unix's path…

The existence of such a standard doesn't automatically guarantee compliance. There are plenty of APIs outside the scope of POSIX, plenty of places where POSIX has very under specified behavior, and even then, the compliance test suite doesn't test all of the rules and you still get tons of incompatibilities. POSIX was, for the most part, not a major success. The sheer dominance of Linux monoculture makes that easy to…

Of course it doesn't guarantee compliance, but like all standards it makes interop possible in a predictable way, e.g. some tcsh scripts run fine under bash, but that's not by design. The inability or unwillingness of concerned parties to adopt the standard is a separate problem. This is why "posixly" is an adverb with meaning here.

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

#477
post #7

And the source code of the library is: function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }

Irony is there's a simpler way to do it, making the library even less necessary. `const isPromise = x => Promise.resolve(x) === x`

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

#478
post #467
post #464

Earlier quoted context omitted.

The problem was to get the promise out of the iframe when you shouldn't do this directly in the first place. This literally is an XY problem: "I need to do A but it's giving me bad results, what do I need to add?" - "Don't use A, it's bad practice. Use B instead and keep using built-in tools instead of hacking something together" In this case use instanceof instead of is-promise because it's a hack around the actual…

> when you shouldn't do this directly in the first place. There's absolutely nothing wrong with accessing the content of a same-origin iframe. I am sorry that you cannot admit to being wrong. > after their 6 weeks of some random bootcamp I have a Computer Science degree and 20 years of web development experience, long before npm existed. So fuck off.

Yikes, please don't break the site guidelines like this.

https://news.ycombinator.com/newsguidelines.html

Post reply on HN