Skip to content

[Master] JasperFx 2.0 #215

@jeremydmiller

Description

@jeremydmiller

Status: in-flight (alpha — JasperFx-side foundations largely shipped; [Obsolete] sweep continues per #273)
Target version: JasperFx 2.0
Milestone: 2.0
Part of [Master] Critter Stack 2026 (#217).
Pillars: cold-start (#212), AOT compliance (#213), dedupe Marten ↔ Polecat (#214).

JasperFx is the foundational layer of the Critter Stack — CLI framework, runtime/source-generator code generation, multi-tenancy primitives, descriptors, IoC conventions, and shared utilities. JasperFx 2.0 is the substrate that the rest of the 2026 wave (Marten 9, Wolverine 6, Polecat 4, CritterWatch 1.0, JasperFx.Events 2.0) builds against.

Goals for 2.0

  1. AOT-clean foundation. All JasperFx + JasperFx.Events public APIs either compile AOT-clean or carry precise [RequiresDynamicCode] / [RequiresUnreferencedCode] annotations so downstream apps can publish with PublishAot=true.
  2. Roslyn becomes opt-in. Apps in Static TypeLoadMode do not transitively reference Microsoft.CodeAnalysis.* in their production deployment. The JasperFx.RuntimeCompiler package is the explicit opt-in.
  3. Deterministic, byte-stable codegen. dotnet run -- codegen write produces source files that are byte-identical to the in-memory output of Dynamic mode, so pre-generated code is a reliable build artifact.
  4. Breaking-change cleanup. Accumulated obsoletes and shape mismatches that have been waiting for a major version are removed in this wave.

Out of scope for JasperFx 2.0

  • New unrelated features. 2.0 is a foundation release; greenfield features wait for 2.x.
  • Native-AOT-publishing the Roslyn pipeline itself (the AssemblyGenerator is dev-time only by design).

✅ Already shipped (2.0 branch)

Foundation cutover

  • 1.0 maintenance branch frozen at the last 1.x main commit
  • 2.0 becomes the new main; all packages versioned 2.0.0-alpha.1
    • JasperFx, JasperFx.Events, JasperFx.Events.SourceGenerator, JasperFx.SourceGeneration, JasperFx.SourceGenerator
    • JasperFx.RuntimeCompiler intentionally left at 4.5.0 until its own next version
  • Drop .NET 8 support. Target frameworks are now net9.0;net10.0. net11.0 will be added when the runtime ships.
  • CI workflows + Nuke build script updated; dead ActivityExtensions.AddException polyfill removed; obsolete NET8_0_OR_GREATER #if blocks inlined.

Pillar work (see pillar issues for full detail)


What's left

Cold-start (#212)

  • Audit remaining JasperFx + JasperFx.Events hot paths for per-call MakeGenericType / Activator.CreateInstance and migrate to GenericFactoryCache or source-generator equivalents.
  • CLI: confirm dotnet run -- codegen write produces byte-identical output to Static mode reads — investigate residual asymmetry around namespace ordering and TFM-conditional emit.

AOT (#213)

  • Set IsAotCompatible=true on JasperFx.csproj and JasperFx.Events.csproj so the AOT analyzer runs in our own CI.
  • Audit every remaining MakeGenericType / Activator.CreateInstance / Type.GetMethod(...).Invoke in JasperFx + JasperFx.Events; annotate or migrate.
  • Audit reflective discovery in JasperFx.CommandLine (assembly scanning for IJasperFxCommand) — annotate or replace with the existing source generator.
  • Add an AOT-clean smoke-test consumer project in CI: tiny app referencing JasperFx + JasperFx.Events in Static mode with IsAotCompatible=true. Build fails on any IL2026/IL3050 warning.

Dedupe (#214) — JasperFx-side foundations

  • JasperFx.Events API surface review: confirm the abstractions Marten + Polecat both consume are stable enough to be the canonical home. (Detailed in the JasperFx.Events 2.0 master plan.)
  • Promote any JasperFx-side helpers showing up in both Marten and Polecat (multi-tenancy, descriptors, codegen primitives) into clearly-named modules so the boundary is obvious to consumers.

Breaking-change cleanup

Pre-existing 2.0 milestone issues — folded in here for tracking:

Documentation

  • End-to-end "publish AOT with JasperFx" guide (Static mode, no AddRuntimeCompilation, code pre-generated via codegen write).
  • Migration guide from JasperFx 1.x → 2.0 (TFM bump, RuntimeCompiler package split, API removals). (PR Add JasperFx 1.x → 2.0 migration guide #242, docs/migration-guide.md.)

Cross-product dependencies

  • Marten 9 / Wolverine 6 / Polecat 4 / CritterWatch 1.0 all build against this. The shape of JasperFx 2.0's public API and AOT annotations needs to stabilize before downstream products can finalize their own AOT audits.
  • JasperFx.Events 2.0 (separate master plan) ships in lockstep with JasperFx 2.0 — same package version line.

Linked implementation work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions