@@ -1467,21 +1467,17 @@ verrange ::= '@*'
1467
1467
verlower ::= '>=' <valid semver>
1468
1468
verupper ::= '<' <valid semver>
1469
1469
urlname ::= 'url=<' <nonbrackets> '>' (',' <hashname>)?
1470
- | 'relative-url=<' <nonbrackets> '>' (',' <hashname>)?
1471
1470
nonbrackets ::= [^<>]*
1472
1471
hashname ::= 'integrity=<' <integrity-metadata> '>'
1473
1472
```
1474
- Components provide seven options for naming imports:
1473
+ Components provide six options for naming imports:
1475
1474
* a ** plain name** that leaves it up to the developer to "read the docs"
1476
1475
or otherwise figure out what to supply for the import;
1477
1476
* an ** interface name** that is assumed to uniquely identify a higher-level
1478
1477
semantic contract that the component is requesting an * unspecified* wasm
1479
1478
or native implementation of;
1480
1479
* a ** URL name** that the component is requesting be resolved to a * particular*
1481
1480
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] ;
1485
1481
* a ** hash name** containing a content-hash of the bytes of a * particular*
1486
1482
wasm implemenentation but not specifying location of the bytes.
1487
1483
* a ** locked dependency name** that the component is requesting be resolved via
@@ -1491,7 +1487,7 @@ Components provide seven options for naming imports:
1491
1487
via some contextually-supplied registry to * one of a set of possible* of wasm
1492
1488
implementations using the given hierarchical name and version range.
1493
1489
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
1495
1491
general, build tools may need to wrap a to-be-deployed component with an outer
1496
1492
component that only uses import names that are understood by the target host.
1497
1493
For example:
@@ -1514,8 +1510,12 @@ For example:
1514
1510
The grammar and validation of URL names allows the embedded URLs to contain any
1515
1511
sequence of UTF-8 characters (other than angle brackets, which are used to
1516
1512
[ 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.
1519
1519
1520
1520
When a particular implementation is indicated via URL or dependency name,
1521
1521
` 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:
1600
1600
(export "handle" (func (param (own $request)) (result (own $response))))
1601
1601
))
1602
1602
(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 ...))
1604
1604
(import "locked-dep=<my-registry:[email protected] >,integrity=<sha256-H8BRh8j...>" (component ...))
1605
1605
(import "unlocked-dep=<my-registry:imagemagick@{>=1.0.0}>" (instance ...))
1606
1606
(import "integrity=<sha256-Y3BsI4l...>" (component ...))
@@ -1955,8 +1955,9 @@ and will be added over the coming months to complete the MVP proposal:
1955
1955
1956
1956
[ `WebAssembly.instantiate()` ] : https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/instantiate
1957
1957
[ `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
1960
1961
[ `integrity-metadata` ] : https://www.w3.org/TR/SRI/#the-integrity-attribute
1961
1962
[ Semantic Versioning 2.0 ] : https://semver.org/spec/v2.0.0.html
1962
1963
[ Delimit The URL ] : https://www.rfc-editor.org/rfc/rfc3986#appendix-C
0 commit comments