-
Notifications
You must be signed in to change notification settings - Fork 11
Fix dynamic pyodide switching with multiple files #1097
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
Fix dynamic pyodide switching with multiple files #1097
Conversation
…_switching_with_multiple_files
| ); | ||
| if (hasSkulptOnlyModules || senseHatAlwaysEnabled) { | ||
| setUsePyodide(false); | ||
| break; |
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.
Good solution
Why did you decide to put "break" here?
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 to break out of looping over the components when one is found containing skulpt-only modules. The problem we were having only happened if are multiple components ("files"). If there was a file with skulpt-only imports it would switch to skulpt, but then if it found another file without skulpt-only imports afterwards it would switch back to pyodide and then the code wouldn't run. So we should break out of the loop as soon as we find a file with a skulpt-only import, as we already have enough information to know we need to use skulpt.
KristinaDudnyk
left a comment
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.
Amazing work Lois👏👏👏
## [0.28.0] - 2024-10-22 ### Added - PyodideWorker setup for the editor (#1104) - Enabling `pyodide` support in the web component (#1090) - `Pyodide` `matplotlib` support (#1087) - Tests for running simple programs in `pyodide` and `skulpt` (#1100) - Fall back to `skulpt` if the host is not `crossOriginIsolated` (#1107) - `Pyodide` `seaborn` support (#1106) - `Pyodide` module caching (#1113) ### Changed - Upgrade to `webpack 5` (#1096) - Bump `pyodide` to `v0.26.2` (#1098) - Updated the ImportErrors message (#1105) - In ErrorMessage component added the way to display html elements in string (#1105) ### Fixed - Dynamic runner switching with more than one `python` file (#1097) - Pyodide running the correct file (`main.py`) when there are multiple `python` files (#1097) - Build to include public files (#1112) - Persisting choice of tabbed/split view when running `python` code (#1114)
What's Changed?
pyodidewhen there are multiple filescloses #1095