Ducky Docs
Migrate pages

Migrating from Fluxor

This guide takes a Blazor app from Fluxor 6.11.0 (Fluxor and Fluxor.Blazor.Web, the latest release as of 2026-11-08) to Ducky 2.0. The two libraries share the Redux model: a feature state becomes a slice, a reducer method becomes an On<TAction> in that slice, an effect method becomes an Effect<TAction>. What changes is mostly around the edges: how the store is registered and started, what an effect can do about concurrency, and what a dispatch tells you.

Ducky 2.0 targets net11.0 only, and it is a pre-release. Fluxor 6.11.0 targets net8.0, net9.0 and net10.0 and has years of production use. If your app can't move to .NET 11 yet, stay on Fluxor. How Ducky compares sets the two side by side.

Every snippet on this page comes from the compiled sample in docs/migration/samples/fluxor. Before is user code against Fluxor.Blazor.Web 6.11.0 from nuget.org, written from Fluxor's own tutorials. After is the same app on Ducky 2.0, and After.Tests holds its tests and one test per behaviour change below.

Checklist

  1. Target net11.0. Replace Fluxor and Fluxor.Blazor.Web with Ducky and Ducky.Blazor, and add Ducky.Testing to test projects. Remove Fluxor.Blazor.Web.ReduxDevTools (DevTools ship in Ducky.Blazor) and the community Fluxor.Persist (persistence ships in Ducky.Blazor).
  2. Make each [FeatureState] a plain record, and move its [ReducerMethod]s into the constructor of a Slice<TState>, one On<TAction> each (see State, actions and reducers).
  3. Turn each [EffectMethod] into an Effect<TAction> that dispatches through its context, passes its cancellationToken on, and picks a Policy (see Effects).
  4. Replace FluxorComponent with DuckyComponent, and each injected IState<T> or IStateSelection<TState, TValue> with a Select in OnInitialized (see Components).
  5. In _Imports.razor and the .razor files, replace @using Fluxor and @using Fluxor.Blazor.Web.Components with @using Ducky and @using Ducky.Blazor, @inherits FluxorComponent with @inherits DuckyComponent, and each @inject IState<T> or @inject IStateSelection<TState, TValue> with a Select in the @code block's OnInitialized; drop @inject IDispatcher, since the component's own Dispatch and DispatchAsync replace it.
  6. Replace AddFluxor with AddDucky and the generated AddDuckyGenerated_{Assembly}(), register middleware with Use<T>(), and pass a JsonSerializerContext to UseJson (see Registration).
  7. Delete <StoreInitializer />. Move the first load from OnInitialized to an effect on StoreInitialized, and register a prerendered slice with Prerender<T> (see The store initializer and the first load).
  8. Run the app's tests, then read Behaviour changes.

Before and after

State, actions and reducers

Counter.csfrom a tested file
// Fluxor: [FeatureState] marks the state; its parameterless constructor gives the initial state.
[FeatureState]
public sealed record CounterState(int Count, bool IsLoading, string? Error)
{
    public CounterState() : this(Count: 0, IsLoading: false, Error: null)
    {
    }
}

public sealed record IncrementCounterAction(int Amount);

public sealed record LoadCounterAction;

public sealed record LoadCounterResultAction(int Count);

public sealed record LoadCounterFailedAction(string Error);

public interface ICounterApi
{
    Task<int> GetCountAsync(CancellationToken cancellationToken);
}
Counter.csfrom a tested file
// Ducky 2.0: the state and the actions stay plain records; no attribute, no parameterless constructor.
public sealed record CounterState(int Count, bool IsLoading, string? Error);

public sealed record IncrementCounterAction(int Amount);

public sealed record LoadCounterAction;

public sealed record LoadCounterResultAction(int Count);

public sealed record LoadCounterFailedAction(string Error);

public interface ICounterApi
{
    Task<int> GetCountAsync(CancellationToken cancellationToken);
}

Actions don't change: any record is an action in both libraries. The reducers move from static [ReducerMethod]s, which Fluxor's scan finds anywhere in the assembly, into the slice that owns the state:

Counter.csfrom a tested file
// Fluxor: static [ReducerMethod]s, found by the assembly scan; [ReducerMethod(typeof(T))] when the payload is unused.
public static class CounterReducers
{
    [ReducerMethod]
    public static CounterState OnIncrement(CounterState state, IncrementCounterAction action) =>
        state with { Count = state.Count + action.Amount };

