2 ms·
>"deno download exactly the code that is imported" and not just a whole package? In a fairly simple and elegant manner. You specify a URL to the specific file
by Kranar 6y ago
>"deno download exactly the code that is imported" and not just a whole package?
In a fairly simple and elegant manner. You specify a URL to the specific file FOO you want to import and FOO gets downloaded. Then deno looks at FOO to see what files FOO depends on, and downloads those, so on so forth...
That's very different from how NPM works where you have to download the entire package, including parts you may never use, along with every dependency the package depends on, even if you never end up using those dependencies either.
NPM's approach, which frankly worked well given the circumstances, has the downside of not providing end-users much benefit of writing code in a modular fashion, so there's no advantage to breaking a package up into multiple files versus distributing a single and large minified file.
Deno's approach promotes breaking up packages into multiple files so that an end-user only downloads the files and dependencies that are actually needed.
- nawgz 6y agoThanks for the explanation. I would be a bit scared to have a recursive solver install my dependencies, but it's ultimately not that different from packages I suppose. I will be interested to see how the tooling & community resulting from this decision look. Hopefully good.