10:51
<Aapo Alasuutari>
I ran into an interesting corner case where spec/implementations differ from what I at least initially would've expected: I have a case where due to loosely versioned names, a single module can match multiple names. (eg. Asking for a module with caret version 1.0.0 and 1.0.1 in a part of the URL can resolve to the same concrete module). I had the bright idea of avoiding duplication of modules by responding with HTML redirects from the server (to be exact, a ServiceWorker intercepts the request and performs the final redirect arbitration). This works fine in getting the right module, but it does not deduplicate them. I presume this is right and proper from the spec standpoint but on the other hand, is it what is really wanted? Is module redirection a reasonable thing to consider?
11:10
<Aapo Alasuutari>
As code this would be: ```js const modA = await import("mod--^1.0.0"); // server responds with redirect to "mod--1.0.0" const modB = await import("mod--1.0.0"); const modC = await import("mod"); // import-map redirects to "mod--1.0.0" modB === modC; // true modA === modB; // false ```
12:22
<nicolo-ribaudo>
Aapo Alasuutari You can read about it at https://github.com/whatwg/html/issues/3624
12:40
<Aapo Alasuutari>
Aapo Alasuutari You can read about it at https://github.com/whatwg/html/issues/3624
Thank you. Makes sense, though it's always unfortunate to see your bright idea get dashed on the rocks of reality :D
12:42
<Aapo Alasuutari>
I guess the best option is for the server to return `export *; import foo; export default foo;` as a kind of minimal redirect-like Module.