A Bazel module with tools for working with WebAssembly components.
This module primarily hosts language-agnostic rules for working with WebAssembly components, but also welcomes language-specific rules to compile source code files into components (including generating WIT bindings).
//wasm:defs.bzl:wasm_component - Turn a core Wasm module into a component.wasm_plug - Link the exports of a 'plug' component
into the imports of a 'wrapper' component to create a new component.
This is the simplest way to compose components together
without a WAC file.wit_package - Bundle a group of WIT files into a unified package.//rust:defs.bzl:rust_component - Compile a WIT interface and matching Rust implementation
into a Wasm component.
Use the default Rust toolchain.rust_wit_bindgen - Generate Rust sources for a Wasm interface.
This is a lower-level rule that you normally wouldn't need to use directly.
Use rust_component for a single macro to compile a component from Rust.//c:defs.bzl,
which makes use of the WASI SDK:c_component - Compile a WIT interface and matching C implementation
into a Wasm component.c_wit_bindgen - Generate C sources for a Wasm interface.
This is a lower-level rule that you normally wouldn't need to use directly.
Use c_component for a single macro to compile a component from C.wit-bindgen-go is only known for sure during the execution phase.
Meanwhile, there's a temporary crutch: //go:defs.bzl,
which makes use of TinyGo and is somewhat limited.go_component - Compile a WIT interface and matching Go implementation
into a Wasm component.go_wit_bindgen - Generate Go sources for a Wasm interface,
including a minimal go.mod file to emulate a Go module.
This is a lower-level rule that you normally wouldn't need to use directly.
Use go_component for a single macro to compile a component from Go.See example/.
aarch64-linuxaarch64-macosx86_64-linuxx86_64-macos