    [ReducerMethod(typeof(LoadCounterAction))]
    public static CounterState OnLoad(CounterState state) => state with { IsLoading = true, Error = null };

    [ReducerMethod]
    public static CounterState OnLoaded(CounterState state, LoadCounterResultAction action) =>
        state with { Count = action.Count, IsLoading = false };

    [ReducerMethod]
    public static CounterState OnLoadFailed(CounterState state, LoadCounterFailedAction action) =>
        state with { IsLoading = false, Error = action.Error };
}
Counter.csfrom a tested file
// Ducky 2.0: one slice holds the initial state and one On<TAction> per action; On<T>(state => ...) when the payload is unused.
public sealed class CounterSlice : Slice<CounterState>
{
    public CounterSlice()
    {
        On<IncrementCounterAction>((state, action) => state with { Count = state.Count + action.Amount });
        On<LoadCounterAction>(state => state with { IsLoading = true, Error = null });
        On<LoadCounterResultAction>((state, action) => state with { Count = action.Count, IsLoading = false });
        On<LoadCounterFailedAction>((state, action) => state with { IsLoading = false, Error = action.Error });
    }

    // The slice key, pinned because the prerender seed and DevTools name the slice by it.
    public override string Key => "counter";

    protected override CounterState Initial => new(Count: 0, IsLoading: false, Error: null);
}

Both libraries treat a reducer that returns the same reference as no change: Fluxor's Feature<TState> compares with ReferenceEquals, and so does Ducky (see Slices and keys). Fluxor's feature name becomes the slice key, derived from the class name unless you override Key; pin it once the slice is persisted or prerendered, as the sample does.

Effects

Counter.csfrom a tested file
// Fluxor: an [EffectMethod] starts for every LoadCounterAction, alongside any earlier run, and gets no cancellation token.
public sealed class CounterEffects(ICounterApi api)
{
    [EffectMethod(typeof(LoadCounterAction))]
    public async Task HandleLoad(IDispatcher dispatcher)
    {
        try
        {
            dispatcher.Dispatch(new LoadCounterResultAction(await api.GetCountAsync(CancellationToken.None)));
        }
        catch (HttpRequestException exception)
        {
            dispatcher.Dispatch(new LoadCounterFailedAction(exception.Message));
        }
    }
}
Counter.csfrom a tested file
// Ducky 2.0: an Effect<TAction> gets a cancellation token and a concurrency policy. Switch: a newer LoadCounterAction
// cancels the running load, and the cancelled run can no longer dispatch.
public sealed class LoadCounterEffect(ICounterApi api) : Effect<LoadCounterAction>
{
    public override Concurrency Policy => Concurrency.Switch;

    public override async Task Handle(LoadCounterAction action, EffectContext context, CancellationToken cancellationToken)
    {
        try
        {
            context.Dispatch(new LoadCounterResultAction(await api.GetCountAsync(cancellationToken)));
        }
        catch (HttpRequestException exception)
        {
            context.Dispatch(new LoadCounterFailedAction(exception.Message));
        }
    }
}

The effect takes its services through its constructor, as Fluxor's instance effects do, and both libraries create one effect instance per store. What is new is the CancellationToken, cancelled when the run is superseded or the store is disposed, and the Policy: Merge (the default, what Fluxor always does), Switch, Exhaust or Queue (see Effects and concurrency policies). Dispatch through the context, never through an injected IStore: the context knows which run dispatches, so a superseded run's late results are dropped (DUCKY008 warns on the injection).

Middleware

Counter.csfrom a tested file
// Fluxor: a Middleware sees every action through BeforeDispatch and AfterDispatch.
public sealed class ActionLog
{
    public List<string> Entries { get; } = [];
}

public sealed class ActionLogMiddleware(ActionLog log) : Middleware
{
    public override void AfterDispatch(object action) => log.Entries.Add(action.GetType().Name);
}
Counter.csfrom a tested file
// Ducky 2.0: a Middleware sees every reduced action in AfterReduce, with its context (the action, origin, states).
public sealed class ActionLog
{
    public List<string> Entries { get; } = [];
}

public sealed class ActionLogMiddleware(ActionLog log) : Middleware
{
    public override void AfterReduce(ActionContext context) => log.Entries.Add(context.Action.GetType().Name);
}

