Deno: How to keep dependency versions in sync across files?

Created on 11 Jun 2018  路  4Comments  路  Source: denoland/deno

Lets say I have code like this:

foo.ts:

import { myDep } from "https://unpkg.com/[email protected]/myDep.ts"

bar.ts:

import { myDep } from "https://unpkg.com/[email protected]/myDep.ts"

How do I ensure my versions of myDep stay in sync across foo.ts and bar.ts?

Should Deno-idomatic code use dependency injection so dependencies are only externally referenced in one place? That seems like a good idea, but difficult to enforce.

Most helpful comment

I think the enthusiasm and support is welcome but overwhelming at this stage. Its the downside of open development so early. Luckily, when #94 is closed, we can look at all the cross-references and reopen good discussions :)

All 4 comments

A few potential solutions:

  • #200
  • importing from a central file you run + code lint is another
  • using a content-addressable protocol
  • I'm pretty sure the current cache only updates on --reload and you can also pass in separate cache directories if you want, but I forget where I read that

In the spirit of #94, maybe this should be closed and re-addressed once deno is more mature?

200 might be a good duplicate for this ticket, seems like it plus 'central file to run' could have overlap (I was thinking of something like dependencies.ts).

94 makes sense as well - Perhaps this is premature, but I was hoping this could be a place someone could lend a hand in defining.

I think the enthusiasm and support is welcome but overwhelming at this stage. Its the downside of open development so early. Luckily, when #94 is closed, we can look at all the cross-references and reopen good discussions :)

Thanks for the discussion. We'll revisit when this functionality is there in the rewrite. Closing this one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

zugende picture zugende  路  3Comments

kyeotic picture kyeotic  路  3Comments

motss picture motss  路  3Comments

davidbarratt picture davidbarratt  路  3Comments