Skip to content

v0.1.28

Latest

Choose a tag to compare

@decebal decebal released this 02 Apr 12:05
ac34792

Fixed

  • State-aware erased macros still triggered E0275 (#58) — The erase_handler_with_state!, erase_handler_with_state_only!, and their streaming variants called the generic resolve_state::<S>() inside each handler closure, reintroducing monomorphization pressure that triggered E0275 when converting register_with_state handlers to the erased path. Replaced with a new non-generic resolve_state_erased() function (TypeId lookup + downcast), eliminating all remaining generic function monomorphization from the erased macro path. The register_handlers_erased! batch macro now works for all handler types including state handlers.

  • #[saga] + #[saga_workflow] duplicate method conflict — The #[saga] attribute macro generated a default workflow_steps() inherent method that conflicted with the one generated by #[saga_workflow], causing E0592 (duplicate definitions). Removed the default from #[saga]; standalone sagas now return empty steps, and #[saga_workflow] provides the step list without conflict.

Added

  • resolve_state_erased() — Public non-generic state resolution function that accepts a pre-computed TypeId and type_name, used by the erased state-handler macros to avoid generic monomorphization inside handler closures.

Migration

Update dependency:

allframe-core = "0.1.28"

Convert all remaining register_with_state handlers to the erased path in one shot:

use allframe_core::register_handlers_erased;

register_handlers_erased!(router, {
    "handler1" => handler1(state: AppState, args: Args1),
    "handler2" => handler2(state: AppState),
    "handler3" => handler3(args: Args3),
    "handler4" => handler4(),
});

Full changelog: https://github.com/all-source-os/all-frame/blob/main/CHANGELOG.md