Deno: Go-like Importing Scheme

Created on 21 Jul 2020  路  5Comments  路  Source: denoland/deno

Actual import scheme of Deno is a little inefficient and can be done in better way - scheme used in Golang would be ideal for Deno.

For example:

// for core deno libraries
import * as path from 'path'

// for community libraries
import * as sample from 'github/sample/sample'

I would like to hear community opinion about that idea.

Most helpful comment

we are following the web spec. this is not something we can do.

All 5 comments

we are following the web spec. this is not something we can do.

Everything is just an explicit URL with no "magic" resolution. This proposal would require magical resolution and coupling to things like how code is structured in GitHub. That is not something that Deno wants to do.

For the Deno namespace, if the Built-in modules proposal for ECMAScript/JavaScript ever got close to being adopted, Deno would consider using that syntax to make the Deno namespace a built-in module.

That's some news @kitsonk !

I think you also could set up importmaps to make it work as you intended?

Thanks, @kitsonk and @timreichen for your response. I didn't see import maps in the documentation, and that's something that I was searching for. I think this issue can be closed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sh7dm picture sh7dm  路  3Comments

davidbarratt picture davidbarratt  路  3Comments

CruxCv picture CruxCv  路  3Comments

watilde picture watilde  路  3Comments

ry picture ry  路  3Comments