feat: complete Web Component migration — Phases 1–7, CI, and v1.0.1 hardening#9
Merged
Conversation
Runs on every push (non-main) and every PR targeting main. Steps: npm ci → npm test → build:component → docs:build → pack --dry-run. Uses Node 20 LTS, consistent with engines: >=18 in package.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cancels in-progress CI runs when a new push arrives on the same branch, preventing redundant double-runs on rapid PR pushes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures open issues from Codex and DeepSeek reviews that were not fixed immediately: TypeScript CI check, branch protection, Node version gap, npm audit, CDN pinning, framework example verification, and the Firefox dev-test MLS sound issue. Includes a resolved table for reference. SESSION_HANDOFF.md updated with a pointer to the new file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
This PR brings the full
webcomponentbranch tomain. It covers the complete migration from the original proof-of-concept to a published, hardened npm package — Phases 1 through 7 plus post-publication quality work.Phase 1–3 — Component architecture
TestLatencyMLSfrom static singleton to instance-basedLatencyTestController<latency-test>Custom Element with Shadow DOM,start()/stop()methods, and six lifecycle eventsrecording-mode="audioworklet"— dual-channel AudioWorklet processor capturing mic + reference PCM simultaneously, eliminating JS start-timing biasdebugattribute forconsole.debuglogging at internal checkpointsrecording-mode="mediarecorder-2ch"emitslatency-error(Phase 3b placeholder)Phase 4 — Demo and session model
getUserMedia+AudioContextcreated once behind a Connect Audio button; shared across all tabsChannelSplitter→GainNode→MediaStreamDestinationchain with bypass togglesrc/dev-test/;src/index.htmlbecomes a navigation hubPhase 5 — Build pipeline
worker.jsandrecorder-processor.jsas Blob URLsdist/latency-test.esm.js) + IIFE (dist/latency-test.iife.js) outputs with source mapscleanDist()fixed for fresh CI runners (was crashing withENOENTon missingdist/)demo/anddist/into the VitePress output artifactPhase 6 — Documentation
tests/mls.test.js+tests/worker.test.jsusingnode:test, Node 18.12.1Phase 7 — npm publication (
@adasp/latency-test@1.0.0)@hi-audio→@adaspacross all filessrc/index.d.ts: full TypeScript declarations (LatencyTestElement,LatencyTestEventMap, all detail interfaces)package.json:types,exports.types,prepublishOnly,publishConfig,enginesfields added@adasp/latency-test@1.0.0— live on npm, jsDelivr, unpkgv1.0.1 — Truth and hardening patch
onErrorwith!stoppedguard;start()catch block resets state and cleans up stream/controller; public property class field defaults addedsignalTypenarrowed to'mls'; duplicateinputGainremoved; JSDoc caveats oninputGainandmediarecorder-2ch;aborted?,bufferSizeaddedlatency-completepayload bug fixed; framework TypeScript sections use published import patternCI
.github/workflows/ci.yml: runsnpm test→build:component→docs:build→pack --dry-runon every push and PR targetingmain; concurrency group cancels redundant runsagents/KNOWN_ISSUES.md: running log of deferred review findings (TypeScript CI check, branch protection, CDN pinning, framework verification, Firefox dev-test issue)Test plan
npm testpassesnpm run build:componentpassesnpm pack --dry-run— 8 files includingdist/index.d.ts@adasp/latency-test@1.0.0and@1.0.1confirmed live on npm🤖 Generated with Claude Code