{"id":29308555,"url":"https://github.com/pulseengine/rules_wasm_component","last_synced_at":"2026-04-20T09:34:42.012Z","repository":{"id":303256694,"uuid":"1014809833","full_name":"pulseengine/rules_wasm_component","owner":"pulseengine","description":"Bazel rules for WebAssembly Component Model development with multi-profile builds and dependency management","archived":false,"fork":false,"pushed_at":"2026-04-13T11:36:59.000Z","size":198016,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T13:30:09.100Z","etag":null,"topics":["bazel","component-model","pulseengine","rust","toolchain","webassembly"],"latest_commit_sha":null,"homepage":"https://rules-wasm-component.pulseengine.eu/","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pulseengine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-06T13:12:10.000Z","updated_at":"2026-04-13T11:33:05.000Z","dependencies_parsed_at":"2025-07-21T06:12:59.752Z","dependency_job_id":"a202a4e5-f23d-4965-bdb0-ce769c684648","html_url":"https://github.com/pulseengine/rules_wasm_component","commit_stats":null,"previous_names":["pulseengine/rules_wasm_component"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pulseengine/rules_wasm_component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_wasm_component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_wasm_component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_wasm_component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_wasm_component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulseengine","download_url":"https://codeload.github.com/pulseengine/rules_wasm_component/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_wasm_component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32041621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","component-model","pulseengine","rust","toolchain","webassembly"],"created_at":"2025-07-07T07:12:35.777Z","updated_at":"2026-04-20T09:34:42.005Z","avatar_url":"https://github.com/pulseengine.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# rules_wasm_component\n\n\u003csup\u003eBazel rules for WebAssembly Component Model\u003c/sup\u003e\n\n\u0026nbsp;\n\n![Bazel](https://img.shields.io/badge/Bazel-43A047?style=flat-square\u0026logo=bazel\u0026logoColor=white\u0026labelColor=1a1b27)\n![WebAssembly](https://img.shields.io/badge/WebAssembly-654FF0?style=flat-square\u0026logo=webassembly\u0026logoColor=white\u0026labelColor=1a1b27)\n![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue?style=flat-square\u0026labelColor=1a1b27)\n\n\u003c/div\u003e\n\n\u0026nbsp;\n\nProduction-ready Bazel rules for building WebAssembly components across multiple languages with native WASI 0.2 support.\n\n\u003e [!NOTE]\n\u003e Part of the PulseEngine toolchain. Used across all PulseEngine projects for hermetic component builds.\n\n## Why Use This?\n\n- **Multi-language**: Build components from Rust, Go (TinyGo), C++, JavaScript/TypeScript\n- **Production Ready**: OCI publishing, cryptographic signing, WAC composition, AOT compilation\n- **Bazel Native**: Hermetic builds, aggressive caching, cross-platform (Windows/macOS/Linux)\n- **Zero Shell Scripts**: Pure Bazel implementation for maximum portability\n\n## Installation\n\nAdd to your `MODULE.bazel`:\n\n```starlark\nbazel_dep(name = \"rules_wasm_component\", version = \"1.0.0\")\n```\n\n## Quick Examples\n\n### Rust Component\n\n```starlark\nload(\"@rules_wasm_component//rust:defs.bzl\", \"rust_wasm_component\")\n\nrust_wasm_component(\n    name = \"my_service\",\n    srcs = [\"src/lib.rs\"],\n    wit = \":service_wit\",\n    profiles = [\"debug\", \"release\"],\n)\n```\n\n### Go Component (TinyGo 0.39.0+)\n\n```starlark\nload(\"@rules_wasm_component//go:defs.bzl\", \"go_wasm_component\")\n\ngo_wasm_component(\n    name = \"calculator\",\n    srcs = [\"main.go\"],\n    wit = \":calculator_wit\",\n    world = \"calculator\",\n)\n```\n\n### C++ Component (WASI SDK 27+)\n\n```starlark\nload(\"@rules_wasm_component//cpp:defs.bzl\", \"cpp_component\")\n\ncpp_component(\n    name = \"calculator\",\n    srcs = [\"calculator.cpp\"],\n    wit = \":calculator_wit\",\n    cxx_std = \"c++20\",\n)\n```\n\n### WAC Composition\n\n```starlark\nload(\"@rules_wasm_component//wac:defs.bzl\", \"wac_compose\")\n\nwac_compose(\n    name = \"full_system\",\n    components = {\n        \":frontend\": \"app:frontend\",\n        \":backend\": \"app:backend\",\n    },\n    composition = '''\n        let frontend = new app:frontend { ... };\n        let backend = new app:backend { ... };\n        connect frontend.request -\u003e backend.handler;\n        export frontend as main;\n    ''',\n)\n```\n\n## Features\n\n### Language Support\n- **Rust** (1.90.0+): Multi-profile builds, Clippy integration, Wizer pre-initialization\n- **Go** (TinyGo 0.39.0): Native WASI 0.2, hermetic Go module resolution\n- **C++** (WASI SDK 27): C++17/20/23, cross-package headers, LTO optimization\n- **JavaScript/TypeScript** (jco 1.4.0, Node.js 20.18.0): NPM dependencies, componentize-js\n\n### Production Features\n- **WAC Composition**: Official WebAssembly Composition standard for multi-component systems\n- **OCI Publishing**: Push components to Docker/OCI registries\n- **Cryptographic Signing**: wasmsign2 integration for supply chain security\n- **AOT Compilation**: Wasmtime precompilation for 87% size reduction and faster startup\n- **Wizer Pre-initialization**: 1.35-6x startup improvement for Rust components\n- **Multi-Profile Builds**: Debug, release, and custom optimization profiles\n\n### Developer Experience\n- **Hermetic Toolchains**: All tools downloaded automatically, no system dependencies\n- **Cross-Platform**: Native Windows/macOS/Linux support without WSL\n- **Comprehensive Examples**: 20+ working examples from basic to advanced patterns\n\n## Toolchain Versions\n\n**See [MODULE.bazel](MODULE.bazel) for current versions** — the single source of truth.\n\nAll toolchains are hermetically downloaded and version-pinned for reproducible builds.\n\n## Documentation\n\n**[Complete Rule Reference](docs/rules.md)** — All rules, attributes, and providers\n\n**Guides:**\n- [Toolchain Configuration](docs/toolchain_configuration.md)\n- [Multi-Profile Builds](docs/multi_profile.md)\n- [Development Guidelines](CLAUDE.md)\n\n**Examples:**\n- [Basic Component](examples/basic/)\n- [Multi-Language Composition](examples/multi_language_composition/)\n- [Wizer Pre-initialization](examples/wizer_example/)\n- [OCI Publishing](examples/oci_publishing/)\n- [See all examples](examples/)\n\n## Known Limitations\n\n### Go WIT Components (Temporary)\n- WIT-enabled Go components currently fail due to upstream TinyGo limitations\n- Tracking: [Issue #82](https://github.com/pulseengine/rules_wasm_component/issues/82)\n- Basic Go components (without WIT) work perfectly\n\n### C++ Exception Handling\n- WASI disables C++ exceptions by default for size/performance\n- Use `enable_exceptions = True` for components that require exceptions ([Issue #83](https://github.com/pulseengine/rules_wasm_component/issues/83))\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## License\n\nApache-2.0 \u0026mdash; see [LICENSE](LICENSE).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003csub\u003ePart of \u003ca href=\"https://github.com/pulseengine\"\u003ePulseEngine\u003c/a\u003e \u0026mdash; formally verified WebAssembly toolchain for safety-critical systems\u003c/sub\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_wasm_component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseengine%2Frules_wasm_component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_wasm_component/lists"}