Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves the webapp’s Pyodide execution off the main UI thread into a dedicated Web Worker, replacing direct Pyodide/PyProxy usage in React with a typed, promise-based request/response API. It also updates bundling/docs to stop relying on a global loadPyodide() script tag and instead load Pyodide from the CDN inside the worker.
Changes:
- Introduce a
PyodideClientthat communicates with a dedicated worker for prepare/run/generate-HTML operations. - Add a new
pyodide-worker.tsmodule that loads Pyodide (via CDN) and runs repo-review logic inside the worker. - Update build/docs/html entrypoints to remove the Pyodide global script requirement and emit the worker bundle.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/repo-review-app/utils/pyodide.ts | Replaces direct Pyodide calls with a worker-backed PyodideClient RPC wrapper. |
| src/repo-review-app/utils/pyodide-worker.ts | New worker implementation that loads Pyodide and runs repo-review tasks. |
| src/repo-review-app/utils/pyodide-common.ts | Shared request/response + data types for the UI↔worker protocol. |
| src/repo-review-app/repo-review-app.tsx | Switches the UI to use PyodideClient and removes PyProxy lifecycle handling. |
| src/repo-review-app/index.html | Removes the global Pyodide <script> tag. |
| package.json | Updates build steps to emit the worker bundle alongside the app. |
| docs/webapp.md | Updates integration notes to reflect worker-based Pyodide loading. |
| docs/live-demo.md | Removes the Pyodide <script> tag from the demo page. |
| .gitignore | Ignores the emitted minified worker bundle under docs static assets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
0aaee89 to
94dcee6
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Assisted-by: OpenCode:Kimi-K2.5 Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This was started with copilot in VSCode, auto model.
The first commit works with
bundle serve, but with a more complex blob API. The later comments should work most places except bun serve, and require a new file.