WICG / import-maps

How to control the behavior of JavaScript imports
https://html.spec.whatwg.org/multipage/webappapis.html#import-maps
Other
2.69k stars 70 forks source link

"parse a URL-like import specifier", the term "import specifier" is a little bit confusing #267

Closed allstarschh closed 2 years ago

allstarschh commented 2 years ago

https://wicg.github.io/import-maps/#parse-a-url-like-import-specifier When I saw the term "import specifier", I thought it was referring to ImportSpecifier from ecma262 I also thought that maybe there's a typo in this spec and actually it should be "module specifier"?

But after a while, I think it's referring to the specifierKey of the imports specifier map in import map

So the term "import specifier" used here is a little bit confusing.

guybedford commented 2 years ago

I tend to agree we have overloaded the term import specifier to refer to both the identifier of a named import and the string module ID.

It sounds like there are two main options:

  1. Use "import specifier", "export specifier" (for the identifiers) and "module specifier" for the source id string and make sure it is always called a "module specifier" and not an import or export specifier as you suggest.
  2. Reconsider if either of these variants can be given a name that is preferable to "specifier" to ensure more clarity.

(and of course doing nothing is another option, but clarity of terms is important to ensure things are unambiguous and can be clearly communicated)

domenic commented 2 years ago

I believe this is fixed in https://github.com/whatwg/html/pull/8075. Please check. If so, I will close this when I remove all spec text from this repository and instead let HTML be the new source of truth.

allstarschh commented 2 years ago

It has been renamed to "Resolve a URL-like module specifier". https://whatpr.org/html/8075/webappapis.html#resolving-a-url-like-module-specifier