Freya 0.5
- marc2332hey
👋 Hey again, this is a summary of Freya v0.5, the next release of my Rust 🦀 GUI library. This blog post is more focused and compact, highlighting the most important changes.
This release has a strong focus on stability, refinement and documentation, with fixes and improvements across multi-window apps, async work, rendering, text editing and performance, alongside new guides and expanded API docs. But there are also some big additions, like experimental web support and HTML rendering powered by Blitz.
Freya in the browser (experimental)
The new freya-web backend runs Freya apps in the browser using WebAssembly (WASMM) and paints the UI to a canvas element. It uses the same component model, layout and rendering APIs as normal freya.
Try it below, or open the demo full-size.
Web support is experimental, and not every desktop integration works in the browser. See the web example for setup instructions.
HTML rendering
freya-html, powered by Blitz, replaces the experimental WRY-based freya-webview integration. HTML and CSS are now rendered inside Freya’s own rendering pipeline, without embedding a native browser surface.
It supports inline documents and URLs, navigation history, resource caching and form interactions. It does not run JavaScript and is not a full browser. Enable the html feature to use it.
See the HTML example for the app shown above.
Important changes
APIs
- Split
Platforminto application-wide operations andPlatformWindowfor individual windows. - Renamed
spawn_forevertospawn_in_windowfor tasks that live as long as their window, and addedspawn_globalfor tasks independent of any window.spawnremains tied to its component. - Added shared global contexts for state such as query storage and internationalization across windows, plus global effects.
LaunchConfig::with_global_contextandWindowConfig::with_root_contextprovide shared and per-window contexts explicitly. - Made
use_futurereactive. State read in its callback before the async block becomes a dependency, restarting the task when it changes. - Added
WritableSetterfor routing component edits through a callback that can transform or reject them. - Added query mocking and support for disabling queries with
Nonekeys infreya-query. Fixed cache-clearing races and borrows held across async work.
Performance
- Improved element diffing.
- Added mouse-move event coalescing and optimized event processing in Ragnarok.
- Reduced idle work, cached clip areas, removed unnecessary opacity layers and made layout scaling incremental.
- Reworked the
freya-metrics-pluginoverlay with async task metrics and window dimensions. Expanded layout, reconciliation and painting benchmarks.
Rendering
- Added software-only builds and renderer preferences. Improved backend selection and fallback, including Linux Wayland systems with multiple GPUs.
- Shared the Vulkan context between windows and added manual frame throttling for software rendering across platforms.
- Replaced the separate
canvas()element withRenderCallbackfills. Callbacks can paint backgrounds and customize text paint through the same API. - Added runtime font loading, font features and letter spacing. Improved variable-font weights and platform-specific text gamma and contrast.
- Added image blur, image snapping, per-element cursor styling and custom animation easing functions.
Components
- Added smooth scrolling, touch dragging and better Linux touchpad scrolling. Scrollbars can be customized or kept visible, and virtualized lists support per-item sizes.
- Added multiline inputs and improved wrapped-line navigation, whole-word selection dragging, Home/End and Ctrl+Backspace/Delete handling. Fixed cursor placement and scrolling during text selection.
- Made tables, tooltips, calendars and resizable panels more customizable. Added adaptive popup sizing and slider steps.
- Added code editor options for read-only mode, gutters, whitespace markers, line height, cursor mode and external scroll controllers in
freya-code-editor. - Added
Lazyfor mounting content when it becomes visible, and anon_visibleevent for custom visibility handling. - Moved
freya-terminaltorio-vtand added custom terminal backends. Improved focus reporting and font fallback.
Internals
- Fixed reconciliation of keyed components and mixed insertions and reordering.
- Improved AccessKit action handling, text announcements, initial focus and pointer handling.
- Extracted
tiny-diff,tiny-notifyandtiny-cache. Addedno_stdsupport to Torin, Pathgraph and Ragnarok. - Dropped the GTK and libxdo dependencies from tray support.
Browse the full changes or the examples for more details.
Documentation
The docs have also grown, with new guides and clearer explanations of existing APIs:
- Added Building your first app, a step-by-step todo app tutorial covering state, reusable components, filtering and testing with
freya-testing. - Added an optimization guide covering feature selection, renderer preferences, GPU cache limits, metrics and image viewers.
- Added guides for fonts, including embedding and runtime loading, and borderless windows.
- Improved the UI and components guide, clarified extending components with builder traits, and expanded the layout docs for flex sizing and
Size::Fill. - Expanded the events guide with propagation, default behavior, ordering, global events, multi-press combos and exposing events from components.
- Improved docs for contexts and global contexts, async task lifetimes,
Effect,PlatformandAnimationClock. - Expanded the router docs, reorganized the radio state-management docs, and documented custom elements.
- Added Working with AI, linking to llms.txt and an installable Freya skill for coding assistants. Updated the development setup, platform and web example instructions, and reorganized the contributing guide’s crate list.
Sanctum
I’ve also been working on Sanctum, my Linux desktop environment written in Rust, which I’ve been daily driving for around six months.
All its UI is built with Freya, from the settings app, file explorer, system monitor and image viewer to the dock, control panel, notifications and app switcher. It also has its own Wayland compositor.
It’s still a personal project and not open source yet. You can find more screenshots and a video in my Sanctum post.
Thanks
Thank you to everyone who contributed code, reported bugs or tried the prereleases :)
Thanks as well to my sponsors piny4man, 高庆丰, Huddy Buddy, Gabriel Jõe, Mark, Fractura and Senary Domain for supporting Freya’s development.
If you want to support Freya’s development, you can sponsor me on GitHub.