-
Notifications
You must be signed in to change notification settings - Fork 72
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
Supporting bare addresses #94
Comments
Hmm. I think you're right this is possible. I lean toward the conservativism of requiring the I'd be OK with changing this, but I wouldn't rush into it. Does anyone else have an opinion? |
Do you think some users would expect recursive application to work if they see a bare import as the map target? |
That's a good question. My initial instinct is it would depend on what else was nearby in the import map. If it were a bunch of URL-ey things they might see a "bare" relative URL as what it is (i.e. a URL). Similarly, the OP has a |
I think these arguments #80 apply here too; soft failures should be preferred over permissive reinterpretation, just as they should be preferred over hard failures. The probability that people will want to prescribe new meaning to bare addresses in the future may seem low, but it's surely non-zero, and I don't think supporting them in this way actually buys anything in the meantime. |
Given the goal to allow a specifier to resolve to a built-in module, it would be better to require {
"imports": {
"@std/kv-storage": [
"@std/kv-storage",
"/node_modules/kvs-polyfill/index.mjs"
]
}
} If a mapping to |
@rictic your argument makes sense, but to me it argues for a simpler solution: use URL-like built-in module specifiers, like |
Banning adjacent I know that module specifiers aren't URLs and |
Now that we have a pretty solid foundation, I'd be happy to take a PR for the spec/tests adding support for this. |
I was just looking at the spec at https://wicg.github.io/import-maps/#sort-and-normalize-a-specifier-map, and according to the outline there this is already supported I believe since there are no explicit checks for I think we can close this then? |
I think we'd need tests at the very least. Also, this may change if #137 happens; that proposes that the right-hand side no longer be URLs, but instead module specifiers. |
I'll consider this blocked on multiple import maps and the work on #137. Since multiple import maps are no longer part of the MVP, moving the milestone. |
I'm glad to see that recursive resolution is no longer being provided.
Given this, should we consider supporting bare addresses? This would allow:
to be equivalent to:
I'd be glad to put a PR together as well if this would be useful.
The text was updated successfully, but these errors were encountered: