From 4e2ad6dff997713e86f52c8e4cdc59f6a386aca6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:50:38 +0000 Subject: [PATCH 1/2] Initial plan From bcd35d8b06412ebb08db6274785d378fe9ce82ff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:53:58 +0000 Subject: [PATCH 2/2] Update CHANGELOG for v1.3.0 and update Packages.md Co-authored-by: leeoades <2321091+leeoades@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ docs/Packages.md | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a267751..a65bad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this ## [Unreleased] +## [1.3.0] - 2026-02-23 + +### Added +- **⚡ AOT and trim compatibility** — `FunctionalStateMachine.Core` and `FunctionalStateMachine.CommandRunner` are now fully compatible with NativeAOT (`PublishAot=true`), trimming (`PublishTrimmed=true`), and single-file publishing (`PublishSingleFile=true`) when targeting `net8.0+` +- **🔧 Source-generated trigger registry** — New `FunctionalStateMachine.Core.Generator` Roslyn source generator bundled automatically inside the `FunctionalStateMachine.Core` NuGet package + - Detects all `StateMachine<…, TTrigger, …>.Create()` call sites at compile time and registers concrete trigger subtypes via a `[ModuleInitializer]` + - Replaces the previous reflection-based trigger type discovery (`Assembly.GetTypes()`) with zero-reflection runtime code + - Enables unused-trigger analysis on AOT and trimmed builds without any extra configuration +- **📦 Multi-targeting** — `FunctionalStateMachine.Core` and `FunctionalStateMachine.CommandRunner` now ship both `netstandard2.0` and `net8.0` builds in the same NuGet package; the correct build is selected automatically by NuGet +- **🔁 Multiple state machines sharing a trigger type** — Multiple state machines in the same project that share a `TTrigger` base type are fully supported; the generator registers trigger types once (deduplicated) and each machine independently reports unused triggers at `.Build()` time +- **📚 New documentation pages** + - `docs/AOT-and-Trim-Compatibility.md` — Complete guide covering NativeAOT, `PublishTrimmed`, single-file publishing, and how the source generator eliminates reflection + - `docs/Target-Framework-Compatibility.md` — Framework targeting guide describing what each target (`netstandard2.0` vs `net8.0`) provides + ## [1.2.0] - 2026-02-19 ### Added diff --git a/docs/Packages.md b/docs/Packages.md index 7c3d782..a17c3bc 100644 --- a/docs/Packages.md +++ b/docs/Packages.md @@ -7,6 +7,8 @@ This library is split into a few packages so you can reference only what you nee The core state machine implementation. Most consumers should reference this package otherwise what are you even doing here? 🤣 +It includes a bundled source generator (`FunctionalStateMachine.Core.Generator`) that registers your trigger types at compile time. This enables unused-trigger analysis and makes the library fully compatible with NativeAOT and `PublishTrimmed` — no extra package reference needed. + ## FunctionalStateMachine.CommandRunner Optional command runner integration that dispatches commands through DI. @@ -16,7 +18,7 @@ Use it when you want: - Command handlers as DI-resolved classes. - A built-in provider to run commands returned by the state machine. -Note: It includes a source generator so the disptacher does not use reflection. +Note: It includes a source generator so the dispatcher does not use reflection. ## FunctionalStateMachine.Diagrams