github DioxusLabs/dioxus v0.6.0-rc.0

latest releases: v0.6.1, v0.6.0
20 days ago

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

New Contributors

Full Changelog: v0.6.0-alpha.5...v0.6.0-rc.0

Don't miss a new dioxus release

NewReleases is sending notifications on new releases.