5 ms·
Does Deno have some built in way to vendor / download the imports pre-execution? I don't want my production service to fail to launch because some random repo i
by Saaster 6y ago
Does Deno have some built in way to vendor / download the imports pre-execution? I don't want my production service to fail to launch because some random repo is offline.
- doctoboggan 6y agoI assume you would just download the packages and serve them yourself.
- afiori 6y agoDeno caches local copies and offer control on when to reload them. in term of vendoring you can simply download everything yourself and use local paths for imports.
- xg15 6y agoHow would this work with transitive dependencies? Sure I can control which parts I import myself, but how do I keep a vendored file from pulling in another URL a level deeper?
- thebradbain 6y agoUnlike node, recommended deno practice is to check-in your dependencies to the VCS. > Production software should always bundle its dependencies. In Deno this is done by checking the $DENO_DIR into your source control system, and specifying that path as the $DENO_DIR environmental variable at runtime. https://deno.land/manual/linking_to_external_code https://deno.land/manual/linking_to_external_code
- Rotareti 6y agodu -hs node_modules 1.7G node_modules
- deleted 6y ago[deleted]
- bgdam 6y ago> in term of vendoring you can simply download everything yourself and use local paths for imports. So I basically have to do manually, what NPM/yarn do for me already?
- afiori 6y agoI do not speak for the project, but based on my understanding part of the point was to avoid the magic of npm. You can use lock-files, bundles, and many other features that makes dependencies management easier.
- bgdam 6y agoAh from that perspective I can see how this might appear to be better. Personally, I like the 'magic' of NPM (which to be honest I don't really think is all that magical, it's quite transparent what's happening behind the scenes). This 'magic' means I no longer have to write 200 line makefiles, so it definitely makes my life easier.
- afiori 6y agoSome of that convenience will still be included, a couple of things that deno will do differently from node will be that there is no standard index.* file to load and import path include the extension.
- mrkurt 6y agoYes, lock files: https://deno.land/manual/linking_to_external_code/integrity_checking https://deno.land/manual/linking_to_external_code/integrity_...
- PinkMilkshake 6y agoYup! Deno caches remote imports. https://deno.land/manual/linking_to_external_code https://deno.land/manual/linking_to_external_code
- PudgePacket 6y agoYou can also use the built in bundle command to bundle all of your dependencies and your code into a single, easily deployable file. https://deno.land/manual/tools/bundler https://deno.land/manual/tools/bundler.