Fluxor's four main Middleware hooks map across: MayDispatchAction becomes MayDispatch, BeforeDispatch becomes BeforeReduce, AfterDispatch becomes AfterReduce, and InitializeAsync(IDispatcher, IStore) becomes InitializeAsync(CancellationToken) with the store in the Store property. Ducky's dispatch hooks receive an ActionContext (the action, its type name, origin, depth and the states before and after) and are synchronous: asynchronous work belongs in an effect. Fluxor's AfterInitializeAllMiddlewares and the client scripts of an IWebMiddleware have no counterpart.

Components

CounterView.csfrom a tested file
// Fluxor: FluxorComponent finds its IState<T> properties by reflection and re-renders on every change of the feature.
public sealed class CounterView : FluxorComponent
{
    [Inject]
    private IState<CounterState> CounterState { get; set; } = null!;

    [Inject]
    private IDispatcher Dispatcher { get; set; } = null!;

    public void Increment() => Dispatcher.Dispatch(new IncrementCounterAction(1));

    protected override void OnInitialized()
    {
        base.OnInitialized(); // required: FluxorComponent subscribes here (analyzer FLXW01)
        Dispatcher.Dispatch(new LoadCounterAction()); // fire-and-forget: void, no result to await
    }

    protected override void BuildRenderTree(RenderTreeBuilder builder) =>
        builder.AddContent(0, CounterState.Value.IsLoading ? "loading" : CounterState.Value.Count.ToString(CultureInfo.InvariantCulture));
}
CounterView.csfrom a tested file
// Ducky 2.0: DuckyComponent re-renders only when a value it selected in OnInitialized changed; no base call to remember.
public sealed class CounterView : DuckyComponent
{
    private Selection<CounterState>? _counter;

    public void Increment() => Dispatch(new IncrementCounterAction(1));

    // Awaitable: completes once the action is reduced, with how it ended.
    public Task<DispatchResult> RefreshAsync() => DispatchAsync(new LoadCounterAction());

    protected override void OnInitialized() => _counter = Select((CounterState state) => state);

    protected override void BuildRenderTree(RenderTreeBuilder builder) =>
        builder.AddContent(0, _counter!.Value.IsLoading ? "loading" : _counter.Value.Count.ToString(CultureInfo.InvariantCulture));
}

FluxorComponent finds its IState<T> and IStateSelection members by reflection when its OnInitialized runs, which is why an override must call base.OnInitialized(): Fluxor's analyzer (FLXW01) reports a missing call, and disposal throws otherwise. A DuckyComponent subscribes through the Select calls you make in OnInitialized, with no base call needed. Select after the first render throws (DUCKY352), and DUCKY009 catches a Select in markup.

IStateSelection maps to the same Select, narrowed to one value:

CounterView.csfrom a tested file
// Fluxor: an injected IStateSelection narrows the re-renders to one selected value.
public sealed class LoadingBadge : FluxorComponent
{
    [Inject]
    private IStateSelection<CounterState, bool> IsLoading { get; set; } = null!;

    protected override void OnInitialized()
    {
        IsLoading.Select(state => state.IsLoading);
        base.OnInitialized();
    }

    protected override void BuildRenderTree(RenderTreeBuilder builder) => builder.AddContent(0, IsLoading.Value ? "busy" : "idle");
}
CounterView.csfrom a tested file
// Ducky 2.0: Select replaces the injected IStateSelection; the component re-renders when IsLoading changes, not on every
// change of the slice.
public sealed class LoadingBadge : DuckyComponent
{
    private Selection<bool>? _isLoading;

    protected override void OnInitialized() => _isLoading = Select((CounterState state) => state.IsLoading);

    protected override void BuildRenderTree(RenderTreeBuilder builder) => builder.AddContent(0, _isLoading!.Value ? "busy" : "idle");
}

For a selector shared by several components, or one combining slices, use Selector.Define (see Selectors); Fluxor has no memoized selector type.

The store initializer and the first load

CounterView.csfrom a tested file
// Fluxor: <Fluxor.Blazor.Web.StoreInitializer /> above the <Router> (in Routes.razor or App.razor) starts the store
// in its OnAfterRenderAsync. This is the same markup written in C#.
public sealed class Routes : ComponentBase
{
    [Parameter]
    public RenderFragment? ChildContent { get; set; }

    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        builder.OpenComponent<StoreInitializer>(0);
        builder.CloseComponent();
        builder.AddContent(1, ChildContent);
    }
}

