Files
vectorcraft/apps/vectorcraft-web/src/main.rs
T
Brandon ThomasandClaude Opus 5.5 edccc14470 Never crash: UI and app shells (ui-egui, vectorcraft, vectorcraft-web, cli perf)
Removes the remaining production unwraps in the UI (fit view, save, macOS
shortcut labels, layers rows, swatch rows) and the CLI perf budget runner
(errors are reported instead of expect), and adds the deny attribute to
ui-egui, the desktop app and the web app.

vectorcraft-cli's main.rs is left without the attribute because an open
PR (#13) edits that file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 14:51:52 -04:00

29 lines
1.1 KiB
Rust

//! VectorCraft in the browser.
//!
//! Runs the same [`vectorcraft_ui_egui::VectorcraftApp`] as the desktop app through eframe's web
//! runner (wgpu: WebGPU where available, WebGL2 otherwise). Build with `trunk build --release`
//! from this directory; see `docs/development.md` ("Web build").
//!
//! Differences from the desktop app:
//! - no TCP control server (browsers can't listen on sockets);
//! - File → Open uses the browser file picker; bytes arrive asynchronously through
//! `Services::inbox`;
//! - Save / Export trigger a browser download;
//! - dropped files are read asynchronously by `web::WebShell` and delivered through the inbox.
//!
//! URL query flag: `?webgl` forces the WebGL2 backend instead of WebGPU.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
#[cfg(target_arch = "wasm32")]
mod web;
#[cfg(target_arch = "wasm32")]
fn main() {
web::start();
}
#[cfg(not(target_arch = "wasm32"))]
fn main() {
eprintln!("vectorcraft-web only runs in the browser: build it with `trunk build --release` in apps/vectorcraft-web");
}