Note: The semantics of this proposal on the Web would be standardized in WHATWG/HTML, not in this repository. This issue is purely for requirements-gathering/brainstorming.
The README has examples of using the type:
module attribute, but the semantics of this are not really defined anywhere. I think there's been some confusion in the discussion in issues as different people make assumptions about different semantics. Here's how I am currently picturing that this would work on the Web/in HTML:
import
statement or dynamic import()
, it passes an optional additional parameter to the embedder, of the options bag of module attributes.type:
. If the type
is present and unrecognized, module fetching and parsing is aborted with an error.type
, and if no type
is provided, then JavaScript is implicitly used. Each known type
has a set of MIME types that it permits. If the MIME type is not contained in the type
's set, then module fetching and parsing also errors out. If the module had already been fetched previously and lived in the cache, then the MIME type is cached along with it and used for this comparison.type:
). The type:
is not used at this point--it simply provided an additional check before the parser was invoked.Any thoughts on this logic?
dandclark, shqld and ExE-Boss
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4