-
Notifications
You must be signed in to change notification settings - Fork 58
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
import.meta.resolve() #746
Comments
We took a look at this today and are generally favorable. Some questions though regarding the sync/async decision, what happens if the author calls this while there's a pending load for an import map? Does it throw or return the wrong value? If the author needs to wait until the import map(s) are fully loaded, how do they do that? |
Right now import maps are always inline and cannot be loaded. It's unclear whether that will change in the future; implementer interest is low, although I personally think it'd be nice. In such a future, it would return the current value. It would not throw. It's not clear whether the current value would be considered "wrong"; if you do If an author needs to wait for import maps in such a future, it depends on how we expose external import map loading, but probably the simplest way would be to wait for that import map |
We looked at this again today during a breakout. Even without import map loading, authors can always dynamically add import maps by creating new |
Wotcher TAG!
I'm requesting a TAG review of import.meta.resolve().
import.meta.resolve(specifier)
returns the URL to whichspecifier
would resolve in the context of the current script. That is, it returns the URL that would be imported if you didimport(specifier)
.This is a quite small feature (a single function, with only a few lines of spec text which exposes an already-existing spec algorithm).
Further details:
We'd prefer the TAG provide feedback as (please delete all but the desired option):
💬 leave review feedback as a comment in this issue and @-notify @domenic
The text was updated successfully, but these errors were encountered: