indicatrix_web/lib.rs
1//! Browser build of `indicatrix`: upload a `GemCAD` `.asc` cutting schedule, get back an
2//! interactive rendered stone. No design library, no remote worker, no database -- see
3//! `README.md` for the full "what this deliberately omits and why" list.
4//!
5//! # Why almost everything here is `#[cfg(target_arch = "wasm32")]`
6//!
7//! This crate exists for exactly one target triple: acquiring a WebGPU device without
8//! blocking the browser's thread, driving a Slint UI through `wasm-bindgen`, reading an
9//! uploaded file through the DOM's File API. Rather than make every module decide
10//! whether it's meaningful on a native host, everything real lives under [`mod@app`],
11//! gated on `wasm32`, so a non-wasm32 build compiles to nothing.
12//!
13//! That matters because `cargo check --workspace` from a native host builds this crate
14//! too, alongside the real desktop/server products `apps/indicatrix-cut` and
15//! `apps/indicatrix-worker`; an empty native build keeps a browser demo from costing
16//! either of them a slower build or a compile error.
17
18#[cfg(target_arch = "wasm32")]
19mod app;
20#[cfg(target_arch = "wasm32")]
21mod render;
22#[cfg(target_arch = "wasm32")]
23mod scene;
24
25// `slint::include_modules!()` must run in a crate root (it expands to an `include!` of
26// build.rs's generated file, which uses `super`-relative paths). Kept here rather than
27// in `app.rs` so that file stays the one that actually drives the UI.
28#[cfg(target_arch = "wasm32")]
29slint::include_modules!();