-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
When using our WASM code currently doing import to anything that is not packaged in the build (builtins, stdlib) will not work. I suggest we will allow import in a way very similar to any other web resource.
For example when we will run the following from http://test.org/py.html
rp.pyEval("import test")
The WASM import will do a HTTP GET request to http://test.org/test.py
and import the content of the file.
We can also allow the users to add other paths to sys.path
so the browser will try to look for the imported file there as well. I think that the paths should be treated like html paths:
path/to/import
: will be relative to the current file./path/to/import
: will be absolute to the server root.- 'http://rustpypi.org/imports': will look in the
imports
path at domainrustpypi.org
.
We should probably add the js VirtualMachine a setSysPath
function like setStdout
.
Metadata
Metadata
Assignees
Labels
No labels