Skip to content

v0.1.21

Choose a tag to compare

@decebal decebal released this 18 Mar 16:02
· 20 commits to main since this release
34bd9a6

Highlights

Async Boot Lifecycle (#42)

New BootBuilder and BootContext for running async initialization inside Tauri 2's synchronous setup() closure. Handles the "no Tokio reactor on macOS main thread" problem once, correctly, for all apps.

allframe_tauri::builder(router)
    .on_boot(3, |ctx| async move {
        let store = open_store(&ctx.data_dir()?).await
            .map_err(|e| BootError::Failed(e.to_string()))?;
        ctx.inject_state(store);
        ctx.emit_progress("Event store opened");
        // ...
        Ok(())
    })
    .build()
  • BootContext::inject_state() — inject state for handlers during boot
  • BootContext::emit_progress() — emit allframe:boot-progress events for frontend splash screens
  • Ephemeral new_current_thread() Tokio runtime for block_on during setup
  • Fully backward compatible: init(router) unchanged

Deferred State Resolution (#51)

Handler state is now resolved at call time via SharedStateMap (Arc<RwLock<HashMap<TypeId, ...>>>). Handlers can be registered before their state type is injected — enabling the boot lifecycle pattern.

Also in this release

  • Router::shared_states() public accessor
  • CQRS macro trait implementations (#[command], #[query], #[event])
  • QueryBus + Query/QueryHandler traits
  • Architecture layer enforcement macros
  • #[derive(Obfuscate)] enum support
  • Saga macro improvements
  • Forge integration tests and fixes

See CHANGELOG.md for full details.