3 ms·
Forget the (reasonable) security and reliability concerns people have already brought up with regard to importing bare URLs. How about just the basic features o
by tolmasky 6y ago
Forget the (reasonable) security and reliability concerns people have already brought up with regard to importing bare URLs. How about just the basic features of dealing with other people's code: how am I supposed to update packages? Do we write some separate tool (but not a package management tool!) that parses out import URLs, increments the semver, and... cURLs to see if a new version exists? Like if I am currently importing "https://whatever.com/blah@1.0.1" https://whatever.com/blah@1.0.1", do I just poll to see if "1.0.2" exists? Maybe check for "2.0.0" too just in case? Is the expectation that I should be checking the blogs of all these packages myself for minor updates? Then, if you get past that, you have a huge N-line change where N is every file that references that package, and thus inlines the versioning information, instead of a simple and readable one-line diff that shows "- blah: 1.0.1, + blah: 1.0.2".
- austincheney 6y agoYou have to stop thinking in terms of NPM where it takes 1000000000 packages to do anything. A Deno application is designed to be distributed as a single file. You can override the default behavior to have NPM like stupidity, but if that is really your goal why bother moving to Deno in the first place?
- tolmasky 6y agoForget 10000000 packages. Many languages often make use of 10s of packages. If I have several projects, each with around 10 packages, and no automated way to just check if all my projects’ respective dependencies have security updates that could be applied, it seems to go against the stated security goal. Separately I’m not sure what is enforcing this “small dependency graph” aside from making it hard to import things I guess. I wouldn’t be surprised if you end up with the normal behavior of people coming up with cool things and other people importing them.
- austincheney 6y ago> and no automated way to just check if all my projects’ respective dependencies have security updates Dependency management is a major cornerstone of any infosec program. There is more to that than just auto-installing a new dependency version. > I’m not sure what is enforcing this “small dependency graph” Because a large dependency graph is slow, insecure, and fragile.
- tolmasky 6y ago> Dependency management is a major cornerstone of any infosec program. There is more to that than just auto-installing a new dependency version. We seem to agree? I said check. It’s very useful to have something tell you what’s out of date and what the updates are. > Because a large dependency graph is slow, insecure, and fragile. I asked “what”, not “why”. What is enforcing this idea you have of how Deno will be used? I feel like you want it to not be used with lots of dependencies, thus aren’t accounting for how to handle them. However, just because that’s the desired way to use it doesn’t mean it will be used that way. Lots of dependencies may end up still becoming the norm, at which point you’ll wish you would have more clearly defined how it should be done instead of letting the first third party solution win (as ended up happening with npm).
- mrkurt 6y agoThe Deno solution is either: * A deps.ts that handles all external dependencies and re-exports them * Import maps Neither of these really give you a way to do the equivalent of "npm update". But I almost never want to update all my packages at once.
- tolmasky 6y agoYou don’t like checking for security updates?
- mrkurt 6y agoLately I just merge GitHub's pull requests for that. ;) I don't like running "npm update" to try and get security updates, though. npm packages aren't very rigorous about PATCH level changes.
- e12e 6y agoWell, at least you seem to be using cargo for the rust parts. Since this stuff is breaking an new anyway, it would be nice to see dependency resolution and a reasonable way for historically reproducible builds (prod runs server 1.0.4 which is 5 years old, let's build that locally to do some bug fixing, using the same dependencies, gradually bringing it up to current 3.7.1...). Sounds like the lifecycle management of deno projects will about as much fun as php before package management. And about as reliable.
- c-cube 6y agoMaybe a convention will arise, that you do all the imports in one file (basically like a `package.json` file) and import that from the rest of your code? It seems hackish to me but could work.
- CGamesPlay 6y agoThis is explicitly listed as best practice by Deno [1], but it doesn't handle the updating problem at all. [1] https://deno.land/manual/linking_to_external_code#it-seems-unwieldy-to-import-urls-everywhere https://deno.land/manual/linking_to_external_code#it-seems-u...
- emerongi 6y agoAnother thing is that with package.json every dependency can say which versions of its dependencies it works with. This lets you update a dependency that is used by other dependencies and only have a single version (most up to date) of it. Some package managers also let you completely override a version that one of your dependencies uses, allowing you to force the use of a newer version. With Deno, both of these use cases seem way harder to satisfy. None of your dependencies can say "hey, I work with versions 1.1 to 1.3 of this dependency", instead they link to a hardcoded URL. The best chance of overriding or updating anything is if Deno supports a way to shim dependencies, but even then you might need to manually analyze your dependency tree and shim a whole bunch of URLs of the same library. On top of that, as soon as you update anything, your shims might be out of date and you need to go through the whole process again. To make the whole process easier, Deno could compare checksums of the dependencies it downloads and through that it could show you a list of URLs that all return the same library, but this would be like the reverse of package.json: instead of centrally managing your dependencies, you look at your dependencies after they have been imported and then try to make sense of it.
- pknopf 6y ago> None of your dependencies can say "hey, I work with versions 1.1 to 1.3 of this dependency" That's a real problem that needs to be solved. Also, what happens when two lib A and lib B depend on different versions of lib C? Each have their own scoped instance of C?
- mekster 6y agoJust come up with a convention like host a file called version.ts that lists all available versions. Brute forcing for available versions sounds dumb.
- tolmasky 6y agoYes, that is of course the point. There’s an infinite number of possible later versions to check for. The suggestion to poll for new versions using cURL was sarcastic. These “conventions” you speak of actually get handled by... package managers! If not everyone who hosts a package needs to “know” about magic files and make sure they make it following a spec that isn’t enforced by anyone and doesn’t break immediately but rather much later when someone tries to update. It’s like everyone managing their own database row with an informally agreed upon database schema.
- mileycyrusXOXO 6y agoI prefer a unix approach where each tool does a single thing. The runtime does runtime things and someone can build a package manager to do package manager things. The benefit of having runtime + package management bundled into one is you have an opinionated and standard way of doing things - the downside is if the package manager stinks then the whole ecosystem stinks.