You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing a JS module from an URL that returns a redirect (302) to a specific version of the module, Deno behaves differently from browsers: It handles the module the same as if it was the redirected module.
But in all browsers (Chrome, Firefox and SafAri), the expression above evaluates to false - they create two unique module instantiations (although the value of import.meta.url is the redirected URL ("https://esm.sh/[email protected]") in all cases)
I was wondering if Deno deliberately chose to do this differently - I prefer it this way, it just makes more sense: the redirect does not just provide the same module, it points to the identical resource which should not be treated as a separate module.
I know that ES6 leaves the details of module loading completely up to the implementation and this is an HTTP-specific issue, but since Deno tries to be as compatible with browsers as possible, it would just be great if both behaved the same way.
I'm not sure if it's a realistic scenario that browsers will change their implementation in this regard...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When importing a JS module from an URL that returns a redirect (302) to a specific version of the module, Deno behaves differently from browsers: It handles the module the same as if it was the redirected module.
This means that e.g.
is
true
in Deno.But in all browsers (Chrome, Firefox and SafAri), the expression above evaluates to
false
- they create two unique module instantiations (although the value ofimport.meta.url
is the redirected URL ("https://esm.sh/[email protected]"
) in all cases)I was wondering if Deno deliberately chose to do this differently - I prefer it this way, it just makes more sense: the redirect does not just provide the same module, it points to the identical resource which should not be treated as a separate module.
I know that ES6 leaves the details of module loading completely up to the implementation and this is an HTTP-specific issue, but since Deno tries to be as compatible with browsers as possible, it would just be great if both behaved the same way.
I'm not sure if it's a realistic scenario that browsers will change their implementation in this regard...
Beta Was this translation helpful? Give feedback.
All reactions