News for hackers. Stuff that matters.
Re:Deno 1.0 by cocktailpeanuts on Wednesday May 13, 2020 @06:55PM (#23172825)
if you require modules by URL, how does it make sure that the URL always contains the same library?

I've read the docs and it says it caches on the initial execution and doesn't update unless it's forced to update, but what happens when you for example publish a deno module to github, and someone else downloads it and runs it, and turns out the URL contains completely different library at his execution point?

Re:Deno 1.0 by piscisaureus on Wednesday May 13, 2020 @07:04PM (#23172896)
This is something that we'll further work out in future versions. For now you can use a lockfile: https://deno.land/manual/linking_to_external_code/integrity_...
Re:Deno 1.0 by hn_throwaway_99 on Wednesday May 13, 2020 @07:27PM (#23173088)
> Deno can store and check module subresource integrity for modules using a small JSON file. Use the --lock=lock.json to enable and specify lock file checking. To update or create a lock use --lock=lock.json --lock-write.

HALLELUJAH that there is a clear, simple separation of when (a) you expect a lock file to be checked to guarantee integrity and (b) when you want it to be generated. The complete insanity that was npm shrinkwrap and lockfiles for years, summed up in this stackoverflow post https://stackoverflow.com/questions/45022048/why-does-npm-in... , always baffled me in that it seemed like it could have just been so easily avoided about being explicit when you're writing a lockfile vs. when you're using it.

That said, why not be even MORE explicit about it, i.e. "--use-lock=lock.json" vs. "--write-lock=lock.json"?

Re:Deno 1.0 by xg15 on Wednesday May 13, 2020 @07:59PM (#23173361)
This looks really promising.

However, it still seems risky to me in case a library is not available. Is there a central repository planned? Or are you expected to vendor everything and ship your project with dependencies included?

Re:Deno 1.0 by marktolson on Wednesday May 13, 2020 @11:46PM (#23175046)
Instead of referring to the version could you refer to the hash? Then a simple integrity checker could confirm file changes.