Skip to content

Annotate JasperFx.Events Aggregation cluster for AOT (#262, slice 1/4)#264

Merged
jeremydmiller merged 1 commit into
mainfrom
feature/aot-events-aggregation-262
May 13, 2026
Merged

Annotate JasperFx.Events Aggregation cluster for AOT (#262, slice 1/4)#264
jeremydmiller merged 1 commit into
mainfrom
feature/aot-events-aggregation-262

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

First of four slices that mirror the JasperFx-side cleanup pattern (#252-#255 + #260) on the JasperFx.Events side, tracked by #262.

The aggregator graph (AggregateApplication and friends) reflects TAggregate / TProjection to discover Create/Apply/ShouldDelete handlers, builds delegates via Expression.Call + FastExpressionCompiler.CompileFast, and threads event types via IEvent<T>.MakeGenericType. Both aggregate and event types are preserved at the registered projection boundary (caller-side generic parameters that trimming sees). AOT consumers should rely on the source-generated evolver from JasperFx.Events.SourceGenerator per the AOT publishing guide.

Applied class-level [UnconditionalSuppressMessage]:

File Codes
Aggregation/AggregateApplication (primary partial — covers Register/Creating/Applies/ShouldDelete) IL2026/IL2070/IL2072/IL2075/IL2077/IL2087/IL2090/IL3050
Aggregation/JasperFxAggregationProjectionBase IL2065/IL2067/IL2070/IL2072/IL2075/IL2090
Aggregation/JasperFxMultiStreamProjectionBase IL2026/IL2087
Aggregation/CreateMethodCollection IL2070/IL2072/IL3050
Aggregation/ApplyMethodCollection IL3050
Aggregation/AggregateVersioning<T> + <T,TQuerySession> IL2026/IL2090

Warning delta

JasperFx.Events.csproj IL warnings: 240 → 130 (-110).

Slicing plan (from #262)

  • Aggregation slice (this PR) — Aggregation/*.cs (~110 warnings)
  • Projection slice — EventProjectionApplication.cs (~72 warnings)
  • Tags/EventSlice/StreamAction/IEvent slice (~34 warnings)
  • MultiStream + CodeGenerationExtensions tail (~remaining)

Test plan

  • dotnet build src/JasperFx.Events/JasperFx.Events.csproj -c Debug — 0 errors, -110 IL warnings
  • dotnet build src/EventTests/EventTests.csproj -c Debug — 0 errors
  • CI passes

Refs #262 #213

🤖 Generated with Claude Code

First of four slices that mirror the JasperFx-side cleanup pattern (#252-#255
+ #260) on the JasperFx.Events side, tracked by #262.

The aggregator graph (AggregateApplication and friends) reflects TAggregate /
TProjection to discover Create/Apply/ShouldDelete handlers, builds delegates
via Expression.Call + FastExpressionCompiler.CompileFast, and threads event
types via IEvent<T>.MakeGenericType. Both aggregate and event types are
preserved at the registered projection boundary (caller-side generic
parameters that trimming sees). AOT consumers should rely on the
source-generated evolver from JasperFx.Events.SourceGenerator per the AOT
publishing guide.

Apply class-level [UnconditionalSuppressMessage] with justifications:
- Aggregation/AggregateApplication (primary partial — covers Register/
  Creating/Applies/ShouldDelete): IL2026/IL2070/IL2072/IL2075/IL2077/
  IL2087/IL2090/IL3050
- Aggregation/JasperFxAggregationProjectionBase: IL2065/IL2067/IL2070/
  IL2072/IL2075/IL2090
- Aggregation/JasperFxMultiStreamProjectionBase: IL2026/IL2087
- Aggregation/CreateMethodCollection: IL2070/IL2072/IL3050
- Aggregation/ApplyMethodCollection: IL3050
- Aggregation/AggregateVersioning<T> + <T,TQuerySession>: IL2026/IL2090

240 → 130 unique IL warnings (-110) in JasperFx.Events.csproj.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 8e0cdc4 into main May 13, 2026
1 check passed
thechucklingatom pushed a commit to thechucklingatom/jasperfx that referenced this pull request May 19, 2026
…lice 2/4)

Second slice in the JasperFx.Events AOT propagation cleanup (JasperFx#262), following
the Aggregation slice (JasperFx#264).

EventProjectionApplication and its supporting types (ProjectionGraph,
JasperFxEventProjectionBase, CodeGenerationExtensions, ReflectionExtensions,
ScopedAggregationWrapper, ProjectionStage, InvalidEventToStartAggregateException)
reflect on projection / event types to build handler delegates via Expression
trees + FastExpressionCompiler.CompileFast. The projection and event types
are preserved at the registered projection boundary on the caller side. AOT
consumers should rely on JasperFx.Events.SourceGenerator-emitted helpers per
the AOT publishing guide.

Apply class-level [UnconditionalSuppressMessage] with justifications:
- Projections/EventProjectionApplication (outer + nested CreatorBuilder<T>):
  IL2026/IL2062/IL2072/IL2075/IL2087/IL3050
- Projections/ProjectionGraph: IL2072
- Projections/JasperFxEventProjectionBase: IL2075
- Projections/CodeGenerationExtensions: IL2067/IL2072
- Projections/ReflectionExtensions: IL2070
- Projections/ContainerScoped/ScopedAggregationWrapper: IL2087
- Projections/Composite/ProjectionStage: IL2026 (OptionsDescription diagnostic)
- Projections/InvalidEventToStartAggregateException: IL3050 (error-message
  formatter on the exception path)

240 → 176 unique IL warnings (-64) in JasperFx.Events.csproj.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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