docs(dotnet-next): AOT-compatible serializer changes - #6
Conversation
Documents the serializer split from Eventuous/eventuous#524: DefaultStaticEventSerializer (AOT-safe, recommended) vs the reflection-based DefaultEventSerializer moved to the Eventuous.Serialization.Json.Dynamic package, the new EventSerializer.SetDefault registration, and the IL2026/IL3050 warnings emitted when constructing the reflection serializer in trimmed or AOT applications. This content was originally authored in the library repo's docs directory before the docs moved here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
eventuous-docs | 009e921 | Commit Preview URL Branch Preview URL |
Jul 30 2026, 03:28 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 009e92126c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [JsonSerializable(typeof(RoomBooked))] | ||
| [JsonSerializable(typeof(BookingPaid))] | ||
| [JsonSerializable(typeof(BookingCancelled))] | ||
| public partial class BookingSerializerContext : JsonSerializerContext; |
There was a problem hiding this comment.
Give the serializer context a class body
When users copy this recommended AOT example, the C# compiler rejects the semicolon-only declaration because a normal class—unlike a positional record—requires a body. Declare the partial context with { } so the source generator example compiles.
Useful? React with 👍 / 👎.
Companion to Eventuous/eventuous#524 — do not merge before that PR.
Updates the dotnet-next serialisation page for the serializer split:
DefaultStaticEventSerializerwith aJsonSerializerContextas the recommended, AOT-safe defaultDefaultEventSerializermoved to theEventuous.Serialization.Json.DynamicpackageEventSerializer.SetDefault()replacingDefaultEventSerializer.SetDefaultSerializer()DefaultEventSerializerin trimmed/AOT apps produces IL2026/IL3050 warnings at the construction site (by design — the constructor carriesRequiresUnreferencedCode/RequiresDynamicCode)This page update was originally authored in the library repo's
docs/directory in #524 before the docs moved to this repo; the lib PR no longer touches docs.🤖 Generated with Claude Code