Closed loiswells97 closed 4 months ago
Branch issues/936-Spike_Investigate_using_pyodide_dynamically created!
skulpt
only module alongside a pyodide
only module. We would need to avoid an interminable loop switching between skulpt
and pyodide
, and consider how we would communicate with the user that they can't use these two libraries together.RunnerFactory
instead, we might not need to switch runners part way through when the user imports an unsupported library.skulpt
from within the pyodide
runner if it detects an import that is only available in skulpt
pyodide
again could be difficult, as skulpt
seems to be looping through imports internally, rather than giving us a list of them upfront. Maybe we would need to have a flag that allows the runner to switch to pyodide
if one of the imports is not foundskulpt
and pyodide
, and one approach to solving this could be to revert to pyodide
at the start of each run, and then switch to skulpt
if needed, so there is never a need to switch back to pyodide
p5
canvases that is breaking skulpt
, which would need to be fixed for the previous point to work, as otherwise, switching back and forth between pyodide
and skulpt
would cause the p5
canvas to re-render between runs, which would throw errors.pyodide
or skulpt
to use based on the imports at a higher level (e.g. in the RunnerFactory
). This would require some way of parsing the python code to extract the names of the importsfilbert
has not been updated in 5 years and does not support parsing imports, while python-ast
crashes the app when you try to import parse
.p5
canvases because the same canvas still exists in the DOM all the time, even when not shown.p5
projects still work in pyodide
Questions we want to answer