-
Notifications
You must be signed in to change notification settings - Fork 35
Allow URL as ModuleSpecifier? #11
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
Comments
I don't think considerations here are really in scope for the wasm spec. Instead, each host gets to decide what specifiers mean. For web browsers, that's specified in the HTML Standard; Node will similarly make its own decisions. Those decisions apply across the entire module system, and are not in the scope of individual language specs. |
Ok, that's right. I think that we should still make a distinction here between importing:
|
I don't think such a distinction should be made, or at least, should not be in browsers or Node.js. In both environments you can only import modules whose source text you can already read the entire contents of, so any access restrictions wasm would put in place are faulty. |
Agreed with Domenic, this would be out of scope for this WG. |
Uh oh!
There was an error while loading. Please reload this page.
The ModuleSpecifier in the ECMAScript specification is a string and some environment allows to load a module from an arbitrary URL.
I don't see a reason to explicitly disallow it but it should be under the CSP and the same JavaScript Module loading checks should be applied. That's probably a case where HTTPs should be required?
While I don't really see a use case in bundlers, in browser it would make sense to me. It could also act as a RPC framework.
Here's an example:
It would probably make sense to add a few restriction, disallowing this for example:
We will need appropriate error handling, if the imported module isn't reachable you will end up with a NULL pointer in the wasm module?
The text was updated successfully, but these errors were encountered: