rules_web
Bazel toolchain types and rules for W3C/WHATWG web-standards specs (webidl/html/css/js) — decoupled from impl modules.
| Latest | 0.0.1 |
|---|---|
| Versions | 1 |
| Category | Bazel rules |
| Maintainers | Matt Marshall |
| Registry | https://registry.tbzl.dev/modules/rules_web/ |
| Source | github.com/tomato-bazel/rules_web |
bazel_dep(name = "rules_web", version = "0.0.1")
View source & releases on GitHub ↗
Bazel toolchain types and rules for W3C / WHATWG web-standards specs — WebIDL, HTML, CSS, JS. Consumers depend on this module for the interface (rule names, toolchain types, providers); the implementation comes from a separate module that registers the toolchain.
Toolchain types
| Path | Toolchain type | Status | First implementation |
|---|---|---|---|
//web/webidl/... | webidl_toolchain_type | v0 | firefox_webidl_parser (WebIDL.py) |
//web/html/... | html_parser_toolchain_type | stub | (planned: firefox_html_parser) |
//web/css/... | css_toolchain_type | stub | (planned: firefox_css_specs) |
//web/js/... | js_engine_toolchain_type | stub | (planned: firefox_spidermonkey) |
Multiple implementations of the same toolchain type can coexist — Bazel’s
toolchain resolution picks whichever is registered. This mirrors how
rules_cc lets you swap between LLVM, Xcode clang, MSVC, etc., without
touching the consumer.
Consumer usage (WebIDL — v0 shape)
# MODULE.bazel
bazel_dep(name = "rules_web", version = "0.0.1")
bazel_dep(name = "firefox_webidl_parser", version = "0.0.1")
register_toolchains("@firefox_webidl_parser//:webidl_toolchain")
# BUILD.bazel
load("@rules_web//web/webidl:rules.bzl", "webidl_library", "webidl_parse")
webidl_library(
name = "html_details",
srcs = ["HTMLDetailsElement.webidl"],
)
webidl_parse(
name = "html_details_ast",
src = ":html_details",
)
webidl_parse invokes the registered parser toolchain via
ctx.actions.run. The output is a JSON AST consumable by downstream
codegen (the polyglot AST HTML emitter is the v0 consumer).
Why split rules from impl
- Consumers only pull in the narrowest closure (
rules_web+ the registered toolchain — not the whole Firefox source). - Implementations can be swapped without changing consumer BUILD files (Mozilla’s parser today, a Rust port tomorrow).
- The same pattern scales to html / css / js —
rules_webowns the vocabulary; implementations live elsewhere.
Status
v0 scaffold. WebIDL toolchain type + minimal webidl_library /
webidl_parse rules; html / css / js subdirs are stubs awaiting first
real consumer.
PRIVATE / NDA. Published in fastverk/bazel-registry-premium.
Conformance#
No gate findings. 8 contested atoms. See how gating works or the full report.
Contested atoms
Third-party modules where this module resolves a different version than others do. Not a violation of anything this module did — it is the actionable form of a registry-level convergence finding, and the sentence a maintainer can act on.
| Atom | Resolved here | Elsewhere |
|---|---|---|
apple_support | 1.24.2 | 2.2.0 ×1 |
bazel_skylib | 1.8.2 | 1.9.0 ×2 |
nlohmann_json | 3.6.1 | 3.12.0.bcr.1 ×1 |
protobuf | 33.4 | 34.0.bcr.1 ×2 |
rules_jvm_external | 6.7 | 6.8 ×4 |
rules_python | 1.7.0 | 2.0.1 ×1 |
rules_swift | 3.1.2 | 3.6.1 ×1 |
upb | 0.0.0-20220923-a547704 | 0.0.0-20230516-61a97ef ×1 |
Dependencies#
Depends on
Versions#
1 published version, newest first. Each resolves to an immutable, integrity-checked archive.
| Version | Integrity (sha256) | Source archive |
|---|---|---|
0.0.1 latest | UJlqPcfFhd58H81u… | tag archive ↗ |
Changelog#
0.0.1 (in progress)
- Initial scaffold.
web/webidl/v0 toolchain interface:webidl_toolchain_type,WebIDLToolchainInfoprovider,WebIDLInfoprovider for libraries, and the consumer-facingwebidl_library+webidl_parserules. web/html/,web/css/,web/js/subdirs stubbed with emptytoolchain_typeplaceholders so the structure is in place when the first concrete consumer arrives (likelyfirefox_html_parserfor the html toolchain).- Canonical WebIDL impl registered separately by
firefox_webidl_parser.