Skip to content

added Include() documentation#295

Merged
jeremydmiller merged 1 commit into
JasperFx:masterfrom
nieve:docs
Apr 15, 2016
Merged

added Include() documentation#295
jeremydmiller merged 1 commit into
JasperFx:masterfrom
nieve:docs

Conversation

@nieve

@nieve nieve commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

Hopefully I'll get 'overriding schema & doc names' done tomorrow.

@jeremydmiller jeremydmiller merged commit 97ca2bc into JasperFx:master Apr 15, 2016
@nieve nieve deleted the docs branch April 15, 2016 12:24
jeremydmiller added a commit that referenced this pull request May 19, 2026
* #276 Phase 2: Adopt FEC-free source-generated projection dispatch

JasperFx 2.0 retired the FastExpressionCompiler fallback inside
`JasperFx.Events.Aggregation` / `EventProjectionApplication`. Projection
dispatch in Marten 9 now flows exclusively through the SG-emitted
`[GeneratedEvolver]` partial classes produced by
`JasperFx.Events.SourceGenerator`. This commit picks up the new
JasperFx alphas and migrates Marten's test corpus + docs samples onto
the FEC-free path.

* `Directory.Packages.props`:
  - `JasperFx` 2.0.0-alpha.13 → 2.0.0-alpha.14
  - `JasperFx.Events` 2.0.0-alpha.12 → 2.0.0-alpha.13
  - `JasperFx.Events.SourceGenerator` 2.0.0-alpha.5 → 2.0.0-alpha.6

* Test / sample migration to the method-convention shape:
  - Every projection subclass exercised by the test suite is now
    `partial class` so the SG can emit the dispatcher beside it. ~80
    files touched across `src/EventSourcingTests`, `src/DaemonTests`,
    `src/CoreTests`, `src/DocumentDbTests`, `src/MultiTenancyTests`,
    `src/Marten.Testing`, `src/samples/**`.
  - The two pure inline-lambda regression files
    (`when_using_inline_lambdas_to_define_immutable_projection.cs`,
    `when_using_inline_lambdas_to_define_the_projection.cs`) are
    removed — their entire purpose was exercising the removed
    `ProjectEvent<T>(...)` / `CreateEvent<T>(...)` / `DeleteEvent<T>(predicate)`
    overloads.
  - Misc xUnit fixtures and aggregate records updated to satisfy the SG
    constraints carried into 9.0 (parents made `partial` where they
    host nested projections; collision-prone names made unique;
    private parameterless ctors changed to public where the test
    pattern needed it).
  - `samples/EventSourcingIntro/Program.cs` and the Helpdesk
    `Incidents/*` samples migrated to the method-convention shape so
    docs snippets resolve.
  - `docs/events/projections/*.md` re-rendered via mdsnippets after
    the underlying source moved.

* SG analyzer wiring on consumer test projects:
  - `Marten.csproj` keeps `PrivateAssets="all"` on the SG package, so
    the analyzer doesn't flow transitively. Test projects that declare
    their own projection / aggregate types now reference the SG
    package directly as an analyzer:
    `CoreTests.csproj`, `DocumentDbTests.csproj`,
    `MultiTenancyTests.csproj`, `ValueTypeTests.csproj`. Mirrors the
    existing wiring on `EventSourcingTests` / `DaemonTests`.

* Validation-rule tests retired:
  - `aggregation_projection_validation_rules.blow_on_soft_deleted_aggregates`,
    `find_bad_method_names_that_are_not_ignored`, `missing_required_parameter`
    asserted on specific old-runtime error messages that no longer fire —
    the SG silently skips signatures it can't dispatch. Removed with
    inline comments pointing at the new behavior; covered in the
    migration guide entry [Aggregation method visibility now required
    to be public].
  - `Bug_3665_compiling_with_private_members` deleted — explicitly
    tested the private-member dispatch pattern which 9.0 drops.

* Documented limitations skipped:
  - `stream_aggregation.stream_id_is_set_as_string` skipped — uses
    `opts.Schema.For<T>().Identity(x => x.Key)` runtime override which
    the source generator can't see at compile time.
    Annotate the member with `[Identity]` instead in 9.0.
  - `rebuilds_with_serialization_or_poison_pill_events.rebuild_the_projection_skip_failed_events`
    skipped pending JasperFx/jasperfx#303 — SG-emitted
    `IGeneratedSyncDetermineAction` batches events in a single call,
    so per-event dead-letter routing under `SkipApplyErrors=true` no
    longer fires.

Validation: full Marten test run against the published NuGets:
| Project | Pass / Fail / Skip |
|---|---|
| EventSourcingTests | 1,320 / 0 / 7 |
| DaemonTests | 183 / 0 / 1 |
| CoreTests | 444 / 0 / 1 |
| DocumentDbTests | 987 / 0 / 1 |
| MultiTenancyTests | 128 / 0 / 0 |
| PatchingTests | 122 / 0 / 1 |
| LinqTests | 1,257 / 0 / 1 |
| CompiledQueryTests | 9 / 0 / 0 |

Pre-existing failures not introduced by this work:
- `ValueTypeTests` — 127 strong-typed-id failures
  (tracked in marten#4474, milestoned 9.0)
- `Marten.CommandLine.Tests` — compile errors on master too
  (`IProjectionStore` / `ProjectionLifecycle` / `AsyncProjectionShard`
   missing after a JasperFx rename)

Refs: JasperFx/jasperfx#276 (Phase 1 — FEC retirement), #290, #292,
#293, #295, #297, #298, #303.

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

* docs: 9.0 migration entries for the new dispatch-pattern requirements

* Aggregation method visibility now required to be `public` — pre-9.0
  reflection picked up private / internal / protected handlers; the
  SG-emitted dispatcher can only invoke `public` members of the user's
  type. Migration table covers private `Apply` / `ShouldDelete`, the
  event-shaped ctor case, and the `GetUninitializedObject` fallback
  the SG uses when the parameterless ctor is non-public (field
  initializers do not run in that fallback — call out for users who
  rely on them).
* Identity-by-attribute on non-`Id` members — Marten 9 respects
  `[Identity]` at compile time. Documents the workaround for
  aggregates configured via the runtime `Schema.For<T>().Identity(x => ...)`
  override (annotate the member, or rename to `Id`).
* Required-member aggregates — the SG emits
  `new T { Required = default! }` for the null-snapshot branch and
  immediately runs Apply; users who need explicit construction can
  add a `static T Create(SomeEvent e)` method instead.
* Validation-rule behavior changes — old-runtime
  `InvalidProjectionException` messages around unrecognized method
  names, missing aggregate parameters, and soft-delete + conventional-
  method conflicts are no longer thrown; the SG silently skips
  signatures it can't dispatch.

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

* Bump Marten to 9.0.0-alpha.3

Cuts the alpha that consumes JasperFx 2.0.0-alpha.14 /
JasperFx.Events 2.0.0-alpha.13 / JasperFx.Events.SourceGenerator
2.0.0-alpha.6 and the FEC-free source-generated projection dispatch
landed in this PR.

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

* docs: fix markdownlint MD004 unordered-list style in 9.0 migration entry

The two bullet lists I added under the new dispatch-pattern sections used
`-` bullets; the repo's markdownlint config expects `*`. Swap to `*` to
clear the 7 MD004 errors on the docs-prs workflow.

---------

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.

2 participants