we (web engine): Experimental web browser project to understand the limits of Claude
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

WebAssembly streaming compilation: compileStreaming, instantiateStreaming #227

open opened by pierrelf.com

Wire WebAssembly compilation to the Streams API and the Fetch API so pages can compile modules while they download. Depends on the WebAssembly JS API issue and the existing Streams/Fetch infrastructure from Phase 20.

Scope:

  • WebAssembly.compileStreaming(source) and WebAssembly.instantiateStreaming(source, importObject?) accepting a Response or a Promise.
  • Validate the Content-Type is application/wasm per spec; reject with WebAssembly.CompileError otherwise.
  • Consume the Response body as a ReadableStream, accumulating chunks until end-of-stream, then run the existing compile/instantiate pipeline.
  • Incremental decoder: parse the binary header and section boundaries as bytes arrive so a malformed prefix can short-circuit before the body finishes (optional optimization; the simpler version is buffer-then-compile, but please document the choice).
  • Propagate fetch network errors and stream errors as the same WebAssembly.CompileError surface.
  • Honor body locking and cancellation semantics established in Phase 20.

Acceptance criteria:

  • Tests cover streaming compile happy path, mismatched Content-Type rejection, mid-stream network error, and cancellation through AbortController.
  • E2E coverage: a page fetches a small .wasm fixture via fetch(), passes the Response into instantiateStreaming, and the exported function returns the expected value (add an e2e scenario under crates/e2e/scenarios with a static .wasm under crates/e2e/pages).
  • cargo clippy --workspace -- -D warnings passes; no external dependencies.
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mm2tmt5tba27