v0.6.0
Breaking middleware API changes, new EventBus customization, feature-gated dependencies, and docs/examples cleanup.
Breaking Changes
Middleware<A>→Middleware<S, A>: Middlewarebefore()andafter()now receive&Sstate reference. Update implementations:before(&mut self, action: &A, state: &S) -> bool,after(&mut self, action: &A, state_changed: bool, state: &S) -> Vec<A>DispatchResult<E>renamed toReducerResult<E>: All references must be updatedtracingandserdeare now feature-gated intui-dispatch-core: previously always-on dependencies, now requirefeatures = ["tracing"]orfeatures = ["serde"].LoggingMiddlewarerequires thetracingfeature- Action category inference:
Didis now treated as a verb boundary in category inference, grouping intent and result actions under the same category.WeatherDidLoadis now category"weather"instead of"weather_did", matchingWeatherFetch. This aligns macro behavior with documented semantics EventOutcomemoved fromruntimetobusmodule — import paths changed- Debug formatting helpers renamed:
ron_string→debug_string,ron_string_compact→debug_string_compact,ron_string_pretty→debug_string_pretty bitflagsdependency removed fromtui-dispatch-core
Added
GlobalKeyPolicyfor customizing which keys bypass modal blocking in EventBus:GlobalKeyPolicy::without_esc(),::keys(),::none(),::custom(). NewEventBus::with_global_key_policy()builder- Middleware cancel/inject semantics:
before()returnsfalseto cancel an action;after()returnsVec<A>to inject follow-up actions through the full pipeline with recursion depth guard (MAX_DISPATCH_DEPTH) - Minesweeper example demonstrating middleware cancel/inject patterns
- Facade prelude now exports
SubPauseHandle,TaskPauseHandle,DefaultBindingContext,SimpleEventBus, andGlobalKeyPolicy
Fixed
- Middleware dispatch correctness:
StoreWithMiddleware::dispatch()now aggregates return values from injected actions — previously it could returnfalseeven when injected actions changed state, suppressing re-renders - Middleware recursion guard: Dispatch depth is now decremented after recursive injected dispatches complete, so
MAX_DISPATCH_DEPTHcorrectly detects injection loops instead of being bypassed - Same fixes applied to
EffectStoreWithMiddleware
Removed
- Weather example (moved to dmk/tui-stuff)
Improved
- Keybindings matching and EventBus event routing performance
- Runtime event loop methods deduplicated (internal)
Docs
- Fixed broken internal doc anchors (
#dispatchresult→#reducerresult,#bindingcontext→#keybindings) - Fixed markdown-preview example docs showing removed
run_with_bus()API — now shows actualDispatchRuntime::run()usage - Removed stale "mdBook" reference from crate-level docs
- Converted core rustdoc examples from
ignoreto compile-tested (Store,EffectStore, crate-level example) - Added Starlight docs site build to PR CI
tui-dispatch ·
tui-dispatch-core ·
tui-dispatch-macros ·
tui-dispatch-components ·
tui-dispatch-debug