News for hackers. Stuff that matters.
Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @07:30PM (#23173114)
It's basically the same "exposure" as importing a random npm, but it has the benefit if being explicit when you do it.

It's also exactly what the websites you visit do. ;)

Re:Deno 1.0 by eyelidlessness on Wednesday May 13, 2020 @07:57PM (#23173338)
> It's basically the same "exposure" as importing a random npm, but it has the benefit if being explicit when you do it.

This is definitely false. For all the problems with the NPM registry and the Node dependency situation, an NPM package at a specific version is not just at the whims of whatever happens to be at the other end of a URL at any given moment it's requested. This is a huge vulnerability that the Node/NPM world does not currently have.

Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @08:02PM (#23173397)
That is a fair point. I don't think most people who use npms really pay much attention, though, and you're still just an npm update away from getting something unexpected (because really, who puts explicit versions in package.json?).

Deno does have lockfiles: https://deno.land/manual/linking_to_external_code/integrity_...

I prefer imports from URLs. And I loathe npm. I get why people would disagree though.

Re:Deno 1.0 by megavolcano on Wednesday May 13, 2020 @08:03PM (#23173405)
Deno has lock files and caches files locally on first import.
Re:Deno 1.0 by eyelidlessness on Thursday May 14, 2020 @01:08PM (#23182180)
I'm not sure how a lock file would help in this scenario, unless you're also committing your cache to source control (like a lot of folks did in the bad old days of NPM). The local cache is great, but that doesn't prevent the content of those URLs changing for someone who doesn't have access to your cache.
Re:Deno 1.0 by pedalpete on Wednesday May 13, 2020 @09:05PM (#23173931)
yeah, but we regularly clear out our cache and lock files, so this doesn't really solve the issue, unless you're commiting all of your packages
Re:Deno 1.0 by megavolcano on Wednesday May 13, 2020 @09:40PM (#23174213)
Why are you _regularly_ clearing lock files? If you're bypassing lock files you're going to have the exact same issue with npm or yarn or any other package manager that downloads from the internet.
Re:Deno 1.0 by chrischen on Thursday May 14, 2020 @01:19AM (#23175603)
Dunno about OP but I pin versions in package.json because it allows me to control the versions and upgrade major versions only when explicit and necessary, and rely only on the lock file to keep it the same between commit time and the production build.
Re:Deno 1.0 by K0nserv on Thursday May 14, 2020 @04:16AM (#23176850)
That doesn’t actually work and gives you a false sense of reproducibility and stability. Sure your top level dependencies might not change without explicit changes to package.json but every time you run npm install without a lock file all transitive dependencies are re-resolved and can change.

Always commit your lock files people

Re:Deno 1.0 by megavolcano on Thursday May 14, 2020 @09:38AM (#23179320)
What about the dependencies of your dependencies? You're gonna get burned when a breaking change gets introduced a few levels deeper than your package.json. Not everyone follows semver perfectly, and sometimes malicious code gets distributed as one of these transitive dependencies.
Re:Deno 1.0 by choward on Thursday May 14, 2020 @03:22AM (#23176459)
That's fine for one developer pushing to production from their own machine. But I've you have aCI server and you're working with other people you're going to want to know that everyone is working with the same modules.
Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @09:09PM (#23173965)
What! Clearing lock files seems wild. How do you know you're getting the right code when you install dependencies?
Re:Deno 1.0 by 0xCMP on Wednesday May 13, 2020 @08:03PM (#23173409)
For Deno the only issue is the first time when you do not have it cached. Deno compiles in all dependencies when building so the only point of failure is the machine you’re building on.

I don’t know the state of the art anymore, but I’m sure they have ways to make it easy to vendor deps in the repo.

Re:Deno 1.0 by xg15 on Wednesday May 13, 2020 @07:49PM (#23173281)
> It's basically the same "exposure" as importing a random npm, but it has the benefit if being explicit when you do it.

I'm not sure how this works in detail here, but at least in NPM you got a chance to download packages, inspect them and fix the versions if so desired. Importantly, this gave you control over your transitive dependencies as well.

This seems more like the curl | bash school of package management.

Edit: This is explained in more detail at https://deno.land/manual/linking_to_external_code and indeed seems a lot more sane.

> It's also exactly what the websites you visit do. ;)

Well yes, and it causes huge problems there already - see the whole mess we have with trackers and page bloat.

Re:Deno 1.0 by thysultan on Wednesday May 13, 2020 @08:06PM (#23173431)
The good thing about this is you can effectively build a register service that serves the same level of trust that npm provides, because at the end of the day that is the only deferential in this scenario as npm can just as well return malicious code.
Re:Deno 1.0 by pedalpete on Wednesday May 13, 2020 @09:08PM (#23173955)
Thanks for sharing that link. Seems much more sane, but not without issues. I'm sure this will continue to be iterated upon.

Even with all NPMs flaws, I do feel this is a bit of throwing the baby out with the bath water. Time will tell.

Re:Deno 1.0 by greggman3 on Wednesday May 13, 2020 @11:32PM (#23174955)
AFAIK there is no option to allow a website to read and write random files anywhere to my hard drive period. At most a website can ask the user select a file or offer one for downloading. In the future maybe it can be given a domain specific folder.

That's not true here. If I'm running a web server I'm going to need to give the app permission to read the files being served and access to the database. That something that never happens in the browser.

Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @08:04PM (#23173418)
The tldr is Deno also gives you a chance to download + inspect packages, and then lock dependencies. The mechanism for import is different, but the tooling is good.