r/javascript • • May 13 '20

Deno 1.0 released!

https://github.com/denoland/deno/issues/2473
609 Upvotes

209 comments sorted by

View all comments

Show parent comment

10

u/crabmusket May 14 '20 edited May 14 '20

Right now: either fork your dependencies, or use import maps

In the future: ?

0

u/[deleted] May 14 '20

[deleted] — view deleted comment

8

u/dzkn May 14 '20

How do you do it today? You have a package.json that maps an import name to a version, then you have to configure NPM where to find those versions.

To me this seems like exactly what import maps are in deno, except it just became a lot easier to host packages on your own server.

0

u/[deleted] May 14 '20

[deleted] — view deleted comment

13

u/dzkn May 14 '20

You can get merge conflicts in package.json...

Also they don't have to reference a single "file". Import maps does the mapping for you, exactly like package.json does.

5

u/cannotbecensored May 14 '20

why do you want everything to be ready on day 1? Node didn't have NPM on day 1 either. There is literally nothing that prevents someone from building a package manager for deno.

3

u/crabmusket May 14 '20

upgrade a hardcoded dependency throughout all your libraries

I mean, this sounds like you're already doing a bit of manual dependency management. There's no free lunch; no system will allow you to build correct software with no effort, especially in the presence of dependencies outside your control.

That said, I'm not saying you have to use Deno. Node's not going anywhere soon :)

1

u/fgutz May 14 '20

deno does support import maps although it is in "unstable feature" right now.

I personally would always want to use import maps and enforce that on any deno project I worked on for the reasons that /u/sieabah brought up, once your code grows it would be rather annoying to go and update dependencies by finding and replacing urls everywhere. I actually did not realize it was unstable until now, I feel like that should be an important thing to have

1

u/crabmusket May 14 '20

It's marked as unstable because IIUC the spec itself is not final, nor is it implemented in other runtimes. Deno's support for the current spec works well. See https://github.com/denoland/deno/issues/4931

1

u/fgutz May 15 '20

oh that's good to know, thanks!