Skip to content

Commit 77d79bb

Browse files
committed
docs: how the loader spells absolute http(s) module URLs
1 parent 28850ec commit 77d79bb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎docs/ns-builtin-modules.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,13 @@ Inside either section — labelled `imports` or `scope '<scope>'`:
695695
696696
#### Registry canonicalization
697697
698-
The registry keys modules by a canonical URL. The mechanism — fragment strip,
698+
The registry keys modules by a canonical URL. Before the vocabulary applies,
699+
an absolute http(s) URL is spelled by the WHATWG URL parser with its authority
700+
as written, whichever way it arrives — a specifier from any importer, an
701+
import-map target, or `invalidateModules` — so `HTTP://host/a/../x.js` and
702+
`http:/host/x.js` key as `http://host/x.js`. A `file://http://…` string is not
703+
an http(s) URL: it keys as itself, and `import()` of it fails with
704+
`Cannot find module` without fetching anything. The mechanism — fragment strip,
699705
cache-buster param drop, param sort — is the runtime's; the *vocabulary* is
700706
server policy, supplied here:
701707

0 commit comments

Comments
 (0)