tc39 / proposal-import-attributes

Proposal for syntax to import ES modules with assertions
https://tc39.es/proposal-import-attributes/
Apache License 2.0
569 stars 32 forks source link

Include WebAssembly as having *undefined* type #117

Closed guybedford closed 1 year ago

guybedford commented 2 years ago

The specification currently notes that the HTML integration would treat JavaScript as assertion "type" *undefined*. This updates that note to treat Web Assembly similarly as assertion "type" being *undefined*.

Effectively this specification note already implies today that assert { type: 'javascript' } should not be implemented, and then extends that to assert { type: 'webassembly' }.

Alternatives to this PR include the "any" proposal, "executable" proposal, or "javascript" and "webassembly" direct types.

GeoffreyBooth commented 2 years ago

The readme should be updated as well, including the WebAssembly examples there.

GeoffreyBooth commented 2 years ago

Also, this is part of a section called “A Sample host integration: The Web embedding”—it’s an example of how a host could implement the spec, not the spec itself. As in, a host could decide to treat JavaScript as undefined, as in this example, but it doesn’t need to because this is just an example implementation. If you want to define the lack of a declared assertion type as meaning type: undefined then it should be clearly explained as such within the spec itself, as well as in the proposal readme and examples. Such a change would force an update in the HTML spec, because their treatment of “lack of type = 'javascript'“ would then be in violation.

ljharb commented 1 year ago

Is this still relevant? If so, can it be rebased?

nicolo-ribaudo commented 1 year ago

Given that: