webassembly-component-development

Installation
SKILL.md

WebAssembly Component Development

Build components against WASI 0.3 (wasip3). It adds native async, stream<T> and future<T> to the component model, so most of the old workarounds (poll loops, tokio_unstable, third-party async runtimes) are no longer needed for new code. Fall back to wasip2 only when a runtime or dependency requires it.

Key Defaults

  • Target: wasm32-wasip3 (Tier 2 in Rust, stable since 1.100.0). Use the wasip3 crate for WASI bindings (wasip2 crate for the fallback). Gate code with #[cfg(all(target_os = "wasi", target_env = "p3"))].
  • Build: use wash build when the project has .wash/config.yaml. For plugins use wash build --skip-fetch (the wasmcloud:wash interface isn't published). Otherwise cargo build --target wasm32-wasip3 --release.
  • Async: use the component model's native async: async fn in exported handlers, wit_stream / wit_future for streams and futures, wit_bindgen::spawn_local for background tasks. Don't pull in tokio or wstd for new p3 code (see async.md).
  • Threading: not available yet. std::thread::spawn returns an error on wasip3, and cooperative threading is still in development. Design single-threaded and avoid rayon.
  • Strings: UTF-8. Avoid as_encoded_bytes().
  • Version matching: the runtime must implement the exact WASI 0.3.x versions your component imports. Check with wasm-tools component wit component.wasm.
  • wasmCloud docs: use https://wasmcloud.com/docs/, never /docs/v1/.

Reference Files

Load the relevant file when working on the matching topic:

Installs
37
GitHub Stars
22
First Seen
Feb 12, 2026