Fluxor's StoreInitializer starts the store in OnAfterRenderAsync, and until then dispatched actions wait in a queue. Ducky needs no initializer: the store initializes on its first use (a dispatch, a Select, a State read). Delete the component. <DuckyInitializer> exists for the cases its guides name: a static SSR page that must show Server-storage values (Static SSR), or a WebAssembly app with a persistence Scope and no Ducky component (Persistence).

The Fluxor component dispatched the first LoadCounterAction from OnInitialized. On a prerendered page that runs twice, once in the prerender pass and once interactively. In Ducky the first load is an effect on StoreInitialized that returns early when the slice was restored, the load rule:

Counter.csfrom a tested file
// Ducky 2.0: the first load runs once the store is initialized, unless the prerender seed already restored the slice.
public sealed class LoadCounterOnStart : Effect<StoreInitialized>
{
    public override Task Handle(StoreInitialized action, EffectContext context, CancellationToken cancellationToken)
    {
        if (!context.State.WasRestored<CounterState>())
        {
            context.Dispatch(new LoadCounterAction());
        }

        return Task.CompletedTask;
    }
}

Registration

Registration.csfrom a tested file
// Fluxor: the reflection scan finds the feature, reducers and effects; middleware is added by hand. In a Blazor Web
// App this runs in both Program.cs files.
services.AddSingleton(api);
services.AddSingleton<ActionLog>();
services.AddFluxor(options => options
    .ScanAssemblies(typeof(Registration).Assembly)
    .AddMiddleware<ActionLogMiddleware>());
Registration.csfrom a tested file
// Ducky 2.0: the generated AddDuckyGenerated_{Assembly}() replaces the reflection scan (slices and effects);
// middleware is added with Use<T>(). Prerender<T> carries the prerendered slice into the interactive store.
services.AddSingleton(api);
services.AddSingleton<ActionLog>();
services.AddDucky(ducky => ducky
    .AddDuckyGenerated_FluxorSample_After()
    .UseJson(AppJson.Default)
    .Use<ActionLogMiddleware>()
    .Prerender<CounterSlice, CounterState>(static state => state is { IsLoading: false, Error: null }));

AddDuckyGenerated_{Assembly}() is generated at build time for each assembly that declares slices or effects (see Getting started); a class library that declares slices has its own. In a Blazor Web App, call AddDucky in both Program.cs files, as Fluxor's tutorial asks for AddFluxor. Ducky serializes through the JsonSerializerContext you pass to UseJson, never by reflection: the prerender seed, persistence and DevTools need it, and DUCKY006 lists the types it lacks:

AppJson.csfrom a tested file
// Ducky 2.0 never serializes by reflection: the prerender seed, persistence and DevTools go through this context.
[JsonSerializable(typeof(CounterState))]
[JsonSerializable(typeof(IncrementCounterAction))]
[JsonSerializable(typeof(LoadCounterAction))]
[JsonSerializable(typeof(LoadCounterResultAction))]
[JsonSerializable(typeof(LoadCounterFailedAction))]
public sealed partial class AppJson : JsonSerializerContext;

Mapping table

Fluxor column: Fluxor 6.11.0, as of 2026-11-08.

