News for hackers. Stuff that matters.
Re:NPM package 'isarray' is downloaded 40M times a week by Nursie on Sunday November 08, 2020 @10:38AM (#25026394)
> Imagine finding a solution on Stackoverflow and just being able to import foo from stackoverflow/a/12345, and when the community finds a better way to do it, your software is automatically using the new version!

That sounds like a security nightmare, and broken functionality waiting to happen.

How on earth have we got here?

Re:NPM package 'isarray' is downloaded 40M times a week by jka on Sunday November 08, 2020 @02:31PM (#25028236)
There are issues with micropackaging functions and code, and the fact that they didn't exist as a concept when the JavaScript language was being designed may contribute to that - but I don't think that it's clear whether micropackaging will turn out to be a good or bad trend overall.

Hundreds of thousands of untested, unaudited implementations of a roughly-similar function _could_ be far worse in terms of overall ecosystem stability and security than a small number of frequently-used (albeit yes, potentially flawed and vulnerable) micropackage dependencies.

The outcome for each micropackage may depend on how much scrutiny and test coverage is available when updates occur, and how well-defined the package's API is.

In a sense, that's not hugely different to version upgrades for other, larger library dependencies. Incremental library changes tend to be easier for developers to audit and integrate, so perhaps eventually this is a better approach?

In my opinion Microsoft (via GitHub and NPM) are likely best-placed to make significant progress on evaluating and improving the situation.

When a micropackage is updated, they're in a position where they could run continuous integration tests not just for the package itself, but also for dependent packages, to gain an early sense for the correctness and disruption potential of the change.

That kind of information would be useful to make a micropackaging ecosystem more viable and healthy, although it would also increase the ecosystem's long-term dependence on Microsoft.

Re:NPM package 'isarray' is downloaded 40M times a week by Nursie on Sunday November 08, 2020 @08:29PM (#25030599)
There is a middle ground between hundreds of thousands of untested, unaudited implementations of a roughly-similar functions, and packages which auto update without the developer doing anything at all.

At the least you want some oversight when a dependency changes under you.

Re:NPM package 'isarray' is downloaded 40M times a week by jka on Monday November 09, 2020 @11:26AM (#25036413)
Yep, pinning specific package versions should probably be a more commonplace practice than it currently is.
Re:NPM package 'isarray' is downloaded 40M times a week by izgzhen on Monday November 09, 2020 @03:40AM (#25032656)
As someone studying programming languages I used to be shocked by such practice as well — but later on I realized that, for people doing this, they really don’t have any practical motivation to care much beyond getting it to work first for immediate business needs.

Similarly, many more “principled” programmers don’t really understand many parts of our computing stack either and it did bring troubles to even the most experienced veterans in the industry.

It is always a trade-off between risk, cost, and benefit.

Re:NPM package 'isarray' is downloaded 40M times a week by dzhiurgis on Sunday November 08, 2020 @04:41PM (#25029342)
Hardcode the version and it will never update.

Otherwise you can (and should) review the update manually or using automated tools.

Re:NPM package 'isarray' is downloaded 40M times a week by toomuchtodo on Sunday November 08, 2020 @10:57AM (#25026555)
Abstractions over expertise and effort, driven by expectations outside of the practitioner’s control.