-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(X)HTML import name suggestion #38
Comments
I believe that using: <script type="application/wasm" src="./main.wasm" /> Is probably the best approach, given that WebAssembly files are always modules. |
I would assume that |
I could see that making sense, but would it be at least permitted to use the Wasm MIME type? In my opinion, seeing the Wasm MIME is more readable, and others may find that it makes more sense too, but if we have to use |
Note that even with whatwg/html#4372, |
whatwg/html#4372 (comment) |
It seems like no progress has veen made here, so far? Imo, anything that allows clearly distinguishing WebAssembly from JavaScript would be beneficial, at least regarding readability of the document. On top of readability, using I do believe the situation that I had initially raised, that is, consumption of user resources in order to request Wasm, which a browser would always fail to load, is a valid reason to make the explicit distinction. Do the authors of the proposal agree? On the other hand, if |
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:
If so, might I suggest that we look at how JavaScript was originally intended to be imported:
Google's Dartium browser used the Dart mime for executing 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.
The text was updated successfully, but these errors were encountered: