-
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 parser for pyodide.js and pyodide.mjs to avoid webpack traversing dependencies #22
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2011e2c
Introduce a loader to pull in pyodide source
mneil 77d93ad
Fix example webpack config to serve correctly with dev server
mneil 2923887
Use correct location for the commonjs debug target
mneil 7f0a5eb
Update webpack configs for build targets
mneil 4aed1bc
Add esbuild to required dependencies
mneil 8134f11
Remove file accidentally committed
mneil bd98b56
Require the loader as a commonjs module always
mneil 9f25ec2
Change pyodide import path in esm example
mneil 3a9f5b8
Clean up lint errors and fix tests
mneil 1f80287
Loader for esm still flows through acorn parser
mneil 7944fb0
Update tests to run off examples
mneil 0f1111c
Update build script to dynamically copy output to examples
mneil 5fd7c1e
Smarter lookup of pyodide package location
mneil ae47879
Turn the project into an npm workspaces structure
mneil 432264e
Add information about how to use the examples
mneil da2c3b9
Update github workflow for newer versions of node
mneil e52934a
Remove known issues with esm
mneil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Examples | ||
|
||
Example usage of pyodide webpack plugin. Download / copy the example folder you wish to try out and run the following commands: | ||
|
||
``` | ||
npm i | ||
npm run serve | ||
``` | ||
|
||
This will install the necessary dependencies and start webpack dev server. Open your browser to the URL output in the terminal and view the develop console to see the output of pyodide. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { loadPyodide } = require("pyodide"); | ||
|
||
async function main() { | ||
let pyodide = await loadPyodide({ | ||
indexURL: `${window.location.origin}/pyodide`, | ||
}); | ||
// Pyodide is now ready to use... | ||
console.log( | ||
pyodide.runPython(` | ||
import sys | ||
sys.version | ||
`) | ||
); | ||
} | ||
main(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since the examples are used for tests, this should import everything. I.e. by also importing
version
, hopefully it would reveal the same error as in #25