Skip to content

docs(dotnet-next): AOT-compatible serializer changes - #6

Open
alexeyzimarev wants to merge 1 commit into
mainfrom
docs/aot-serializer
Open

docs(dotnet-next): AOT-compatible serializer changes#6
alexeyzimarev wants to merge 1 commit into
mainfrom
docs/aot-serializer

Conversation

@alexeyzimarev

Copy link
Copy Markdown
Contributor

Companion to Eventuous/eventuous#524 — do not merge before that PR.

Updates the dotnet-next serialisation page for the serializer split:

  • DefaultStaticEventSerializer with a JsonSerializerContext as the recommended, AOT-safe default
  • Reflection-based DefaultEventSerializer moved to the Eventuous.Serialization.Json.Dynamic package
  • EventSerializer.SetDefault() replacing DefaultEventSerializer.SetDefaultSerializer()
  • Note that constructing DefaultEventSerializer in trimmed/AOT apps produces IL2026/IL3050 warnings at the construction site (by design — the constructor carries RequiresUnreferencedCode/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

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>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant