Skip to content

(X)HTML import name suggestion #38

@ghost

Description

Unless I am mistaken, it is currently being proposed that ECMAScript be able to use MJS syntax for imports, and (X)HTML to use a module script tag?

For the MJS part, I have no opinion, for the (X)HTML web page it is being suggested that we could use something along the lines of:

<script type="module" src="./main.wasm" />

If so, might I suggest that we look at how JavaScript was originally intended to be imported:

<script type="text/javascript" src="./main.js" />

Google's Dartium browser used the Dart mime for executing Dart:

<script type="application/dart" src="./main.dart" />

Thus, shouldn't we use the Wasm mime-type as the "type" in (X)HTML?

This would make it much clearer to the developer, be clearer to the browser, and be better compatibility-wise: older browsers would not attempt to request the file at all, only newer browsers would. Even a current browser would expect JavaScript, thus waste client resources just to error upon seeing Wasm bytecode.

Unless this proposal is purely for a more ergonomic syntax when used in modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions