#746: import.meta.resolve()
Discussions
2022-07-18
Lea: seems very incremental - something developers do frequently - pretty small feature, small abstraction.
Peter: Looking at the "sync vs async" discussion in the explainer. Whether import maps are loaded or not.
Lea: supposed to be syntactic sugar for what devs are doing already which is sync. So tending to agree with Domenic.
Peter: wonder if import maps haven't loaded yet what's the behavior? would you get an answer that's wrong?
Dan: leave that as a comment / question?
Peter: i can leave the comment.
Peter: [in the issue] a lot of background to the sync vs async decision. Seems like a lot of other dependencies on this. Not sure it's a simple thing.
2022-08-22
can we progress it this week?
Peter: another sync vs. async feedback... To me this feels like - it makes sense to have it sync now but we'll probably regret it at some point.
Dan: is it satisfied with concerns? Or not resolved?
Peter: I don't know. Need Lea's feedback as well.
bumped to next week
2022-10-31
Dan: talked about this with Chris H. He wanted to know what he could do to help nudge this. Should we close it, or push more?
Lea: the issue is that this wouldn't work for externally loaded import maps which we don't yet have right?
Peter: yeah
Lea: but can you dynamically create a script element and append it with an import map? Then you have the same issue of import maps being created afterwards. If that works, and if you can create importa mpas at any point in time, even if this was async it still wouldn't account for that. So maybe it's okay that it's syntactic sugar over what authors can do already and therefore it's sync?
Peter: leaning toward it just being sync, a snapshot of the current state. TC39 already dealing with this. node shipped an async version and they're changing over to a sync version. I don't think we were complaining about it being sync, I think we were just curious about some behavioural issues.
Lea: looks like we're okay with this being sync? [leaves closing comment]
agreement to close
OpenedJun 6, 2022
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