-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
full nodejs support in file_packager.py #164
Conversation
Thanks for the pull request! I think the test is failing because it's outputting the new anonymous function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. It would be nice to integrate your PyodideNode.js
changes, too, when they are ready.
Sure, i can start working on |
Simplify traceback on package load timeout
Add dev python notebook python_dev.html
Fix load .data files from the same base URL as .js
Thanks for updating this -- it looks like it's passing now. Should we merge this now, or wait on the corresponding changes to Also, can you please rebase on master, rather than merging master? These merge commit will make history much harder to follow. |
Merge, please. I'm still trying to figure out the best way to make a clean
yes, sorry about that |
WIP: Use LZ4 filesystem compression, using the canonical C implementation
Add API reference documentation
Hi @mdboom, I did the rebase with your master, but i think it came with something wrong regarding the firefox tests. |
@rth: Does anything immediately come to mind for you with the failing test? It's in the new "load from a second origin" test. |
Thanks for working on this @gabrielfreire ! It looks like the merge master + rebase didn't go so well -- there is a number of commits already on master in this branch. One possibility could be to create a new branch from upstream master, and Also could you provide some instruction how one would use this in node? (i.e. what I need to do after launching Regarding the failing test, it may be an error when closing the connection with the web-server (we get those sometimes in general, it's just than now that are captured in the web-server logs) -- possibly re-running the build would fix it. But this may also mean that the test in question is a bit brittle. |
The node support here is just for the
the way it is structured now, What are your thoughts about this ? |
Should we close this, as it was superseded by #183 ? |
i think you can close this one |
Partially address #14
Changes
where it sets the Module
var Module = ...
, added a check to look forprocess[%(EXPORT_NAME)s]
which is where PyodideNode.js stores itspyodide
Module.where it tries to set
PACKAGE_PATH
, added support for nodejs and stopped throwing errors if not in a browser, now the error is thrown if the user is on some mysterious environment that is not browser, worker or nodejs.changed the
fetchRemotePackage
method to check forXMLHttpRequest
before trying to fetch anything, if user is not on a browser, usenodejs
isomorphic-fetch
/fs
to fetch remote/local packagesafter the data has been fetched, there are some problematic asserts for
nodejs
, sometimes the buffer is not thearrayBuffer
, but thearrayBuffer.buffer
it was necessary to change from
line 700
assert(arrayBuffer instanceof ArrayBuffer, 'bad input to processPackageData');
to
assert((arrayBuffer instanceof ArrayBuffer || arrayBuffer.buffer instanceof ArrayBuffer), 'bad input to processPackageData');
and from line 701
var byteArray = new Uint8Array(arrayBuffer);
to
var byteArray = new Uint8Array(arrayBuffer instanceof ArrayBuffer ? arrayBuffer : arrayBuffer.buffer);
this format was tested using
PyodideNode.js
onpyodide.asm.data.js
andnumpy.js
and works fine.