Repository navigation
fix(spf): pin @caprid/moq-media 0.1.0 and address #75 review - #77
Conversation
moq-media 0.1.1 statically imports a base64 libopus WebAssembly module for packet-loss concealment, which grew the /moq entry from 32 kB to 103 kB brotli. The player already turned concealment off: that decoder is single-stream and would decode a multistream Opus track as noise. 0.1.1's only code change is that path, so 0.1.0 is equivalent at a third of the size. The pin is exact because ^0.1.0 resolves to 0.1.1, and the lossConcealment option goes away with it. Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
The sandbox page still said the loopback relay speaks draft-20. The FIN comment cited §6.4.2.3 as if a FIN were a cancellation, which §6.4.2.2 rules out; it now says the loopback ends the subscription on either. The vi64 note now covers the 9-byte form and why encoding stops at 8. Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
📦 Bundle Size Report🎨 @videojs/html
Presets (7)
Media (19)
Players (5)
Skins (29)
UI Components (62)
⚛️ @videojs/react — no changesPresets (7)
Media (22)
Extensions (2)
Players (5)
Skins (18)
UI Components (39)
🧩 @videojs/core — no changesEntries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cdn — no changes📦 @videojs/cloudflare-video — no changes📦 @videojs/dash-video — no changes📦 @videojs/google-cast — no changes📦 @videojs/hlsjs-video — no changes📦 @videojs/media — no changesEntries (3)
📦 @videojs/mux — no changes📦 @videojs/mux-audio — no changesEntries (2)
📦 @videojs/mux-data — no changes📦 @videojs/mux-video — no changesEntries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/shaka-video — no changes📦 @videojs/spf
Entries (8)
📦 @videojs/spotify-audio — no changes📦 @videojs/tiktok-video — no changes📦 @videojs/twitch-video — no changes📦 @videojs/other — no changesEntries (3)
📦 @videojs/vimeo-video — no changes📦 @videojs/wistia-video — no changesEntries (2)
📦 @videojs/youtube-video — no changesℹ️ How to interpretEach entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately. Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles. Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded. Run |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
The previous note said 8 bytes hold every integer a JS number represents exactly. They don't: a double holds some larger integers exactly, such as 2^56, and the 8-byte encoder would mis-encode them. 56 bits do hold every safe integer, so the encoder now throws a RangeError for anything else instead of writing wrong bytes. Claude-Session: https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
Brings in #72 (worklet audio core), #75 (player on @caprid/moq-core, moqt-22) and #77 (moq-media pinned to 0.1.0). The publisher keeps its own draft-20 copy of network/moqt until its publish session moves onto @caprid/moq-core; the player side uses the package. The cross-engine relay hub now speaks each engine's draft: draft-20 upstream to the publisher, moqt-22 (via moqt-wire) to the player, whose Location Filters draft-22 encodes differently. The cross-engine harness hands the engine a context with `baseContext`, as the adapter does, so the worklet audio core can start. Claude-Session: https://claude.ai/code/session_01DaH4ihcQ4LStE1f1zbDuZm
Refs #75
Summary
Follow-ups to #75, which merged before its review comments were addressed. The main fix is size: #75's
@caprid/moq-media0.1.1 bump grew the/moqentry from 31.6 kB to 102.6 kB brotli. That growth is a libopus WebAssembly module the player had already turned off. Pinning 0.1.0 brings the entry back to 32.9 kB.Changes
@caprid/moq-mediato exactly0.1.0.opus-decoder-wasm.js, 152 kB minified of base64 for packet-loss concealment. Brotli can't compress it, andsideEffects: falsecan't shake it out, becauseaudio-player.jsreferences it.lossConcealment: false, because that decoder is single-stream and would turn multistream Opus into noise. So we shipped the bytes and never ran them.^0.1.0resolves to 0.1.1. ThelossConcealmentoption and its test go away with it, since 0.1.0 has no such option.@caprid/moq-core0.1.0, so the install now carries that version beside our 0.1.1. No moq-media module imports moq-core, so it never reaches the bundle.Bundle size (
@videojs/spf/moq, esbuild minify + brotli, same as the CI report)network/moqt, moq-media 0.1.0)Review comments on #75 not acted on
engines: node >=24vs the root>=22.19.0(cubic, P2). This mismatch was already accepted in feat(spf): render MoQ audio through the @caprid/moq-media worklet core #72 for@caprid/moq-media, and moq-core adds the same constraint. Left as is..agents/plans/moq-transport-20-migration.mdandmoq-engine-implementation.md(cubic, P3). These are deliberately kept on the MoQ integration branches. Left as is.Testing
pnpm -F @videojs/spf test: 2305 tests pass, with no type errors.pnpm build:packages,pnpm typecheckandpnpm lintall pass.codex review --base mmcc/moqfound no issues.@caprid/moq-core, played throughcreateMoqEngine. Both connections negotiatedmoqt-22. Over 20 s: 590 video frames decoded with 0 dropped, 0 audio underruns, and the audio clock advanced 14915 ms over 15025 ms of wall time.🤖 Generated with Claude Code
https://claude.ai/code/session_01DaH4ieYHRP2Agar6P9KSCB
Summary by cubic
Fixes the /moq bundle size by pinning
@caprid/moq-mediato exactly0.1.0and corrects the sandbox loopback relay notes per #75's review.moq-media0.1.1 statically imports a base64 libopus WebAssembly module for packet-loss concealment, growing the/moqentry from 31.6 kB to 102.6 kB brotli. feat(spf): speak moqt-22 through @caprid/moq-core #75 already disabled concealment (the decoder is single-stream and would decode a multistream Opus track as noise), and 0.1.1's only code change is that path, so 0.1.0 is functionally identical at a third of the size. The pin is exact because^0.1.0resolves to 0.1.1; the now-absentlossConcealmentoption and its test are removed.moq-media0.1.0 depends onmoq-core0.1.0, so both versions get installed, but no moq-media module imports moq-core, so the spare copy never reaches the bundle.RangeErrorinstead of mis-encoding them, since some doubles larger than 2^53 (e.g. 2^56) fit in 8 bytes but would encode wrongly; the vi64 comment covers the 9-byte form and why encoding stops at 8.Written for commit 9912f29. Summary will update on new commits.