Skip to content

feat(webapp): worker#367

Draft
henryiii wants to merge 7 commits intomainfrom
henryiii/feat/webapp-worker
Draft

feat(webapp): worker#367
henryiii wants to merge 7 commits intomainfrom
henryiii/feat/webapp-worker

Conversation

@henryiii
Copy link
Copy Markdown
Collaborator

@henryiii henryiii commented Apr 6, 2026

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.

  • feat(webapp): run in worker
  • refactor: simpler original impl
  • fix: issue with globals being deleted
  • fix: build example

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PyodideClient that communicates with a dedicated worker for prepare/run/generate-HTML operations.
  • Add a new pyodide-worker.ts module 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.

Comment thread src/repo-review-app/utils/pyodide-worker.ts
Comment thread package.json Outdated
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>
@henryiii henryiii force-pushed the henryiii/feat/webapp-worker branch from 0aaee89 to 94dcee6 Compare April 14, 2026 20:27
henryiii and others added 3 commits April 14, 2026 16:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants