-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add a Pyodide runner based on the python-execution-prototypes #893
Conversation
|
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
… 3.11.1 to 4.0.0 (#895) We need to be able to conditionally set headers for pyodideWorker.js in pull request #893 but this feature isn’t supported in webpack-dev-server 3.x.x. We therefore need to upgrade to version 4.0.0 which allows a function to be provided in the headers option. When attempting this upgrade, I ran into [this issue](storybookjs/storybook#22431) and only managed to resolve it by also updating yarn to version 3. I’ve tried to follow the migration guide here: https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md
|
|
Jest doesn’t support Web Workers and was erroring because the importScripts function isn’t available. Best practice seems to be to mock the module and returned canned responses. Currently, we don’t have Jest tests for the experimental PyodideRunner.js so an empty implementation is sufficient but we could change this later. https://stackoverflow.com/questions/42567535#answer-62436219
|
|
@@ -0,0 +1,364 @@ | |||
/* eslint import/no-webpack-loader-syntax: off */ | |||
/* eslint-disable react-hooks/exhaustive-deps */ |
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.
⛏️ I'm not a fan of this rule for sure, especially with empty dependency arrays but 2/3 useEffects that are effected can have handleRun
and handleStop
in the array without any impact
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.
raising just so I can make a TODO ticket 👍
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 was copied over from PythonRunner.jsx
when I started working on PyodideRunner.jsx
. I tried reinstating the eslint but it caused quite a lot of errors that will take some time to fix. Maybe we can address this later in a separate ticket as you suggest. I've addressed the other pull request comments now.
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.
👍 only a couple of minor things and want to get this in to build on. Great work 🥳
|
These ternaries were copied over from PythonRunner.
|
I'll make a general ticket to list the remaining work, feel free to add any additional bits or comments 👍 |
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 ace! Let's get it in and build on top 😄
This pull request adds experimental support for running Python programs using Pyodide. The code is based on the python-execution-prototypes and the technical analysis document. The related GitHub issue is #891.
The PyodideRunner.jsx can be used instead of the current PythonRunner.jsx (Skulpt) by provided a
?pyodide=true
parameter in the URL as shown in the screenshot below:Notes
The PyodideRunner supports the following features:
Ctrl-d
Due to time constraints, the following tasks remain outstanding:
crossorigin
will need to be added to cross-domain resources once the HTTP headers are addedsqlite3
so we can add a UI wrapper around it