crates/nornir-viz-web/Cargo.toml
[package]
name = "nornir-viz-web"
description = "nornir's viz as a wasm32 website — the wasm-capable facett Facets nornir embeds (jobview/metro/graph3d/helix/warehousedeck/docview), rendered through eframe wgpu/WebGPU, plus a `serve` path that hosts the built bundle over axum."
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
publish = false
[lib]
name = "nornir_viz_web"
path = "src/lib.rs"
[[bin]]
name = "nornir-viz-web"
path = "src/main.rs"
[dependencies]
# egui 0.34 — the same stack nornir + facett pin (Facet's `ui(&mut egui::Ui)`).
egui = "0.36"
serde_json = "1"
log = "0.4"
# The reusable, wasm-capable facett Facets nornir's native viz embeds. Same paths
# nornir's own Cargo.toml uses (sibling `../facett`), one level deeper from here.
facett-core = { version = "0.3.0", path = "../../../facett/facett-core" }
facett-jobview = { version = "0.2", path = "../../../facett/facett-jobview" }
facett-graphview = { version = "0.2", path = "../../../facett/facett-graphview" }
facett-graph3d = { version = "0.2", path = "../../../facett/facett-graph3d" }
facett-helix = { version = "0.2", path = "../../../facett/facett-helix" }
facett-warehousedeck = { version = "0.2", path = "../../../facett/facett-warehousedeck" }
facett-docview = { version = "0.2", path = "../../../facett/facett-docview" }
# ── wasm-only: eframe on wgpu/WebGPU (no winit platform backend) + browser glue ──
#
# LAW #4 — WebGPU everywhere, no WebGL. THIS is the line the law is really about: on
# wasm32, eframe's `glow` feature means **WebGL2**, the literal thing GFX_V2's Decision 0
# dropped. It is now `wgpu`, and on wasm32 eframe pulls wgpu 29 with
# `default-features = false, features = ["std"]` — no `webgl` feature — so wgpu there is
# the **WebGPU** browser backend, not WebGL2 wearing a wgpu API.
#
# The trade is real and worth stating: WebGL2 runs essentially everywhere, WebGPU needs
# Chrome/Edge 113+, Firefox 141+ or Safari 18+. Decision 0 accepted that; a browser
# without WebGPU now gets eframe's canvas failure path rather than a silent WebGL
# fallback, which is the point — no silent fallbacks.
[target.'cfg(target_arch = "wasm32")'.dependencies]
eframe = { version = "0.36", default-features = false, features = ["default_fonts", "wgpu"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
console_error_panic_hook = "0.1"
web-sys = { version = "0.3", features = ["Window", "Document", "HtmlCanvasElement", "Element", "Location"] }
# ── native-only: eframe with the winit platform backends (wayland/x11) so the dev
# window links, + the `serve` path (axum static server), opt-in ───────────────
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
eframe = { version = "0.36", default-features = false, features = ["default_fonts", "wgpu", "wayland", "x11", "accesskit"] }
axum = { version = "0.8", optional = true }
tokio = { version = "1", features = ["rt", "net", "macros"], optional = true }
tower-http = { version = "0.7", features = ["fs"], optional = true }
[features]
# Enable the `serve` subcommand (axum + tower-http ServeDir). Off by default so a
# plain `cargo build` / the wasm build pull no server stack.
serve = ["dep:axum", "dep:tokio", "dep:tower-http"]