Skip to content

Load the @moq worklets from /assets/ on every site - #203

Open
kixelated wants to merge 2 commits into
mainfrom
quest/m0/dogfood-assets
Open

kixelated wants to merge 2 commits into
mainfrom
quest/m0/dogfood-assets

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Completes quest/m0/dogfood-assets.md.

Summary

  • moq.dev (watch, publish, boy, voice-demo components), moq.pub, and moq.watch call assets("/assets/") from the package root before any element starts, so the audio worklets and the capture worker load from the site instead of blob:.
  • No copying: moq's worklet() plugin already emits each file to assets/<name>.js in every build. vite-plugin-static-copy is dropped.
  • The dev server did not serve those files (it answered index.html), so audio broke under vite/astro dev. Fixed upstream in moq-dev/moq#6626 and the moq submodule is bumped to it. The bump picks up the new @moq/ui package, added to workspaces.
  • The path is /assets/, not the /moq/ the quest and moq's docs suggest: moq.dev routes /moq* to the Worker for the Go vanity imports, and /assets/ is where the plugin already puts the files.

Before merging

The moq submodule points at the head of moq-dev/moq#6626, which is not on moq main yet. Once it merges, re-pin the submodule to moq main (the squash commit) so the pin doesn't dangle when the branch is deleted.

Verification

  • just check, just fix, quest check, bun test pass. astro build and both vite builds emit assets/{render-worklet,capture-worklet,capture-worker}.js.
  • moq.watch dev server (vite sites/watch --mode staging, /demo/bbb.hang): AudioWorklet.addModule receives http://localhost:5273/assets/render-worklet.js, a render node is created, and the AudioContext runs.
  • moq.watch production build under wrangler dev: same, from /assets/render-worklet.js; the hashed blob chunk is never fetched.
  • moq.dev astro dev serves /assets/render-worklet.js as JavaScript on /watch.
  • moq.pub production build under wrangler dev: /assets/capture-worklet.js loads into an AudioWorklet and /assets/capture-worker.js starts as a module worker and posts its ready report.

Not verified: an actual publish. The preview browser blocks the mic and camera, so the capture worklet was not exercised through <moq-publish>, and the capture worker path (Firefox, Safari) was not exercised in those browsers.

Follow-ups

  • moq's doc/lib/js/{watch,publish}.md use /moq/ in the assets() example; fine for most sites, but worth noting the plugin's assets/ default if moq.dev is cited as the reference.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 23, 2026 23:17
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The worklet plugin already emits each worklet and worker to assets/<name>.js,
so each site calls assets("/assets/") before any player starts. Bumps moq to
serve those files from the dev server too, which adds the @moq/ui workspace.
Drops the unused vite-plugin-static-copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 06:44
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 916e3dd7-3109-4108-9d3a-ae6003396deb
Commits

Reviewing files that changed from the base of the PR and between 76b0278 and 3f844c7.

Files ignored due to path filters: 1
  • bun.lock is excluded by !**/*.lock
Files selected for processing: 10
  • moq
  • package.json
  • quest/m0/README.md
  • quest/m0/dogfood-assets.md
  • sites/pub/src/main.ts
  • sites/watch/src/main.ts
  • src/components/boy.tsx
  • src/components/publish.tsx
  • src/components/voice-demo.tsx
  • src/components/watch.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T06:46:10.280931Z 3f844c7 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-24T06:47:29.131938Z 3f844c7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: CI passes; marked ready for review. Open decisions for the maintainer:

  1. Merge order (recommended): review and merge moq-dev/moq#6626 first, then re-pin the moq submodule here to moq main and merge this. Alternative: drop the dev-server half, pin moq back to main, and call assets() only in production builds.
  2. Hosted path: /assets/ (recommended, where the plugin already emits and clear of moq.dev's /moq* vanity routes) versus /moq/ as the quest text suggested, which would need a copy step and a run_worker_first carve-out.

Not verified: a real publish through <moq-publish> (the preview browser blocks mic and camera), and the capture worker in Firefox or Safari.

(Written by Claude Opus 5.5)

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.

1 participant