-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to use import map in packages / modules #12213
Comments
This is currently not supported by the spec and we're wary of adding non-standard features to standardized functionality. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
I believe that waiting for the standard to advance, when there's nobody working on it, is the wrong move. I've seen people advocating for dynamic import maps, dynamic import maps generation... but the main problem can be solved mostly statically with just a few metadata annotations. It is a real problem to handle nested dependencies when you want to publish a Deno-compatible library, and it gets even worse if you want to make it compatible with NodeJS at the same time. Having the ability to write something like in our library files... // This is just an example, I'm not sure what's the ideal syntax
// @pragma-import-map: https://path.to/import-map
// or
/// <reference import-map="https://path.to/import-map" />
import { whatever } from 'package-name' // This gets resolved thanks to the import-map metadata would make wonders. Of course, the "pragma" annotation would only be applied at this level (and below) of the import tree, to avoid unexpected side effects at the nodes that live upper in the tree, closer to its root. If something like that got the approval from Deno's team, I would be really happy to collaborate on its development, as I'm suffering this problem a lot. |
I disagree. Almost every choice we would make could easily and likely be changed when the standard changes. The internet is littered with "preemptive" movements let alone ones closer to home (like TypeScript decorators). The best thing to do is advocate with the standards body to move forward. |
I think every package should have a Since we know the main package's URI(https://github.com/WICG/import-maps#packages-via-trailing-slashes). e.g. :
Maybe,it is better use
|
This is possible when using JSR: https://jsr.io/docs/publishing-packages#importing-npm-packages |
When we are using import map in any package(for example package A). After we want to import into package B this package A with import map usage, Deno won't search for deps resultion in package A, it will try to search only in package B.
Therefore suggest to add feature of recursive search of import_map in package, or ability to inline into import_map in package B address of import_map of package A
The text was updated successfully, but these errors were encountered: