Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOT compatibility #621

Merged
merged 1 commit into from
Jun 6, 2024
Merged

AOT compatibility #621

merged 1 commit into from
Jun 6, 2024

Conversation

mburumaxwell
Copy link
Contributor

This replaces IsTrimmable with IsAotCompatible which contains better analyzers. As a result, the deserialize and consume logic has been updated to handle specifics such as generics that cannot be inferred in AOT.

Initial support for trimming in #564 did not have support for JSON serializer. Using the slim event bus meant you needed to create your own serialzier and register it as a default. With this PR, the DefaultJsonEventSerializer support the use of a JsonSerializerContext where each event has been declared as EventEnvelope<TEvent>

A sample that supports AOT has been added to show how to work with it. This also helps during test and development.

This replaces `IsTrimmable` with `IsAotCompatible` which contains better analyzers. As a result, the deserialize and consume logic has been updated to handle specifics such as generics that cannot be inferred in AOT.

Initial support for trimming in #564 did not have support for JSON serializer. Using the slim event bus meant you needed to create your own serializer and register it as a default. With this PR, the `DefaultJsonEventSerializer` support the use of a `JsonSerializerContext` where each event has been declared as `EventEnvelope<TEvent>`.

Consequently, registration of consumers requires explicit events as shown in the sample
@mburumaxwell mburumaxwell merged commit 8b9bc60 into main Jun 6, 2024
8 checks passed
@mburumaxwell mburumaxwell deleted the IsAotCompatible branch June 6, 2024 07:35
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