Skip to content

Add typed browser WebAssembly adapter - #8

Merged
konojunya merged 1 commit into
mainfrom
jj/add-wasm-adapter
Sep 3, 2026
Merged

Add typed browser WebAssembly adapter#8
konojunya merged 1 commit into
mainfrom
jj/add-wasm-adapter

Conversation

@konojunya

@konojunya konojunya commented Sep 3, 2026

Copy link
Copy Markdown
Member

背景

Checkpoint D requires the engine to expose the same formatter, checker, and renderer behavior to browser consumers without introducing host I/O or a second semantic implementation.

実装方法

  • add a stack-engine-wasm adapter that accepts string | Uint8Array and returns typed operation results
  • reuse the native engine API for formatting, diagnostics, SVG rendering, and metadata
  • publish a browser-focused @stack-sh/engine package layout with explicit license material
  • audit generated WebAssembly imports and JavaScript glue for filesystem, network, DOM, and clock capabilities
  • document the adapter contract and dependency boundary in ADR 0006
  • add Node 20, TypeScript, package-content, browser, and native/WASM parity gates to CI

テスト方法

  • cargo +stable test --workspace --locked
  • specification conformance suites for formatter and engine
  • SVG validation and Wasmtime cross-target numeric fixture
  • cargo +stable clippy --workspace --all-targets --all-features --locked -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo +stable doc --workspace --no-deps --locked
  • Rust 1.85 workspace tests and clippy
  • npm ci && npm run build:wasm && npm test && npm run typecheck && npm run pack:check on Node 20.18
  • headless Chromium smoke for format, check, and render
  • coverage: 95.52% regions, 97.11% functions, 97.21% lines

Review 視点 / 懸念点

  • confirm the JavaScript result shapes are sufficient for the future CLI and web consumers
  • confirm the generated package includes exactly the intended runtime and license files
  • the synchronous browser API deliberately has no filesystem, network, DOM, or clock capability

@konojunya
konojunya merged commit 07b71c7 into main Sep 3, 2026
2 checks passed
@konojunya
konojunya deleted the jj/add-wasm-adapter branch September 3, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant