Skip to content

[Master] JasperFx.Events 2.0 #216

@jeremydmiller

Description

@jeremydmiller

Status: in-flight (alpha — JasperFx-side foundations shipped; descriptor surface stabilization continues alongside CritterWatch 1.0)
Target version: JasperFx.Events 2.0
Milestone: 2.0
Part of [Master] Critter Stack 2026 (#217).
Sibling: JasperFx 2.0 master plan (#215).
Pillars: cold-start (#212), AOT compliance (#213), dedupe Marten ↔ Polecat (#214).

JasperFx.Events holds the database-agnostic abstractions for event sourcing across the Critter Stack — projections, daemon plumbing, slicing/grouping, event metadata, and the descriptors that CritterWatch consumes. The 2.0 wave promotes it from "shared utility" toward "canonical home" for any event-sourcing concept that isn't database-specific, per the dedupe pillar's Rule 1.

Goals for 2.0

  1. Canonical home for non-database event-sourcing logic. Anything currently duplicated between Marten and Polecat that satisfies Rule 1 of pillar [Pillar] Dedupe Marten ↔ Polecat #214 lives here, not in either product repo.
  2. Stable public API. Abstractions that Marten 9 and Polecat 4 both consume — IInlineProjection, ProjectionBase, SliceGroup, daemon contracts, descriptors — finalized in shape before either product cuts its release.
  3. AOT-clean. IsAotCompatible=true on the csproj; reflective surfaces annotated; no per-call generic instantiation on event-dispatch hot paths that isn't going through GenericFactoryCache or a source generator.
  4. CritterWatch-driven descriptor surface stabilized. The descriptor types (EventStoreUsage, DocumentStoreUsage, IHttpGraphUsageSource, DbContextUsage, etc.) that CritterWatch consumes for diagnostics need their public contracts locked for 2.0.

Out of scope for JasperFx.Events 2.0

  • Database-specific event-store implementations (those stay in Marten / Polecat).
  • Package rename. JasperFx.Events keeps its name; name recognition lives with Marten today and will follow with Polecat (per pillar [Pillar] Dedupe Marten ↔ Polecat #214 Rule 5).

✅ Already shipped (2.0 branch)

API shape changes

  • Widen IInlineProjection.ApplyAsync — propagates through JasperFxSingleStreamProjectionBase, JasperFxMultiStreamProjectionBase, JasperFxEventProjectionBase, and the ContainerScoped wrappers. Breaking signature change; justifies the major version bump on its own.
  • Add GenerationRules.Clone — enables downstream products to fork the generation rules cleanly per projection / handler shard.
  • Package version bumped to 2.0.0-alpha.1 alongside JasperFx (lockstep release).

Pre-2.0-cutover landings (shipped on main, now part of the 2.0 foundation)

CritterWatch descriptor surface (recent main commits, carried into 2.0)


What's left

Dedupe pillar (#214) — JasperFx.Events as canonical home

Per pillar #214's Rule 1, the following abstractions are scoped to land or be confirmed here:

  • API surface review — confirm the abstractions Marten + Polecat both consume are stable enough to be the canonical home. Some surfaces are still 1.x-shaped and should be revisited under the major-version window.
  • Async daemon abstractions — confirm the JasperFx.Events surface is sufficient for both Marten 9 and Polecat 4 daemons; pull up anything that's still duplicated. (PR Lift IEventStream, session API + daemon contracts to JasperFx.Events … #268 lifted session API + daemon contracts.)
  • Projection lifecycle / sharding — finalize ProjectionBase, IInlineProjection, slicers as the shared baseline.
  • Event grouping / multi-stream slicingSliceGroup is partially shared; finish the consolidation.
  • Enum sweep — any enum present in both Marten and Polecat moves here (or to Weasel.Core if database-specific).

AOT (#213)

Cold-start (#212)

CritterWatch descriptor stabilization

  • Lock public contracts on the descriptor types CritterWatch consumes (EventStoreUsage, DocumentStoreUsage, HTTP descriptors, DbContextUsage). Any breaking shape changes happen during 2.0 alpha; once 2.0 stabilizes, descriptor additions are additive only.
  • Coordinate with the CritterWatch 1.0 master plan to fold in any in-flight descriptor PRs that should land in this wave (per the user's note: "I want to shift several of the ongoing pull requests meant for CritterWatch into this wave as well").

Documentation

  • Migration notes for downstream projection / slicer authors covering the IInlineProjection.ApplyAsync widening and any surface that moves under the dedupe rules. (docs/migration-guide.md, "IInlineProjection<TOperations>.ApplyAsync parameter widened" section.)

Cross-product dependencies

  • Marten 9 and Polecat 4 both consume the abstractions stabilized here. Their AOT audits cannot complete until JasperFx.Events 2.0's annotation pass is done.
  • CritterWatch 1.0 consumes the descriptor surface — descriptor stabilization is a shared deliverable between this plan and the CritterWatch master plan.
  • JasperFx 2.0 (sibling, [Master] JasperFx 2.0 #215) ships at the same version; both packages release together as the foundation.

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