Skip to main content

ravenrs_platform_web/
lib.rs

1//! Browser backend for RavenRS.
2//!
3//! The UI is drawn by RavenRS into a `<canvas>` with WebGPU or WebGL2; the DOM is used only
4//! to host the canvas, receive input and mirror the UI for screen readers. Frames are scheduled with
5//! `requestAnimationFrame` only when something changed, so an idle page costs
6//! nothing. Nothing blocks the main thread: adapter and device creation are
7//! awaited, and no threads or `SharedArrayBuffer` are required.
8//!
9//! `WebBackend::Auto` uses WebGPU where the browser has it and WebGL2 otherwise;
10//! `WebOptions::backend` can ask for one of them. When none starts, `start`
11//! returns the error and shows a short explanation next to the canvas.
12//!
13//! This crate is empty on non-wasm targets.
14
15#![cfg(target_arch = "wasm32")]
16
17mod access;
18mod app;
19mod error;
20mod storage;
21
22pub use app::{WebApp, WebBackend, WebOptions, start};
23pub use error::WebError;
24pub use storage::IndexedDbStorage;