Option to split generated Rust into multiple modules/files for faster incremental builds
Bug Description
What: Slint’s Rust codegen emits a single, large generated file. For large UIs, even tiny .slint edits force rustc to re-parse/re-optimize the whole thing, making incremental builds slow. An opt‑in split mode would let rustc do less work per change.
Expected vs. actual: Expected incremental rebuilds after small UI edits to be relatively fast; actual: they recompile a massive monolithic generated module.
Reproducible Code (if applicable)
Any large .slint file that generates a big main_window.rs (e.g., https://gitlab.com/kevingatera/asusctl) will show the slowdown;
You can use cargo build -p rog-control-center
Environment Details
- Slint Version: 1.15
- Platform/OS: Linux (Wayland) - but issue is general
- Programming Language: Rust
Product Impact
Building desktop GUI apps; slow incremental builds are a productivity hit
The compilation time is indeed a problem.
One "solution" in development for faster incremental build, is to use the live preview feature: https://docs.rs/slint/latest/slint/docs/cargo_features/index.html#:~:text=live-preview
SLINT_LIVE_PREVIEW=1 cargo run --features slint/live-preview
Other than that, i don't know if splitting in different file would really help: the rust incremental compilation works on a function granularity, and also small changes in .slint file would probably regenerate all files.