Fluxor 6.11 Ducky 2.0
Fluxor, Fluxor.Blazor.Web (net8.0, net9.0, net10.0) Ducky, Ducky.Blazor (net11.0)
services.AddFluxor(o => o.ScanAssemblies(asm)) services.AddDucky(d => d.AddDuckyGenerated_{Assembly}()), generated at build time
o.ScanTypes(...) d.AddSlice<TSlice>(), d.AddEffect<TEffect>()
o.AddMiddleware<T>() d.Use<T>()
o.WithLifetime(StoreLifetime.Scoped / Singleton) d.Lifetime; by default a singleton in the browser and scoped on the server
<Fluxor.Blazor.Web.StoreInitializer /> nothing: the store initializes on first use; <DuckyInitializer> is optional
StoreInitializer.UnhandledException an effect on EffectFailed or ReducerFailed
[FeatureState] record with a parameterless constructor, or Feature<TState> with GetInitialState() a plain record and a Slice<TState> with protected override TState Initial
[FeatureState(Name = "...")], Feature.GetName() the slice Key, derived from the class name or overridden
[ReducerMethod] static TState M(TState, TAction) On<TAction>((state, action) => ...) in the slice constructor
[ReducerMethod(typeof(TAction))] static TState M(TState) On<TAction>(state => ...)
Reducer<TState, TAction> On<TAction> in the slice
[EffectMethod] Task M(TAction, IDispatcher), [EffectMethod(typeof(TAction))] Effect<TAction>.Handle(action, EffectContext, CancellationToken); several actions in one class: EffectGroup
Effect<TTriggerAction>.HandleAsync(action, dispatcher) Effect<TAction>.Handle(action, context, cancellationToken)
a CancellationToken shared by hand between effect methods Policy => Concurrency.Switch (or Exhaust, Queue) and the run's token
IDispatcher.Dispatch(action) (returns void) Dispatch(action), or await DispatchAsync(action) for a DispatchResult once reduced
IState<TState>, @inject IState<T> + FluxorComponent DuckyComponent + Select(...) in OnInitialized, or DuckyComponent<TState>
IStateSelection<TState, TValue>.Select(selector, valueEquals, selectedValueChanged) Select(selector, comparer) on a component; store.Select(selector, onChange, comparer) elsewhere
FluxorLayout DuckyLayout
MaximumStateChangedNotificationsPerSecond no equivalent: a component re-renders only when a value it selected changed
SubscribeToAction<TAction>(callback), IActionSubscriber no component-level action subscription: put the reaction in an Effect<TAction>, or select the state the action changes
Middleware: InitializeAsync, MayDispatchAction, BeforeDispatch, AfterDispatch Middleware: InitializeAsync, MayDispatch, BeforeReduce, AfterReduce
o.UseRouting(), GoAction no router state: use NavigationManager
Fluxor.Blazor.Web.ReduxDevTools, o.UseReduxDevTools(...) d.UseDevTools(...) in Ducky.Blazor, guarded by IsDevelopment() (Redux DevTools)
community Fluxor.Persist (net8.0, net9.0): UsePersist, IStringStateStorage d.Persist<TSlice>(...) or [Persist]: localStorage, sessionStorage or IDistributedCache (Persistence)
no multi-tab sync Persist<TSlice>(o => o.SyncAcrossTabs = true) (Cross-tab sync)
no prerender state transfer in a release (#547) d.Prerender<TSlice>() (Prerender)
static reducers called directly; Effect<T>.HandleAsync with a mocked IDispatcher SliceTest, EffectTest, TestStore in Ducky.Testing (Testing)

Behaviour changes

Each comes with the test that pins it.

The store works during prerender and static SSR

Fluxor's StoreInitializer initializes the store in OnAfterRenderAsync, which a prerender pass or a static SSR page never reaches, so with it no released version reduces actions or runs effects there; the workaround reported in #547, calling IStore.InitializeAsync() from a component, breaks JavaScript middleware such as Redux DevTools. #547 was closed as completed on 2026-09-03, but as of 2026-11-08 no release contains the change: 6.11.0, of 2026-08-03, is the latest, and the work sits on the unreleased branch 547/PeteM-SSR. A Ducky store initializes on its first use, rendered or not:

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task Store_InitializesOnFirstUse_WithoutAnInitializerComponent()
{
    var api = new FakeCounterApi();
    await using var provider = Registration.AddApp(new ServiceCollection(), api).BuildServiceProvider();
    var store = provider.GetRequiredService<IStore>();

    // No component has rendered: the first dispatch initializes the store, then the action is reduced.
    var result = await store.DispatchAsync(new IncrementCounterAction(1));

    result.ShouldBe(DispatchResult.Reduced);
    store.State.Get<CounterState>().Count.ShouldBe(1);
    await api.Called(0); // and StoreInitialized started the first load
    api.Complete(0, 0); // let the load finish before disposal
    await store.WhenIdleAsync(Xunit.TestContext.Current.CancellationToken);
}

With Prerender<T>, the prerender pass waits until its store is idle, writes the slice into the page's persisted component state, and the interactive store starts from it. The slice reads as restored, so the load rule doesn't load it a second time (Prerender):

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task RestoredSlice_IsNotLoadedAgain()
{
    var api = new FakeCounterApi();
    await using var store = TestStore.Create(
        ducky => ducky.AddSlice<CounterSlice>().AddEffect<LoadCounterOnStart>().AddEffect<LoadCounterEffect>(),
        services => services.AddSingleton<ICounterApi>(api));

    store.Seed(new CounterState(Count: 12, IsLoading: false, Error: null)); // as the prerender seed restores it
    await store.Settled();

    api.Calls.ShouldBe(0);
    store.State.Get<CounterState>().Count.ShouldBe(12);
}

The full prerender-to-interactive handoff is pinned in Ducky's own suite (Prerender_RestoredSlice_LoadEffectRunsOnceAcrossHandoff in test/Ducky.Blazor.Tests/Prerender/PrerenderHandoffTests.cs).

Effects have a concurrency policy and a cancellation token

Fluxor starts every matching effect for every action and awaits them together in the background, with no cancellation token: two quick loads both run to the end, and the one that answers last wins, whatever the order they were dispatched in. A Ducky effect with Switch cancels the running load and drops its late result:

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task SwitchEffect_NewerLoad_CancelsAndDropsTheOlderRun()
{
    var api = new FakeCounterApi(honourCancellation: false); // an API that ignores the token and answers late
    await using var store = TestStore.Create(
        ducky => ducky.AddSlice<CounterSlice>().AddEffect<LoadCounterEffect>(),
        services => services.AddSingleton<ICounterApi>(api));

    store.Dispatch(new LoadCounterAction());
    store.Dispatch(new LoadCounterAction()); // Fluxor would run both loads to completion
    api.Token(0).IsCancellationRequested.ShouldBeTrue();

    api.Complete(1, 5);
    api.Complete(0, 99); // the superseded run answers late: its dispatch is dropped
    await store.Settled();

    store.State.Get<CounterState>().Count.ShouldBe(5);
}

Keep the default Merge where every run must complete, as in Fluxor.

Dispatch returns a DispatchResult

Fluxor's IDispatcher.Dispatch returns void, and no release has a DispatchAsync (the work on #322 is unreleased). Ducky's Dispatch also returns void; await DispatchAsync(...) completes once the action is reduced, before its effects finish, with Reduced, Vetoed, Dropped, Failed or Disposed. The task never faults: a reducer failure is the Failed result and a ReducerFailed action (see the threading contract). To also wait for effects, use WhenIdleAsync().

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task DispatchAsync_CompletesOnceReduced_WithItsResult()
{
    await using var store = TestStore.Create(ducky => ducky.AddSlice<CounterSlice>());

    var result = await store.DispatchAsync(new IncrementCounterAction(2)); // Fluxor's Dispatch returns void

    result.ShouldBe(DispatchResult.Reduced);
    store.State.Get<CounterState>().Count.ShouldBe(2); // read-your-writes, before any effect finished
}

Handlers match the exact action type

Fluxor matches a reducer or an effect with action is TAction, so a handler of a base action also runs for every derived action. Ducky matches the exact type only (ADR-0008): give each action its own On<T>, and DUCKY005 rejects a handler for an abstract type, an interface or object, which could never match.

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task Reducer_MatchesTheExactActionType_NotSubtypes()
{
    await using var store = TestStore.Create(ducky =>
    {
        ducky.ThrowOnUnhandledAction = false; // UrgentNotify has no handler of its own
        ducky.AddSlice<Fixtures.InboxSlice>();
    });

    await store.DispatchAsync(new Fixtures.UrgentNotify("fire")); // a Fluxor [ReducerMethod] for Notify would run
    store.State.Get<Fixtures.Inbox>().Last.ShouldBeNull();

    await store.DispatchAsync(new Fixtures.Notify("mail"));
    store.State.Get<Fixtures.Inbox>().Last.ShouldBe("mail");
}

Registration is generated, not scanned

Fluxor finds features, reducers and effects with a reflection scan at startup; its maintainer notes that this scan is not compatible with Native AOT, while registering features, reducers and effects by hand is (#507). Ducky's generator emits the registration at build time, and its libraries are built with IsAotCompatible and checked by a Native AOT smoke test and a trimmed WebAssembly test (SPEC §10).

BehaviourChangeTests.csfrom a tested file
[Fact]
public async Task GeneratedRegistration_ListsTheSliceAndEffects_WithoutAScan()
{
    var api = new FakeCounterApi();
    await using var store = TestStore.Create(
        ducky => ducky.AddDuckyGenerated_FluxorSample_After(), // emitted at build time: no reflection at startup
        services => services.AddSingleton<ICounterApi>(api).AddSingleton<ActionLog>());

    store.Slices.ShouldHaveSingleItem().ShouldBeOfType<CounterSlice>();
    await store.InitializeAsync(Xunit.TestContext.Current.CancellationToken);
    await api.Called(0); // LoadCounterOnStart and LoadCounterEffect were registered too
    api.Complete(0, 1);
    await store.Settled();
    store.State.Get<CounterState>().Count.ShouldBe(1);
}