Repository navigation
fix(wasm): format JS error paths and guard Tunelet lifecycle - #63
Conversation
- Store the rejected value in the range and finiteness errors. - Add an exact size problem for the zero block limit. - Store both pitch bounds in the unordered frequency error. - Add the voice index to the harmony interval errors. - Store the offsets and the frame count in the event errors. - Add MidiProblem for invalid MIDI bytes and fields. - Carry MidiProblem in the MIDI errors and event errors. - Add the buffer name to the buffer length checks.
- Include the rejected rate and block limit in constructor errors. - Format dotted configuration paths as camelCase in JavaScript errors. - Replace internal Rust type paths with public TypeScript names. - Emit clean camelCase TSDoc without raw rustdoc links.
- Reject defaultConfig and Tunelet calls before initialization. - Reject loadTunelet and initSync calls with a different Wasm source. - Clear the initialization state after a load error. - Make free and Symbol.dispose safe to call more than one time. - Reject method and property calls on a disposed Tunelet instance. - Document the lifecycle rules in the README.
- Merge the latest commits from main into the feature branch. - Update the harmony_gain documentation for Rust and TypeScript.
- Merge the latest commits from main into the feature branch. - Keep the buffer names in the length checks. - Map the Processor::check_block errors in the Wasm processor. - Initialize Wasm asynchronously from a Node.js file URL.
- Merge the latest commits from main into the feature branch. - Keep the Wasm doc comments in src/wasm.rs without self-references. - Keep the Wasm error translation and the lifecycle guards.
- Merge the latest commits from main into the feature branch. - Keep the Wasm doc attributes in src/effects/reverb.rs. - Keep the Wasm doc attributes in src/resynthesis.rs.
|
Review: Formatting Wasm error paths as camelCase, cleaning internal type names, and guarding Tunelet lifecycle (idempotent free / Symbol.dispose) solve real pain points. However, this PR bundles invasive breaking changes to Rust Error variants, alters the documented loadTunelet() idempotency contract, and duplicates cfg_attr docs across 10 files. Please split out a non-breaking PR for Wasm error formatting and lightweight lifecycle guards first. |
- Merge the latest main branch - Restore the native Rust Error variants and the shared doc comments - Format dotted configuration paths as camelCase in Wasm errors - Replace internal Rust type paths with public TypeScript names - Keep the documented loadTunelet idempotency contract - Reject defaultConfig and Tunelet calls before initialization - Make free and Symbol.dispose safe for duplicate calls - Reject method and property calls after Tunelet disposal
|
Addressed in
|
|
Round 2 review: Approved — shrinking this to a non-breaking Wasm error formatter and Tunelet lifecycle guard in src/index.ts + src/wasm.rs is much cleaner. Please rebase onto updated main after #30, #123, and #135 with two small updates:
|
- Merge the latest commits from main into the feature branch. - Forward controlActivity on the Tunelet class in src/index.ts. - Replace the Rust range syntax in src/index.ts JSDoc comments. - Format envelope_key and control_activity errors in src/wasm.rs.
|
Addressed in
|
|
Round 3 review: Approved — non-breaking Wasm error formatting and Tunelet lifecycle guard look great. Please rebase onto updated main after #117 and #107, forwarding the new f32/in-place methods and pointer getters from #117 on the Tunelet wrapper class (and keeping TuneletAudioViews compatible with the wrapped Tunelet). |
- Forward the Float32 methods and pointer getters on Tunelet - Format Float32 Wasm errors with camelCase property paths - Keep TuneletAudioViews and the normalized JSDoc comments
|
Addressed in
|
|
Review: camelCase Wasm error formatting, Rust type-path stripping, and Please sync onto updated Note: Once #119 merges, the |
- Keep the Telemetry serializer and ParameterControl decoding - Format ParameterControl validation errors with camelCase paths
- Check pre-initialization errors for defaultConfig and Tunelet - Check camelCase Wasm error paths and clean TypeScript names - Check duplicate free calls and post-free errors
|
Addressed in
|
Summary
src/wasm.rsascamelCaseJavaScript property paths (resynthesis.choirDetune,punch.gainDb,resynthesis.correction.flexTune,resynthesis.pitch.minFrequencyHz/resynthesis.pitch.maxFrequencyHz,outputGain) acrossInt16,Float32/ in-placeFloat32, and#61ParameterControlcalls without changing native RustError,ConfigProblemorEventProblemvariants.#104'sTelemetryserializer and#61'sParameterControldecoding insrc/wasm.rs, replace internal Rust module and wrapper paths intsifyand stage-event deserialization errors (tunelet::wasm::BlockEvents->TimedEvent[],tunelet::<module>::<Type>-><Type>, includingControlActivityfrom#135), and align Wasm parameter names (sampleRate,maxBlockFrames,maxFrequencyHz) with thecamelCasedocumentation.TuneletAudioViews(#117), the documentedloadTunelet()andinitSync()idempotency contract, and#123file:URL string / cross-realm handling insrc/index.tswhile guarding pre-initializationdefaultConfig()/new Tunelet(...)calls, forwarding allTuneletmembers (includingcontrolActivity()from#135andFloat32methods and pointer getters from#117), makingfree()and[Symbol.dispose]()idempotent, throwing a clearErroron post-free()method or getter access, and keepingsrc/index.tsJSDoc clean for#107.scripts/verify-pack.mjsfor pre-initialization errors,camelCaseWasm error paths (including#61ParameterControlevents andFloat32/ in-placeFloat32calls), stripped Rust type paths, idempotentfree()/[Symbol.dispose]()calls, and post-disposal errors across getters and methods.Verification
cargo fmt --checkcargo rustc --locked --lib --release -- -D warningsRUSTFLAGS="-D warnings" cargo build --locked --releasecargo clippy --locked --lib -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-depscargo +1.88 build --locked --libandcargo +1.88 build --locked --lib --target wasm32-unknown-unknown --features wasmcargo package --lockednpm run check:wasmnpm run verify:packandnpm run verify:pack -- --ignore-scripts