Releases: DioxusLabs/dioxus
Dioxus v0.7.0-alpha.1
Fixes, blitz update, and subsecond custom linker setup
This release fixes a number of issues found in Dioxus v0.7.0-alpha.0.
A few updates include
- better support for custom linkers with the subsecond hotpatching engine
- updating to blitz 0.1-alpha.1 which fixes bugs, performance, and adds more CSS compatibility
- arm64 linux binstall builds
- component library demo site (http://dioxuslabs.github.io/components/)
- fix wasm-opt with rust 1.87
- fix vcs in dx new
- add support for dylib/so/dll bundling
- fix tls binding across hotpatch boundaries
- fix lld/mold flags with subsecond
- hash assets outside the asset!() macro, instead during
dx build
Random updates
- The bevy team has started a PR integrating subsecond with bevy itself bevyengine/bevy#19309
- There's now a 3rd party bevy-subsecond integration https://github.com/TheBevyFlock/bevy_simple_subsecond_system
- The new blitz is much faster and has better CSS support!
TODOs before final release
Dioxus v0.7.0-alpha.0
Note
These release notes are a draft for the full release and thus are incomplete. Not all features might be merged yet!
We are releasing v0.7.0-alpha.0 with many docs and features incomplete, please be patient while we fill everything out.
Hot-patching, Native, Bundle Splitting, Radix-UI, more!
Welcome back to another Dioxus release! If you’re new here, Dioxus (dye • ox • us) is a framework for building cross-platform apps in Rust. We make it easy to ship fullstack web, desktop, and mobile apps with a single codebase.
Dioxus 0.7 delivers on a number of promises we made to expand the capabilities of Rust GUI. Mature frameworks like Flutter and React Native sport capable hot-reload systems, popular component frameworks, and render natively. Now, Dioxus is on par with the “state of the art”, and in many ways, is even better.
In this release, we’re shipping some incredible features. The highlights of this release include:
- Dioxus Native: WGPU-based HTML/CSS Dioxus renderer built on Firefox’s Gecko engine
- Subsecond: Hot-patching of Rust code at runtime
- WASM-Split: Code splitting and tree shaking for WebAssembly
- Dioxus-UI: Shadcn-UI implementation for Dioxus
Dioxus 0.7 also brings a number of other exciting new features:
- Automatic tailwind: zero-setup tailwind support built-in!
- LLMs.txt: first-party context file to supercharge AI coding models
- MCP Server: add context, resources, and tools to VSCode, Cursor, and Claude
- Blitz: our modular HTML/CSS renderer powering Dioxus Native, available for everyone!
- Dioxus Playground: online WASM/WASI playground with integrated hot-patching
- Fullstack WebSockets: websockets in a single line of code
- Integrated Debugger Support: open CodeLLDB or nvim DAP with a single keystroke
- Fullstack status codes: Integration of status codes and custom errors in fullstack
- Configurable Mobile Builds: Customize your AndroidManifest and Info.plist
Plus, a number of quality-of-life upgrades:
- one-line installer (
curl -sSL http://dioxus.dev/install.sh | sh
) dx self-update
and update notifications- automatically open simulators
dx
compatibility with non-dioxus projects- Better log coloring
- desktop and mobile toasts
- improved website landing page and migration to http://dioxus.dev hostname
- Reduced flicker on CSS hot-reloads
- HTML streaming now waits for the router to render
- Axum 0.8 upgrade
And many, many bugs fixed:
- Issues with synchronous multi-window
- Tab focusing
- Hot-reloaded assets not being re-processed
Note from the author
Dioxus 0.7 marks the second anniversary of me (Jonathan Kelley) going full time on Dioxus. How time flies! In the past two years we shipped so much:
- Template Hot-Reloading and Autoformatting
- Migration to Signals
- First-party Android and iOS tooling
- Server Function integration
- Linker-based asset system
- and so much more!
The road here has been long and frankly, lots of work. When we started out, the Rust ecosystem had very few good solutions to the basic problems in application development. Even now, the Rust hotpatching and native renderers - while incredible achievements on their own - are just “par for the course” for application development.
With Dioxus 0.7, I feel like the Dioxus foundations are finally solid. We have excellent developer tools, lightning-fast hotpatching, a great asset system, a solid RPC solution, bundle splitting, automatic optimizations, autocomplete, autoformatting, a capable state management solution, comprehensive docs, and funding for the foreseeable future. It’s always nice to see that decisions to adopt industry-standard tech pay-off (Rust GUIs in 2025 article).
What of the future? I finally feel like we’re on the “other side” of the once-impossible problems. With hot-patching and the native renderer behind us, we’re quite free to work on smaller projects. We could definitely use better marketing, more tutorial videos, better starter templates, and ecosystem growth (native APIs in 0.8!). Thanks for all the support so far!
Rust Hot-patching
The biggest feature of this release: Dioxus now supports hot-patching of Rust code at runtime! You can now iterate on your app’s frontend and backend simultaneously without skipping a beat.
We’ve been working on this feature for almost an entire year, so this is a very special release for us. The tool powering this hot-patching is called Subsecond and works across all major platforms: Web (WASM), Desktop (macOS, Linux, Windows), and even mobile (iOS, Android):
ios-binarypatch.mp4
hotpatch-android.mp4
Subsecond works in tandem with the Dioxus CLI to enable hot-patching for any Rust project. Simply run dx serve
on your project and all subsecond::call
sites will be hot-patched. For example, here’s Subsecond working with a Ratatui app:
subsecond-tui.mp4
The infrastructure to support Subsecond is quite complex; consequently, we plan to only ship the Subsecond engine within the Dioxus CLI itself. However, we still want the ecosystem to experience the magic of Subsecond, so we’ve done two things:
- Make
dx
a standalone runner, not tied to Dioxus - Integrated hotpatching with our new Dioxus Playground
Hot-patching Rust code is no simple feat. To achieve a segfault-free experience, we recommend framework authors to tie into Subsecond’s minimal runtime. For application developers, you can simply use subsecond::call(some_fn)
at clean integration points to take advantage of hot-patching. If you use Dioxus, hot-patching comes directly integrated with components and server functions.
pub fn launch() {
loop {
std::thread::sleep(std::time::Duration::from_secs(1));
subsecond::call(|| tick());
}
}
fn tick() {
println!("edit me to see the loop in action!!!!!!!!! ");
}
While in theory we could implicitly override calls to tick
with function detouring, we instead chose explicit integration points. Hot-patching encounters a significant challenge with changes to struct layout and alignment, and implicit patching exacerbates these safety issues. Explicit integration provides an opportunity frameworks to “re-instance” changed structs and guarantees a segfault-free experience at the cost of losing some runtime state.
We expect folks to use Subsecond outside of Dioxus, namely in web development, so we’ve provided a few starter-integrations for popular libraries:
- Axum
- Bevy
- Ratatui
Hot-patching covers nearly every case in Dioxus - there’s so much you can hot-reload:
Under the hood, we implemented a form of incremental linking / binary patching tailored for running apps. This is not too distant from the idea laid out by Andrew Kelley for Zig. We have yet to release an in-depth technical writeup about how Subsecond works, but if you’re really interested, come join us at the Seattle RustConf and learn about it during our talk!
Dioxus Native
WASM Bundle Splitting and Lazy Loading
bundle-split.mp4
Component Library: Radix Primitives and ShadCN-UI
LLMs.txt, Cursor Rules, MCP Server, and Vibe-Coding
vibe-code-2.mp4
Automatic Tailwind
dx
now detects atailwind.css
file in the root of your crate- customize the input and output files in your dioxus.toml
- Automatically downloads the tailwind binary in the background
tailwind-inline.mp4
Blitz 0.1
We’re extremely excited to release Blitz: our modular HTML/CSS rendering engine.
Blitz combines a number of exciting projects to bring customizable HTML rendering engine to everyone. Blitz is a result of collaboration across many projects: Firefox, Google, Servo, and Bevy. We’re leveraging a number of powerful libraries:
- Taffy: our high-performance flexbox layout engine
- Stylo: Firefox and Servo’s shared CSS resolution engine
- Vello: Google’s GPU compute renderer
Blitz is an extremely capable renderer, often producing results indistinguishable from browsers like Chrome and Safari:
Not every CSS feature is supported yet, with some bugs like incorrect writing direction or the occasional layout quirk. Our support matrix is here: https://blitz-website.fly.dev/support-matrix
The samples that Blitz can create are quite incredible. Servo’s website:
The BBC:

Do note that Blitz is still very young and doesn’t always produce the best outputs, especially on pages that require JavaScript to function properly or use less-popular CSS features:
Blitz also provides a pluggable layer for interactivity, supporting actions like text inputs, pluggable widgets, form submissions, hover styling, and more. Here’s Dioxus-Motion working alongside our interactivity layer to provide high quality animations:
Bear in mind that Blitz is still considered a “work in progress.” We have not focused on performance
Integrated Debugger
To date, debugging Rust apps with VSCode hasn’t been particularly easy. Each combination of launch targets, flags, and arguments required a new entry ...
Dioxus v0.6.3
This release fixes a number of bugs and cleans up the internal implementations of a few APIs.
Notably
- Fixes in
dx
html -> rsx translation - Fixes for bundling .exe on windows
- Proper handling of gitignored manganis assets
- Support for android device hot-reloading over
adb
- Fixes to template partialeq that enable view transitions in the router
To upgrade:
- run
cargo update
- install the new CLI with
cargo binstall dioxus-cli --force
What's Changed
- Make the file engine feature in the html crate a no-op by @ealmloff in #3392
- Fix event closure invoked recursively by @ealmloff in #3405
- Don't panic if the duration is negative in try_get_or_insert by @ealmloff in #3413
- fix copy assets progress by moving fetch_add out of trace!(). by @liigo in #3385
- Assume the virtual dom is not rendering while not diffing components by @ealmloff in #3406
- Fix path to image in README.md by @flba-eb in #3443
- Return None in autodetect_on_cargo_feature on other platforms by @rhaskia in #3445
- Keep rebuilding toast alive longer by @liigo in #3455
- Make
Routable
derive macro hygienic by @MrGVSV in #3437 - Fixed asset path resolver to use the second segment instead of first. by @sjud in #3472
- fix: pin cargo-msrv to older version by @jkelleyrtp in #3486
- remove version pin on tao by @sehnryr in #3485
- the main exe to be bundled should have '.exe' extension on windows by @liigo in #3482
- Use a better default browser list and fail gracefully when css parsing fails by @ealmloff in #3509
- Add Persian Translation by @Mehrbod2002 in #3387
- Fix the event handler memory leak by @ealmloff in #3508
- fix(cli): Log errors when
adb
command fails by @Plebshot in #3493 - fix: bump futures-channel to prevent locked versions from conflicting by @jkelleyrtp in #3510
- Fix compiler error in examples/fullstack-auth by @ywiyogo in #3359
- Dioxus Playground Hot Reload Support by @DogeDark in #3098
- Get server address from cli in fullstack-auth example. by @charles-r-earp in #3494
- fix(cli): get ip addr & port number from config by @wiseaidev in #3369
- feat: Reexport the
Warning
trait in dioxus-signals by @marc2332 in #3321 - feat: document and re-export dioxus-cli-config by @jkelleyrtp in #3515
- Fix Routable::parent with hash segments and query params by @ealmloff in #3484
- Fix hydration of suspense fragments that contain text nodes by @ealmloff in #3287
- Fix mounted event after initial hydration by @ealmloff in #3480
- Improve error message when dx is called on a virtual or library package by @ealmloff in #3505
- Fix dx bundle fails when no assets are copied by @BleemIs42 in #3519
- fix: Handle unicode in webview events. by @tdomhan in #3386
- fix: add additional lock when calling wait_for_work on android by @jkelleyrtp in #3524
- Fix the test_stream function running after the stream is closed by @ealmloff in #3396
- Fix: Asset Cache On Windows & Asset Status by @DogeDark in #3525
- fix: viewBox translation by not accidentally stringifying literals by @jkelleyrtp in #3527
- Fix ssg race condition by @ealmloff in #3521
- Fix opening fullstack and server crash logging in the CLI by @ealmloff in #3488
- Remove empty doctor command by @ealmloff in #3536
- Fix pointer provenance in const serialize with zero sized type enum variants by @ealmloff in #3532
- Fix: Enable
keep_fn_names
In SWC Mangling by @DogeDark in #3539 - docs: demonstrate extending both global and element attributes by @Plebshot in #3555
- fix: cli package name search by @Anakael in #3561
- Fixed the multiple window closing issue, where the two multiwindow examples weren't working. by @sertschgi in #3499
- Add server context to suspense resolution by @Houndie in #3552
- Fix rsx expression autocomplete by @ealmloff in #3568
- fix: don't accidentally generate .d.ts files with wasm-bindgen by @jkelleyrtp in #3577
- Fix outdir not work when run dx bundle --platform web --outdir mydir by @BleemIs42 in #3572
- feat(cli): add feature to disable downloads by @CathalMullan in #3465
- Fix repeated subscription to dropped scope leak by @ealmloff in #3569
- fix: window state preservation by soft-killing the process by @jkelleyrtp in #3579
- Fix: Only Resize WebView Associated With Window by @CryZe in #3584
- Simplify fullstack auth example by @ealmloff in #3598
- Fix fullstack hackernews example instructions by @ealmloff in #3597
- feat: device hot-reload, tools-relative adb, auto port bind by @jkelleyrtp in #3586
- fix: don't gitignore manganis assets during hot-reload by @jkelleyrtp in #3606
- fix: don't send hot-reload if app is building by @jkelleyrtp in #3607
- feat: android bundling, red/blue exe names, session cache by @jkelleyrtp in #3608
- Fix:
always-on-top
setting by @DogeDark in #3347 - fix: dont unwrap as much in desktop by @jkelleyrtp in #3609
- Fix hot reload diffing to empty rsx by @ealmloff in #3567
- Remove the todo list from the examples readme by @ealmloff in #3613
- docs: update translations/ja-jp/README.md by @eltociear in #3615
- fix: too much padding for small frames by @jkelleyrtp in #3616
- fix: don't have Rc cycles in DioxusElement or Queries by @jkelleyrtp in #3618
- Optimize wasm bindgen asset with manganis by @ealmloff in #3531
- fix: use a different temp path to not confuse image opt by @jkelleyrtp in #3620
- CryptoProvider error. by @vgobbo in #3619
- fix: pass off env vars to android apps by @jkelleyrtp in #3621
- Use the launch builder instead of web launch in the fullstack auth example by @ealmloff in #3640
- Fix web eval return by @ealmloff in #3656
- Ignore write while rendering warning in memo lazy recompute by @ealmloff in #3647
- Fix the pwa example by @ealmloff in #3664
- fix: Downgrade publish ci to ubuntu 22.04 by @marc2332 in #3663
- fix: don't emit hash fragment for internal links if hash is empty by @jkelleyrtp in #3660
- remove html! macro mentioning by @jonaspleyer in #3654
- feat: Allow using
NavigationTarget
outside router by @marc2332 in #3633 - Allow to connect to the dev server from a physical Android device by @Andrew15-5 in #3634
- Fix additional attributes for js renderers by @ealmloff in #3625
- Add examples for LaunchBuilder methods by @vishwamartur in #3629
- Remove the stylesheet component by @ealmloff in #3176
- feat(examples): add Context API state management example by @Danish903 in #3657
- Fix serving desktop+fullstack apps that have not set a server url by @ealmloff in #3701
- fix onload and onerror parsing error by @sehnryr in #3707
- use main exe name without extension for bundler on window...
Dioxus v0.6.2
Dioxus 0.6.2: Bug fixes and quality-of-life features
This patch release fixes a number of issues during the 1st month of Dioxus 0.6 release.
Make sure you update your dioxus-cli!
cargo binstall dioxus-cli --version 0.6.2 --force
Also make sure to run cargo update to take advantage of the fixes in your app itself.
What's new?
Features:
- iPadOS support for
dx serve
- Cache-busting for .wasm files
- Serving on 0.0.0.0 for device hot-reload support
- out_dir support for
dx bundle
- per-app session cache for storing temp values during
dx serve
- Cuter
dx serve
extra info panel
Notable Fixes:
- Hashing of executables in
dx serve
- Fix using
o
to open files - Fix expression autocompelte in rsx!
- Fix some issues with minification dropping function names and classes
- Use your android sdk's
adb
- Fix some
dx translate
class translation issues - Fix a number of issues with
dx bundle
What's Changed
- Make the file engine feature in the html crate a no-op by @ealmloff in #3392
- Fix event closure invoked recursively by @ealmloff in #3405
- Don't panic if the duration is negative in try_get_or_insert by @ealmloff in #3413
- fix copy assets progress by moving fetch_add out of trace!(). by @liigo in #3385
- Assume the virtual dom is not rendering while not diffing components by @ealmloff in #3406
- Fix path to image in README.md by @flba-eb in #3443
- Return None in autodetect_on_cargo_feature on other platforms by @rhaskia in #3445
- Keep rebuilding toast alive longer by @liigo in #3455
- Make
Routable
derive macro hygienic by @MrGVSV in #3437 - Fixed asset path resolver to use the second segment instead of first. by @sjud in #3472
- fix: pin cargo-msrv to older version by @jkelleyrtp in #3486
- remove version pin on tao by @sehnryr in #3485
- the main exe to be bundled should have '.exe' extension on windows by @liigo in #3482
- Use a better default browser list and fail gracefully when css parsing fails by @ealmloff in #3509
- Add Persian Translation by @Mehrbod2002 in #3387
- Fix the event handler memory leak by @ealmloff in #3508
- fix(cli): Log errors when
adb
command fails by @Plebshot in #3493 - fix: bump futures-channel to prevent locked versions from conflicting by @jkelleyrtp in #3510
- Fix compiler error in examples/fullstack-auth by @ywiyogo in #3359
- Dioxus Playground Hot Reload Support by @DogeDark in #3098
- Get server address from cli in fullstack-auth example. by @charles-r-earp in #3494
- fix(cli): get ip addr & port number from config by @wiseaidev in #3369
- feat: Reexport the
Warning
trait in dioxus-signals by @marc2332 in #3321 - feat: document and re-export dioxus-cli-config by @jkelleyrtp in #3515
- Fix Routable::parent with hash segments and query params by @ealmloff in #3484
- Fix hydration of suspense fragments that contain text nodes by @ealmloff in #3287
- Fix mounted event after initial hydration by @ealmloff in #3480
- Improve error message when dx is called on a virtual or library package by @ealmloff in #3505
- Fix dx bundle fails when no assets are copied by @BleemIs42 in #3519
- fix: Handle unicode in webview events. by @tdomhan in #3386
- fix: add additional lock when calling wait_for_work on android by @jkelleyrtp in #3524
- Fix the test_stream function running after the stream is closed by @ealmloff in #3396
- Fix: Asset Cache On Windows & Asset Status by @DogeDark in #3525
- fix: viewBox translation by not accidentally stringifying literals by @jkelleyrtp in #3527
- Fix ssg race condition by @ealmloff in #3521
- Fix opening fullstack and server crash logging in the CLI by @ealmloff in #3488
- Remove empty doctor command by @ealmloff in #3536
- Fix pointer provenance in const serialize with zero sized type enum variants by @ealmloff in #3532
- Fix: Enable
keep_fn_names
In SWC Mangling by @DogeDark in #3539 - docs: demonstrate extending both global and element attributes by @Plebshot in #3555
- fix: cli package name search by @Anakael in #3561
- Fixed the multiple window closing issue, where the two multiwindow examples weren't working. by @sertschgi in #3499
- Add server context to suspense resolution by @Houndie in #3552
- Fix rsx expression autocomplete by @ealmloff in #3568
- fix: don't accidentally generate .d.ts files with wasm-bindgen by @jkelleyrtp in #3577
- Fix outdir not work when run dx bundle --platform web --outdir mydir by @BleemIs42 in #3572
- feat(cli): add feature to disable downloads by @CathalMullan in #3465
- Fix repeated subscription to dropped scope leak by @ealmloff in #3569
- fix: window state preservation by soft-killing the process by @jkelleyrtp in #3579
- Fix: Only Resize WebView Associated With Window by @CryZe in #3584
- Simplify fullstack auth example by @ealmloff in #3598
- Fix fullstack hackernews example instructions by @ealmloff in #3597
- feat: device hot-reload, tools-relative adb, auto port bind by @jkelleyrtp in #3586
- fix: don't gitignore manganis assets during hot-reload by @jkelleyrtp in #3606
- fix: don't send hot-reload if app is building by @jkelleyrtp in #3607
- feat: android bundling, red/blue exe names, session cache by @jkelleyrtp in #3608
- Fix:
always-on-top
setting by @DogeDark in #3347 - fix: dont unwrap as much in desktop by @jkelleyrtp in #3609
- Fix hot reload diffing to empty rsx by @ealmloff in #3567
- Remove the todo list from the examples readme by @ealmloff in #3613
- docs: update translations/ja-jp/README.md by @eltociear in #3615
- fix: too much padding for small frames by @jkelleyrtp in #3616
- fix: don't have Rc cycles in DioxusElement or Queries by @jkelleyrtp in #3618
- Optimize wasm bindgen asset with manganis by @ealmloff in #3531
- fix: use a different temp path to not confuse image opt by @jkelleyrtp in #3620
- CryptoProvider error. by @vgobbo in #3619
- fix: pass off env vars to android apps by @jkelleyrtp in #3621
New Contributors
- @liigo made their first contribution in #3385
- @flba-eb made their first contribution in #3443
- @rhaskia made their first contribution in #3445
- @sjud made their first contribution in #3472
- @sehnryr made their first contribution in #3485
- @Mehrbod2002 made their first contribution in #3387
- @Plebshot made their first contribution in #3493
- @ywiyogo made their first contribution in #3359
- @charles-r-earp made their first contribution in #3494
- @wiseaidev made their first contribution in #3369
- @tdomhan made their first contribution in #3386
- @Anakael made their first contribution in #3561
- @sertschgi made their first contribution in #3499
- @Houndie made their first contribution in...
Dioxus v0.6.1
Dioxus 0.6.1: Bug fixes
This patch release fixes a number of issues during the 1st week of Dioxus 0.6 release.
Make sure you update your dioxus-cli
!
cargo binstall dioxus-cli --version 0.6.1 --force
Also make sure to run cargo update
to take advantage of the fixes in your app itself.
A list of the fixes
- The CLI now installs the proper wasm-bindgen version dynamically instead of requiring a new download of dx
- Our asset hot-reload is more resilient on web, fixing an issue where we accidentally broke some query parameters
- Windows asset canonicalization is fixed (unc paths!) with manganis, fixing asset hot-reload
- Our docs.rs build was failing due to our platform support list being wrong, this is fixed now
- Android asset hot-reloading has been fixed/improved. The old version relied on the emulator being launched with su while the new one uses the /tmp directory to store hot-reloaded assets.
- Occasionally toasts would be triggered but not inside the Dioxus runtime, leading to some panics
- The "starting rebuild" toast wasn't being sent in some cases, this is fixed.
- Sometimes the CLI would swallow
cargo
logs - this is fixed - The CLI now suggest to toggle trace mode for more information
- The CLI now suggests to run the tailwind CLI if your project uses tailwind
- Occasionally links in liveview would cause a full reload, this is fixed
- We fixed a frame clipping issue with the CLI inline viewport
- onmounted no longer fires multiple times
What's Changed
- Fix hot reloading stylesheets with an existing query parameter by @ealmloff in #3315
- Fix enable_out_of_order_streaming doc example and manganis macro remote example by @ealmloff in #3317
- Fix: Windows Manganis Asset Hot Reload by @DogeDark in #3330
- fix: drop target list to make docsrs build happy by @jkelleyrtp in #3329
- feat: android asset hotreloading by @jkelleyrtp in #3332
- Always run toast eval inside the runtime by @ealmloff in #3313
- fix: toasts not being sent on rebuild by @jkelleyrtp in #3333
- fix: print
error:
messages and their contents from cargo by @jkelleyrtp in #3336 - Fix client side liveview links by @ealmloff in #3341
- Feat: CLI
wasm-bindgen-cli
Installer by @DogeDark in #3335 - Fix: unwraps while ignoring log lines by @jkelleyrtp in #3370
- fix space remaining mis calc in cli frame causing tears by @jkelleyrtp in #3371
- Fix space remaining (again) by @jkelleyrtp in #3377
- fix: throw error when asset is empty by @jkelleyrtp in #3379
- add helpful message for obscure cargo failures by @jkelleyrtp in #3380
- fix peek() example by @spookyvision in #3375
- Revision: Add more info to template creation message. by @DogeDark in #3320
- Fix onmounted event triggering many times by @ealmloff in #3346
- Improve the second example in the read write same scope warning by @ealmloff in #3374
- Add a guide for releasing Dioxus by @jkelleyrtp in #3384
Full Changelog: v0.6.0...v0.6.1
Dioxus 0.6
Dioxus 0.6
Dioxus is a framework for building fullstack web, desktop, and mobile apps with a single codebase. Our goal is to build a "Flutter but better." Dioxus focuses on first-class fullstack web support, type-safe server/client communication, and blazing fast performance.
With this release, we focused on making Dioxus easier to use, improving the developer experience, and fixing bugs.
Headlining the release is a complete overhaul of the Dioxus CLI:
- dx serve for mobile: Serve your app on Android and iOS simulators and devices.
- Magical Hot-Reloading: Hot-Reloading of formatted strings, properties, and nested rsx!{}.
- Interactive CLI: Rewrite of the Dioxus CLI with a new, interactive UX inspired by Astro.
- Inline Stack Traces: Capture WASM panics and logs directly into your terminal.
- Server Functions for Native: Inline Server RPC for Desktop and Mobile apps.
We also improved the developer experience across the entire framework, fixing long standing bugs and improving tooling:
- Toasts and Loading Screens: New toasts and loading screens for web apps in development.
- Improved Autocomplete: Massively improved autocomplete of RSX.
- asset! Stabilization: Stabilizing our linker-based asset system integrated for native apps.
- Streaming HTML: Stream Suspense and Error Boundaries from the server to the client.
- SSG and ISG: Support for Static Site Generation and Incremental Static Regeneration.
- Error Handling with ?: Use ? to handle errors in event handlers, tasks, and components.
- Meta Elements: New Head, Title, Meta, and Link elements for setting document attributes.
- Synchronous prevent_default: Handle events synchronously across all platforms.
- onresize Event Handler: Track an element's size without an IntersectionObserver.
- onvisible Event Handler: Track an element's visibility without an IntersectionObserver.
- WGPU Integration: Render Dioxus as an overlay on top of WGPU surfaces and child windows.
- dx bundle for Web, iOS, and Android: Complete dx bundle support for every platform.
- json mode: Emit CLI messages as JSON for use by 3rd party tools and CI/CD pipelines.
- New Templates: Three new starter templates for cross-platform apps.
- Nightly Tutorial and Guides: New tutorials and guides for Dioxus 0.6 and beyond.
- Binary Patching Prototype: Prototype of our new pure Rust hot-reloading engine.
Interactive Command Line Tools
Dioxus 0.6 is shipping with a completely overhauled CLI experience! We’ve completely rewritten the CLI to support a ton of new features and improve stability:
The new CLI sports live progress bars, animations, an interactive filter system, the ability to change log levels on the fly, and more.
cli-new-a4f046c37f262d83.mp4
The CLI rewrite alone took more than half this release cycle. We went through several different design iterations and solved tons of bugs along the way. A few of the highlights:
- You can manually rebuild your app by pressing
r
- You can toggle the log level of the CLI output on the fly and even inspect Cargo internal logs
- We output all internal logs of the CLI so you can debug any issues
- We capture logs for WASM tracing and panics
- We dropped the outdir concept and instead use target/dx for all output.
Inline support for iOS and Android emulators.
Android and iOS support for dx serve
With Dioxus 0.6, the dioxus CLI supports dx serve --platform ios/android out of the box! 🎉
While Dioxus has always had mobile, the Rust tooling for mobile has been extremely unstable. Users constantly ran into issues with tools like cargo-mobile and cargo-mobile2. These tools, while useful, take a different architectural approach than what is a good fit for Dioxus.
With this release, we wrote our entire mobile tooling system from scratch. Now, you can go from dx new to dx serve --platform ios in a matter of seconds.
The Android and iOS simulator targets support all the same features as desktop: hot-reloading, fast rebuilds, asset bundling, logging, etc. Dioxus is also the only Rust framework that supports main.rs for mobile - no other tools have supported the same main.rs for every platform until now.
Our inline mobile support requires no extra configurations, no manual setup for Gradle, Java, Cocoapods, and no other 3rd party tooling. If you already have the Android NDK or iOS Simulator installed, you currently are less than 30 seconds away from a production-ready mobile app written entirely in Rust.
dxnew-6ae881e7cb312845.mp4
Completely Revamped Hot-Reloading
We shipped massive improvements to the hot-reloading engine powering Dioxus. Our internal goal was to iterate on the Dioxus Docsite with zero full rebuilds.
This means we needed to add support for a number of new hot-reloading engine changes:
Hot-reload formatted strings
Hot-reload nested rsx blocks
Hot-reload component properties and simple Rust expressions
Hot-reload mobile platforms and their bundled assets
The new hot-reloading engine almost feels like magic - you can quickly iterate on new designs - and even modify simple Rust code! - without waiting for full rebuilds:
dogapphr2-e0c61cc8f7dab6f1.mp4
Completely Revamped Autocomplete
Another huge overhaul in Dioxus 0.6: greatly improved autocomplete of rsx! {}. Our old implementation of rsx! {} suffered from poor integration with tools like Rust-analyzer which provide language-server integration for your code. If the input to the macro wasn’t perfectly parsable, we failed to generate any tokens at all, meaning rust-analyzer couldn’t jump in to provide completions.
The work to fix this was immense. Macro parsing libraries like syn don’t provide great facilities for “partial parsing” Rust code which is necessary for implementing better errors and autocomplete. We had to rewrite the entire internals of rsx! {} to support partial parsing of rsx! {} , but finally, in 0.6, we’re able to provide stellar autocomplete. Not only can we autocomplete Rust code in attribute positions, but with a few tricks, we’re able to automatically insert the appropriate braces next to element names:
Inline WASM stacktraces and tracing integration
Along with the rewrite of the CLI, we shipped a tracing integration for WASM apps that captures panics and logs and sends them dx in your terminal. When you build your app with debug symbols, stack traces directly integrate with your editor, allowing you to jump directly to the troublesome files from within your terminal.
Toasts and Loading Screens
As part of our CLI overhaul, we wanted to provide better feedback for developers when building web apps. Dioxus 0.6 will now show Popup Toasts and Loading Screens for web apps in development mode.
Now, when your app is building, Dioxus will render a loading screen with the current progress of the build:
Fullstack Desktop and Mobile
Additionally, we properly integrated server functions with native apps. Server functions finally work out-of-the-box when targeting desktop and mobile:
native-serverfn12-c825c80078382054.mp4
Stabilizing Manganis asset!() syst...
v0.6.0-rc.0
Dioxus v0.6 Release Candidate
The first release candidate for Dioxus v0.6 is here! Barring any other major issues, this version of Dioxus should be the version that gets shipped.
Our planned release date for v0.6.0 is one week from today: December 9, 2024.
Full list of changes in Dioxus v0.6
The v0.6.0 blog post is under construction but is mostly complete. Check out the full list at https://dioxuslabs.com/blog/release-060/
- CLI support for Android and iOS simulator: simply dx serve --platform android
- Overhauled interactive CLI inspired by Astro’s excellent tools
- Proper ServerFn support for Desktop and Mobile apps for simple server RPC
- Toasts and loading screens for web apps, inspired by many JS frameworks
- Revamped autocomplete using Rust-analyzer itself (no 3rd party LSP integration needed)
- Hotreloading of formatted strings, component properties, if/for blocks, and nested rsx!{}
- Mobile hotreloading and bundled asset hotreloading
- Stabilization of asset!() macro for including assets in your app and ecosystem crates
- Streaming HTML support with integrated Suspense and server-compatible Error Boundaries
- Ability to use ? in handlers, tasks, and components to bubble up errors to error boundaries
- Static site generation support in the CLI
- Head {}, Title {}, Meta {}, and Link {} elements for setting document attributes from components
- dx bundle support for web, iOS, and Android (in addition to desktop)
- json mode for the CLI for use by 3rd party tools
- Proper preventDefault handling with synchronous event propagation
- Child window support and WGPU integration
- New onvisible and onresize event handlers for elements
- and more!
Testing it out:
To install the CLI (instead of building from source) use:
cargo binstall dioxus-cli --version v0.6.0-rc.0
We have a number of new templates to get started, simple use dx new <path>
and choose between a bare-bones templates, a full starter kit, and a large workspace setup.
New Features
Improvements to dx new
to match cargo new
dx new
has been re-written and cleaned up to match the same syntax as the familiar cargo new
.
You can also now specify custom templates from git
. We use this new feature to implement versioning of templates. You can see the different templates for v0.5 vs v0.6 in the branches list.
New templates
We now have 3 new templates that are compatible with the new mobile features:
- A simple bare-bones app
- A featureful starter kit with styling and a suggested project structure
- A large workspace setup with different platforms per-crate (separate web/desktop/mobile entrypoints)
Faster asset collection
We simplified our internal asset system to be extremely quick and to solve issues we encountered with custom linker setups. Now, you can use any linker you'd like and we won't have conflicts.
We also implemented "hot" caching of assets on the filesystem so we don't constantly copy assets between incremental builds.
Restoring manganis asset optimizations under a new syntax
We restored many of the manganis asset optimizations that we had disabled for several pre-releases while we worked out the syntax.
Now, you can pass any struct that implements "constant serialization" as "options" for manganis assets. The dioxus cli is able to deserialize these options during asset collection and apply relevant optimizations.
let asset = asset!("/assets/logo.png", ImageAssetOptions::new().with_format(ImageFormat::Avif));
We now have optimizations for JavaScript, CSS, JSON, images, videos, and folders - all of which can drastically improve your app's performance when used properly.
Merge onvisible
support for elements
You can now attach on onvisible
handler to elements that fires whenever an element's visibility changes. This uses an IntersectionObserver under the hood which previously required a lot of boilerplate to setup.
onVisible.mp4
Child window support and WGPU integration
Dioxus-desktop and dioxus-mobile now have support for child windows. This means you can create the desktop window and integrate it with an existing window. This new feature lets you integrate a dioxus app with an existing WGPU scene, unlocking a whole new world of possible apps like CAD tools, video editors, and more!
Screen.Recording.2024-10-24.at.4.15.51.PM.mov
We also added support for custom event loops so you can create dioxus-desktop apps with existing windows (for say, an EGUI integration).
Bug fixes
A number of bugs were fixed:
- android app server fn endpoint was set incorrectly and has been fixed
- basepath is fixed and now users tags in dev
- various race conditions were fixed
- various bugs in the new hotreloading engine were fixed
What's Changed
- Fix (and rewrite)
dx init
/dx new
by @Andrew15-5 in #2822 - feat: enable versioned templates by @jkelleyrtp in #3223
- fix the downcast for formdata try_as_web_event by @rogusdev in #3227
- feat: traverse the target directory instead of intercepting the linker to collect assets by @jkelleyrtp in #3228
- properly expose all symbls in manganis without linker intercept by @jkelleyrtp in #3230
- fix android serverfns by @jkelleyrtp in #3231
- Restore manganis optimizations by @ealmloff in #3195
- Fix: CLI Windows Write
exe
Errors by @DogeDark in #3239 - Fix hydration race condition by @ryo33 in #3240
- wgpu windows (fixed) by @jkelleyrtp in #3257
- Fix base path on web and fullstack by @ealmloff in #3247
- chore(web): bump web-sys & js-sys to 0.3.70 by @ilaborie in #3256
- Fix hot reloading identical event handler closures by @ealmloff in #3270
- Fix: Legacy Folder Assets With
.
In Name by @DogeDark in #3264 - Fix diffing cloned rsx nodes by deep cloning nodes before mounting them by @ealmloff in #3271
- Fix fullstack axum integration docs by @ealmloff in #3263
- document Write, GenerationalRef, and GenerationalRefMut by @ealmloff in #3253
- drop reference types due to deprecation, pin browserlist (fix ci) by @jkelleyrtp in #3272
- Add the
onvisible
event handler toElement
by @ASR-ASU in #2911 - improve build times by extracting asset opt into its own crate by @jkelleyrtp in #3273
New Contributors
Full Changelog: v0.6.0-alpha.5...v0.6.0-rc.0
v0.6.0-alpha.5
v0.6.0-alpha.5
This should be the final pre-release of 0.6. We are currently in a feature-freeze and any changes from here will be bug fixes and upgrades to documentation, should there need any.
A draft of the release is available at http://dioxuslabs.com/blog/release-060/.
alpha.4 and alpha.2 have much larger change lists for the full release cycle:
https://github.com/DioxusLabs/dioxus/releases/tag/v0.6.0-alpha.4
https://github.com/DioxusLabs/dioxus/releases/tag/v0.6.0-alpha.2
dx serve --platform android
In the last release we added support for iOS serve and now we are adding support for android serve!

faster wasm-bindgen and faster builds
We enabled the "parallel" feature on walrus and configured out logs to boost wasm-bindgen performance by 2-3x. When combined with debug=0
, incremental builds are about 70-80% faster.
Deprecate relative asset paths
We are phasing out asset!("./assets/plah.png")
in favor of the web-native syntax: asset!("/assets/plah.png")
. This now throws a deprecation warning.
Fixes to reactivity
We fixed some show-stopper bugs with reactivity around ReadOnlySignals on component boundaries
CLI json output
The CLI now has a mode to emit logs in json so you can combine it with tools like jq
for better script interoperability.
What's Changed
- Typo in README.md by @alilosoft in #3158
- wip: faster playwright test with better caching by @jkelleyrtp in #3160
- Make wasm-bindgen parallel/disable log, speed up 2-10x by @jkelleyrtp in #3161
- Remove debug printlns by @Rahul721999 in #3179
- complete implementation of IntoAttributeValue for number types by @chungwong in #3169
- Fix providing context to server functions by @ealmloff in #3174
- Fix as web event by @ealmloff in #3178
- Fix subscriptions for read only signals passed as props by @ealmloff in #3173
- Bump JamesIves/github-pages-deploy-action from 4.6.8 to 4.6.9 by @dependabot in #3193
- Replace "and soon, mobile" to "and mobile" to reflect the tauri v2 la… by @ahqsoftwares in #3199
- Fix: CLI Fullstack Executable File Extension by @DogeDark in #3198
- cli json output, dx bundle fix,
dx serve --platform android
, race condition, drop ssg platform by @jkelleyrtp in #3186 - fix: autodetect android install by @jkelleyrtp in #3200
- Don't run effects from dead recycled scopes by @ealmloff in #3201
- Fix write on render warning with read only signal props by @ealmloff in #3194
- Enable External Links Without Modifier by @LeWimbes in #2983
- Add support for user-provided event loops & event handlers by @Aandreba in #3180
- feat: allow android apps with any name, fix android + windows for aarch64 target by @jkelleyrtp in #3213
- Deprecate relative asset paths, better warnings for asset!() by @jkelleyrtp in #3214
- fixes: light qol fixes for ssg and logging on
dx run
by @jkelleyrtp in #3216 - Feat: Android Dynamic Arch Support by @DogeDark in #3215
- feat: add keep-symbols flag, change ssg format to Vec by @jkelleyrtp in #3217
- Fix: Asset Warnings On Windows by @DogeDark in #3220
- fix: java_home and cli swallowing logs by @jkelleyrtp in #3221
New Contributors
- @alilosoft made their first contribution in #3158
- @Rahul721999 made their first contribution in #3179
- @ahqsoftwares made their first contribution in #3199
- @LeWimbes made their first contribution in #2983
- @Aandreba made their first contribution in #3180
Full Changelog: v0.6.0-alpha.4...v0.6.0-alpha.5
v0.6.0-alpha.4
Dioxus v0.6.0-alpha.4
This release is planned to be the last release of the v0.6 alpha cycle fixing a number of bugs with hotreloading, assets, the router, and more.
To install the CLI (instead of building from source) use:
cargo binstall dioxus-cli --version v0.6.0-alpha.4
Major changes in this alpha:
Inline iOS support, android fixes:
Overhaul of the CLI:
We dropped the custom scroll behavior of the previous alpha in favor of a simple fixed viewport and traditional println!()
-oriented history.
This provides more details while also allowing scrollback/selection/etc.

Hotreloading for manganis assets in all platforms (except Android)
All asset!()
calls now support hotreloading:
bundled-ios-reload.mp4
Asset system changes
We adjusted the path format of the asset!()
macro to force leading slashes. This will eventually let us support relative paths to assets as well as make it clear that you cannot include assets from outside the package directory:

onresize handler
You can now attach onresize
to your elements and track changes to element size without an Observer.
Fullstack server functions for iOS/Android/Desktop
By default, in dev, server functions are now callable from native apps without any additional configuration.
Keep in mind that in production you will still want to set the endpoint of your server.
Improved compile times
We cut the workspace into smaller pieces that include fewer dependencies. This should improve build times by about 50%.
Docsite improvements
We have been using the docsite as a canary for many of the new features (like static-site-generation) and you can test drive it at https://dioxuslabs.com.
Bug fixes
We fixed a ton of bugs, so things should be more reliable, faster, and hopefully more intuitive.
Known issues remaining:
- non-serve commands are too verbose
dx bundle
is pointing to the wrong directorybase_path
is getting set properly in some scenarios
What's Changed
- Fix github CLI publish CI msrv by @jkelleyrtp in #2802
- Fix mac CLI publish by using mac13 for runner by @jkelleyrtp in #2803
- Simplify and fix some issues with
#[component]
macro by @tigerros in #2289 - Fix Option with non path T types by @ealmloff in #2808
- Fix assets folder workspace by @ealmloff in #2821
- adding the Access-Control-Allow-Origin header to assets by @daixiwen in #2818
- Fix nested rsx expansion by not using template titles by @jkelleyrtp in #2799
- Update: wasm-bindgen by @DogeDark in #2824
- Synchronous prevent default by @ealmloff in #2792
- Fix templates merging in debug mode in macros by @ealmloff in #2828
- Fix mount use after removal/Simplify mounts a bit by @ealmloff in #2834
- Fix non-brace delimeters in nested macro formatting by @jkelleyrtp in #2831
- Fix side-by-side fragments by walking in reverse by @jkelleyrtp in #2841
- Apply any queued hot reload changes when the client connects by @ealmloff in #2843
- Fix hot reloading component properties out of order by @ealmloff in #2842
- Add the
onresize
event handler to Element by @ASR-ASU in #2479 - Add version number to package section of Cargo.toml to fix issue #2833 by @jacklund in #2835
- Don't rebuild when the code is in an invalid intermediate state by @ealmloff in #2848
- fix collapsing of multiline components and rsx!{} calls by @jkelleyrtp in #2849
- Fix: Make Toast Fixed & Increase Z-Index by @DogeDark in #2850
- Move to a generic GlobalLazy by @ealmloff in #2851
- fix autofmt: don't panic when writing blocks out without a srcfile by @jkelleyrtp in #2854
- Fix: CLI Progress by @DogeDark in #2840
- Fix
Error parsing user_event: Error("EOF while parsing a value", line: 1, column: 0)
by @ASR-ASU in #2856 - Fix hot reload custom element by @ealmloff in #2866
- Make desktop fullstack work with the CLI by @ealmloff in #2862
- Make use_callback and Callback bring the runtime with them by @ealmloff in #2852
- Update README.md to highlight both licenses by @jkelleyrtp in #2868
- Fix: clippy, dont throw error on commas by @jkelleyrtp in #2869
- Bump sledgehammer by @ealmloff in #2879
- Bump dependencies to transitively bump git2 from 0.18 to 0.19 by @pyrrho in #2873
- Add placeholder doc comments to macro-generated enums by @pyrrho in #2872
- feat: Manual impl of PartialEq for
Coroutine
by @marc2332 in #2895 - Restore Nix devShell support by @srid in #2890
- Revert "feat: Manual impl of PartialEq for
Coroutine
" by @marc2332 in #2899 - Fix script component src attribute by @ealmloff in #2887
- Finish the running examples section of the readme by @ealmloff in #2889
- Fix hot reloading components with keys by @ealmloff in #2886
- Fix ordering issues when with_menu(None) is called before setting the window builder by @ealmloff in #2903
- Bump webpack from 5.88.1 to 5.94.0 in /packages/extension by @dependabot in #2907
- Add
aspect-ratio
property by @ASR-ASU in #2916 - Use of
async_std::task::sleep
instead oftokio::time::sleep
in examples by @ASR-ASU in #2912 - Bump quinn-proto from 0.11.6 to 0.11.8 by @dependabot in #2922
- Bump gix-path from 0.10.9 to 0.10.10 by @dependabot in #2921
- Fix clock example (
tokio::time::sleep
->async_std::task::sleep
) by @ASR-ASU in #2939 - Bump gix-path from 0.10.10 to 0.10.11 by @dependabot in #2938
- Parse trailing route slash by @ealmloff in #2896
- Allow hooks in the expression of a match statement and if statement by @ealmloff in #2902
- Fix custom launch builder with unsized context types by @ealmloff in #2920
- Bump wry to 0.43 by @ealmloff in #2945
- add
disabled
,form
andname
attributes to fieldset by @chungwong in #2947 - remove unused logic in fullstack launch by @chungwong in #2949
- ci: Add workflow for building
flake.nix
by @srid in #2910 - Bump JamesIves/github-pages-deploy-action from 4.6.3 to 4.6.4 by @dependabot in #2944
- Remove mention of suspense/streaming in readme comparison by @ealmloff in #2950
- Simplify TodoMVC example by @matthunz in #2935
- Fix dx bundle command and resources panic by @ealmloff in #2951
- CLI Fixes & Tweaks by @DogeDark in #2846
- small style tweak: make spacing cosnsistent for uses of
rsx! {
, switchtodo!()
tounimplemented!()
by @jkelleyrtp in #2956 - Chore: remove old cruft in web crate by @jkelleyrtp in #2957
- Skip running Nix CI for draft PRs by @matthunz in #2961
- Chore: hoist example projects for discoverability by @jkelleyrtp in #2959
- Extract some simple cleanups from 2779 by @jkelleyrtp in #2966
- Split out isrg from ssr and reorient build graph to make interpreter build 2x faster by @jkelleyrtp in #2969
- Chore: format some cargo tomls by @jkelleyrtp in #2970
- Improve compile times by splitting out ...
v0.6.0-alpha.2
Dioxus 0.6.0 Alpha
Dioxus 0.6 includes improvements to several areas of dioxus. The highlights are:
- Asset improvements
- Head elements
- RSX autocomplete
- Improved hot reloading
- Suspense and streaming
- Error boundaries
- A new TUI!
- Documentation improvements
- Blitz rewrite
Asset Stabilization
We introduced our new asset system, Manganis, in an alpha state with the 0.5 release. Dioxus 0.6 stabilizes the asset system and fixes several bugs and performance issues. You can try out the new linker based asset system by including an asset!
anywhere in your code. It will automatically be optimized and bundled across all platforms:
rsx! {
img { src: asset!("./assets/myimg.png") }
}
Head Elements
In addition to the Manganis asset system, dioxus 0.6 includes a new way to include assets into your html. The new Script
, Link
, Style
, and Meta
components let you link to assets anywhere in your html. These components will automatically be hoisted into the <head>
across all platforms and deduplicated by the source:
#[component]
fn MyStyledComponent() -> {
rsx! {
head::Link {
rel: "stylesheet",
href: asset!("./assets/style.css")
}
"This component is styled"
}
}
Autocomplete and improved errors for RSX
RSX now supports autocomplete everywhere. In addition to expressions, elements, components and attributes now autocomplete correctly:
autocomplete.mov
The new version of RSX also features better error messages for incorrect markup:
Supercharged Hot Reloading
In 0.6, RSX hot reloading is much more consistent. You can move around and duplicate expressions anywhere in an rsx block or create new literals anywhere in an rsx block. This means you can now create new formatted text nodes, new formatted attributes or tweak properties on the fly without recompiling!
hot-reloading.mov
Suspense and Streaming
Async is a core component of any UI framework. Dioxus provides hooks to handle async state. You can start a future and handle the loading and resolved states within the component:
#[component]
fn Article() -> Element {
// Use resource starts a future in the background and returns the current state
let article = use_resource(fetch_article);
rsx! {
// You can match the state of the future to render either a loading state or the resolved state
match article() {
Some(article) => rsx! { "{article}" },
None => rsx! { p { "Loading..." } }
}
}
}
This works ok if you have a single future, but it quickly gets messy when combining many futures into one UI:
#[component]
fn Article() -> Element {
// Use resource starts a future in the background and returns the current state
let Some(title) = use_resource(fetch_title).cloned() else {
return rsx! { "loading..." }
};
let Some(article) = use_resource(fetch_article).cloned() else {
return rsx! { "loading..." }
};
let Some(category) = use_resource(move || article.title()).cloned() else {
return rsx! { "loading..." }
};
rsx! {
Title { "{title}" }
Body { category, article }
}
}
In addition to hooks, we need a way to display a different state when async is loading. Dioxus 0.6 introduces a new core primitive for async UI called suspense boundaries. A suspense boundary is a component that renders a placeholder when any child component is loading:
rsx! {
SuspenseBoundary {
fallback: |context: SuspenseContext| rsx! {
// Render a loading placeholder if any child component is suspended
"Loading..."
},
Article {}
}
}
In any child component, you can just bubble up the pending state with ?
to pause rendering until the future is finished:
#[component]
fn Article() -> Element {
let title = use_resource(fetch_title).suspend()?;
let article = use_resource(fetch_article).suspend()?;
let category = use_resource(move || article.title()).suspend()?;
// Since we bubbled up all the pending futures with `?` we can just
// handle the happy path in the component
rsx! {
Title { "{title}" }
Body { category, article }
}
}
Along with suspense boundaries, dioxus fullstack also supports streaming each suspense boundary in from the server. Instead of waiting for the whole page to load, dioxus fullstack streams in each chunk with the resolved futures as they finish:
streaming.mov
Error boundaries
0.6 also introduces error boundaries which let you display an error message if any child component runs into an error:
#[component]
fn Root() -> Element {
rsx! {
ErrorBoundary {
handle_error: |errors: ErrorContext| {
match errors.show() {
// Render the view the child component through with the error
Some(view) => view,
// Or a fallback if the error doesn't come with a view
None => rsx! {
pre {
color: "red",
"oops, we ran into an error\n{errors:#?}"
}
}
}
},
Contents {}
}
}
}
You can throw an error from any child component while rendering or handling events:
#[component]
fn Double(input: String) -> Element {
// You can use ? to throw an event during rendering
let parsed: f32 = input.parse()?;
let doubled = parsed * 2.0;
rsx! {
"{doubled}"
}
}
#[component]
fn DoubleButton(mut count: Signal<u8>) -> Element {
rsx! {
button {
onclick: move |_| {
// Errors can have an associated view which the error boundary can
// choose to show
let doubled = count().checked_mul(2).show(|_|
rsx! { "multiplying {count} by 2 would overflow the u8" }
)?;
count.set(doubled);
Ok(())
},
"Double!"
}
}
}
DX TUI
The Dioxus CLI has been rewritten to support a TUI with build progress, and multiple views for logs. It has shortcuts for common actions, and displays progress in both the TUI and the site as the project loads:
tui.mov
Blitz Rewrite
Blitz has been rewritten to use Firefox's browser engine, Stylo. The new version of Blitz is much more capable with proper accessibility support, IME support, and better text support. Blitz should be a drop in replacement for dioxus desktop for the small subset of HTML it supports. Keep in mind Blitz is still experimental and not ready for production use. You can try Blitz by adding dioxus_blitz from the git repo:
cargo add dioxus-blitz --git https://github.com/DioxusLabs/blitz
Launching your Dioxus app with the blitz renderer:
dioxus_blitz::launch(app);
Ergonomic tweaks
Dioxus 0.6 also includes a number of smaller ergonomic tweaks that should help dioxus feel a lot more consistent
Static Generation
Dioxus 0.6 splits out static generation into its own platform to make it easier to set up:
//! Static generation works out of the box with the router. Just add a router anywhere in your app and it will generate any static routes for you!
#![allow(unused)]
use dioxus::prelude::*;
// Generate all routes and output them to the static path
fn main() {
launch(|| {
rsx! {
Router::<Route> {}
}
});
}
#[derive(Clone, Routable, Debug, PartialEq)]
enum Route {
#[route("/")]
Home {},
#[route("/blog")]
Blog,
}
#[component]
fn Blog() -> Element {
rsx! {
Link { to: Route::Home {}, "Go to counter" }
table {
tbody {
for _ in 0..100 {
tr {
for _ in 0..100 {
td { "hello!" }
}
}
}
}
}
}
}
#[component]
fn Home() -> Element {
let mut count = use_signal(|| 0);
rsx! {
Link { to: Route::Blog {}, "Go to blog" }
div {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
}
}
}
Fullstack State
Fullstack state now propagates from the launch builder into server functions which makes it much easier to set up state that is shared throughout your application like a database pool:
fn main() {
LaunchBuilder::new().with_context(1234567890u32).launch(app);
}
#[server]
async fn get_server_data() -> Result<String, ServerFnError> {
let FromContext(context): FromContext<u32> = extract().await?;
Ok(format!("the context was {context}"))
}
Callbacks
Dioxus 0.6 expands EventHandler
s into callbacks which let you bot...