wgpui_component_assets/lib.rs
1/// Embed application assets for GPUI Component.
2///
3/// This crate embeds Lucide SVGs for `wgpui-component`'s `IconName`.
4///
5/// ## Usage
6///
7/// ```rust,no_run
8/// use wgpui::*;
9/// use wgpui_component_assets::Assets;
10///
11/// let app = Application::new().with_assets(Assets);
12/// ```
13///
14/// ## Platform Differences
15///
16/// - **Native (Desktop)**: Icons are embedded in the binary using RustEmbed
17/// - **WASM (Web)**: Icons are downloaded from CDN using web_sys::Request
18/// - This significantly reduces WASM bundle size
19/// - Icons are downloaded on-demand when first used
20/// - Downloaded icons are cached in memory
21#[cfg(not(target_family = "wasm"))]
22mod native_assets;
23
24#[cfg(target_family = "wasm")]
25mod wasm_assets;
26
27#[cfg(not(target_family = "wasm"))]
28pub use native_assets::Assets;
29
30#[cfg(target_family = "wasm")]
31pub use wasm_assets::Assets;