tomato·bazeldocs v0 · latest
Docs/Reference/Modules/rules_web

rules_web

Bazel toolchain types and rules for W3C/WHATWG web-standards specs (webidl/html/css/js) — decoupled from impl modules.

Latest0.0.1
Versions1
CategoryBazel rules
MaintainersMatt Marshall
Registryhttps://registry.tbzl.dev/modules/rules_web/
Sourcegithub.com/tomato-bazel/rules_web
MODULE.bazelstarlark
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

PathToolchain typeStatusFirst implementation
//web/webidl/...webidl_toolchain_typev0firefox_webidl_parser (WebIDL.py)
//web/html/...html_parser_toolchain_typestub(planned: firefox_html_parser)
//web/css/...css_toolchain_typestub(planned: firefox_css_specs)
//web/js/...js_engine_toolchain_typestub(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_web owns 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.

AtomResolved hereElsewhere
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#

rules_web in the registry graph — what it depends on (left) and what depends on it (right).

Depends on

platforms1.0.0bazel_skylib1.8.2rules_python1.7.0

Versions#

1 published version, newest first. Each resolves to an immutable, integrity-checked archive.

VersionIntegrity (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, WebIDLToolchainInfo provider, WebIDLInfo provider for libraries, and the consumer-facing webidl_library + webidl_parse rules.
  • web/html/, web/css/, web/js/ subdirs stubbed with empty toolchain_type placeholders so the structure is in place when the first concrete consumer arrives (likely firefox_html_parser for the html toolchain).
  • Canonical WebIDL impl registered separately by firefox_webidl_parser.

← All modules