My only concern is dependency management with URL imported packages. How would one go about changing the version of the package if it is been imported in 10 different places.
As I said here, Deno has a convention of putting all imports in a deps.ts file. This makes it easier to change versions, as there is only a single import.
Also solving resolution conflicts that package managers like yarn and npm perform when one package depends on several is quite handy.
Deno has no "magical" module resolution. Instead, imported modules are specified as files (including extensions) or fully qualified URL imports. This makes it harder to mess up.
I personally find the former easier to read and write.
If you use the deps.ts convention, you could have this:
deps.ts
import*as_from'some-long-url/lodash';// If you want it allexport{_};// If you need only someexport{uniq:_.uniq,isEqual:_.isEqual}
Deno has no "magical" module resolution. Instead, imported modules are specified as files (including extensions) or fully qualified URL imports. This makes it harder to mess up.
Great to know! Will try this out with deps.ts. Thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As I said here, Deno has a convention of putting all imports in a
deps.ts
file. This makes it easier to change versions, as there is only a single import.Deno has no "magical" module resolution. Instead, imported modules are specified as files (including extensions) or fully qualified URL imports. This makes it harder to mess up.
If you use the
deps.ts
convention, you could have this:deps.ts
main.ts
or wherever you use itDeno caches modules once they are required once, so intellisense can work at that time.
Yup
deps/ts
is a much better way :)Great to know! Will try this out with
deps.ts
. Thanks!