Skip to content

Commit 72219d8

Browse files
committed
Merge the url= and relative-url= cases into just the url= case
1 parent 4e6fa19 commit 72219d8

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

design/mvp/Explainer.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,21 +1467,17 @@ verrange ::= '@*'
14671467
verlower ::= '>=' <valid semver>
14681468
verupper ::= '<' <valid semver>
14691469
urlname ::= 'url=<' <nonbrackets> '>' (',' <hashname>)?
1470-
| 'relative-url=<' <nonbrackets> '>' (',' <hashname>)?
14711470
nonbrackets ::= [^<>]*
14721471
hashname ::= 'integrity=<' <integrity-metadata> '>'
14731472
```
1474-
Components provide seven options for naming imports:
1473+
Components provide six options for naming imports:
14751474
* a **plain name** that leaves it up to the developer to "read the docs"
14761475
or otherwise figure out what to supply for the import;
14771476
* an **interface name** that is assumed to uniquely identify a higher-level
14781477
semantic contract that the component is requesting an *unspecified* wasm
14791478
or native implementation of;
14801479
* a **URL name** that the component is requesting be resolved to a *particular*
14811480
wasm implementation by [fetching] the URL.
1482-
* a **relative URL name** that the component is requesting be resolved to a
1483-
*particular* wasm implementation by [fetching] the URL using the importing
1484-
component's URL as the [base URL];
14851481
* a **hash name** containing a content-hash of the bytes of a *particular*
14861482
wasm implemenentation but not specifying location of the bytes.
14871483
* a **locked dependency name** that the component is requesting be resolved via
@@ -1491,7 +1487,7 @@ Components provide seven options for naming imports:
14911487
via some contextually-supplied registry to *one of a set of possible* of wasm
14921488
implementations using the given hierarchical name and version range.
14931489

1494-
Not all hosts are expected to support all seven import naming options and, in
1490+
Not all hosts are expected to support all six import naming options and, in
14951491
general, build tools may need to wrap a to-be-deployed component with an outer
14961492
component that only uses import names that are understood by the target host.
14971493
For example:
@@ -1514,8 +1510,12 @@ For example:
15141510
The grammar and validation of URL names allows the embedded URLs to contain any
15151511
sequence of UTF-8 characters (other than angle brackets, which are used to
15161512
[delimit the URL]), leaving the well-formedness of the URL to be checked as
1517-
part of the process of fetching the URL (which can fail for any number of
1518-
additional reasons beyond validation).
1513+
part of the process of [parsing] the URL in preparation for [fetching] the URL.
1514+
The [base URL] operand passed to the URL spec's parsing algorithm is determined
1515+
by the host and may be absent, thereby disallowing relative URLs. Thus, the
1516+
parsing and fetching of a URL import are host-defined operations that happen
1517+
after the decoding and validation of a component, but before instantiation of
1518+
that component.
15191519

15201520
When a particular implementation is indicated via URL or dependency name,
15211521
`importname` allows the component to additionally specify a cryptographic hash
@@ -1600,7 +1600,7 @@ As an example, the following component uses all 9 cases of imports and exports:
16001600
(export "handle" (func (param (own $request)) (result (own $response))))
16011601
))
16021602
(import "url=<https://mycdn.com/my-component.wasm>" (component ...))
1603-
(import "relative-url=<./other-component.wasm>,integrity=<sha256-X9ArH3k...>" (component ...))
1603+
(import "url=<./other-component.wasm>,integrity=<sha256-X9ArH3k...>" (component ...))
16041604
(import "locked-dep=<my-registry:[email protected]>,integrity=<sha256-H8BRh8j...>" (component ...))
16051605
(import "unlocked-dep=<my-registry:imagemagick@{>=1.0.0}>" (instance ...))
16061606
(import "integrity=<sha256-Y3BsI4l...>" (component ...))
@@ -1955,8 +1955,9 @@ and will be added over the coming months to complete the MVP proposal:
19551955

19561956
[`WebAssembly.instantiate()`]: https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/instantiate
19571957
[`FinalizationRegistry`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
1958-
[Fetching]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
1959-
[base URL]: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
1958+
[Fetching]: https://fetch.spec.whatwg.org/
1959+
[Parsing]: https://url.spec.whatwg.org/#url-parsing
1960+
[Base URL]: https://url.spec.whatwg.org/#concept-base-url
19601961
[`integrity-metadata`]: https://www.w3.org/TR/SRI/#the-integrity-attribute
19611962
[Semantic Versioning 2.0]: https://semver.org/spec/v2.0.0.html
19621963
[Delimit The URL]: https://www.rfc-editor.org/rfc/rfc3986#appendix-C

0 commit comments

Comments
 (0)