Skip to content

CWIST v3.6

Choose a tag to compare

@gg582 gg582 released this 21 Sep 02:35
· 836 commits to main since this release

CWIST v3.6 — WASM client-side support: from in-tree target to usable from JavaScript

Major changes compared to v3.5:

  1. WASM correctness wave (issue #93 Phase 1, #176)

    • cwist_db (SQLite) compiles into libcwist_wasm.a: cwist_db_open_memory() / cwist_db_serialize() work under Emscripten.
    • EM_JS clang-format corruption fixed and guarded so it cannot recur.
    • Emscripten build + smoke test is a CI gate (.github/workflows/wasm.yml).
    • docs/api/wasm.md: scope, the dispatch_memory pattern, TypedArray helpers, the db round trip, session caveats.
  2. JavaScript consumption (issue #93 Phase 2, #185)

    • cwist-wasm npm package (wasm/npm/): fetch-style API over the WASM dispatch path, index.d.ts, README; make wasm-dist builds the tarball and CI verifies a clean install.
    • First-party JS wrapper (CWIST_WASM_DEFINE_ENTRY) so consumers do not hand-roll Emscripten glue.
  3. Streaming, sessions, and WASI (issue #93 Phase 3, #195)

    • Boundary streaming: cwist_app_dispatch_stream + cwist_stream_req_begin/feed/end; the entry macro exports _cwist_wasm_dispatch_stream pumping Module.cwistStreamChunk.
    • Session persistence model: pin the signing secret, let the signed client-side cookie carry the state; sessions actually link under WASM via a bundled header-only SHA-256/HMAC.
    • WASI targets land in-tree (experimental, see docs/api/wasi.md): preview1 runs the in-memory dispatch surface under wasmtime; WASI 0.2 binds real sockets and serves cleartext HTTP through wasi:sockets.
  4. End-to-end example (issue #93 Phase 4, #198)

    • example/wasm-service-worker/: routing + zod validation + template rendering + cwist_db + pinned-secret sessions served by a Service Worker fetch-interception layer with its own cookie jar; CI-gated build + node smoke.
  5. Also in this release

    • WebSocket non-blocking I/O on C1M reactors (issue #181, #182).
    • RX-uring receive path on io_uring reactors (issue #179, #187).
    • Per-event latency probe: CWIST_LATENCY_PROBE=1 histograms queue delay and callback runtime (issue #166, #186).
    • CWIST_PROFILE preset env var (issue #171, #188); C1M + drain-chunk 8 is the default baseline.
    • BDR per-connection cursor fast path for cached GET replies (#194).
    • SQLite WASM bundle decision recorded: single bundle, no opt-out — db-less consumers link ~64.8 KB (per-object archive linking); the ~1 MB for db users is SQLite's reachable core (#199).

Notes:

  • lib/lsquic stays pinned to upstream master (2b30189), the same stable pin as v3.5.
  • Source tarball builds like v3.5: vendored dependencies included; make at the top level produces libcwist.a, the CLI, and cwist.pc.
  • Homebrew formula in this release line: packaging/homebrew/cwist.rb (tap: c4punks/homebrew-cwist).