Skip to content

docs: "Using Wolverine with F#" tutorial (GH-2969)#2988

Merged
jeremydmiller merged 1 commit into
mainfrom
docs-2969-fsharp-tutorial
May 30, 2026
Merged

docs: "Using Wolverine with F#" tutorial (GH-2969)#2988
jeremydmiller merged 1 commit into
mainfrom
docs-2969-fsharp-tutorial

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

@jeremydmiller jeremydmiller commented May 29, 2026

Closes #2969.

Adds a "Using Wolverine with F#" tutorial (docs/tutorials/fsharp.md, wired into the Tutorials sidebar) documenting the F# code-generation story landed across #2983#2987:

  • authoring handlers in F#,
  • what Wolverine generates as F# (shown for a minimal handler),
  • and running on pre-generated F# code under TypeLoadMode.Static (the headline: no runtime Roslyn),
  • plus the per-integration examples (EF Core, Marten documents, Marten event sourcing, FluentValidation, CosmosDB) and the F# gotchas (RuntimeCompilation for dynamic codegen, Evolve-override for aggregates, RuleFor auto-quotation, [<CLIMutable>]).

Live snippets from the F# samples

All code is pulled via mdsnippets from the runnable F# samples + the behavioural test, so it stays in sync. mdsnippets already scans .fs (verified — no mdsnippets.json change needed); F# uses the comment-based // begin-snippet: / // end-snippet markers. Snippets added across the samples:
sample_fsharp_efcore_handler, _efcore_bootstrap, _behavioural_handler, _static_host, _marten_document_handler, _aggregate_handler, _aggregate_projection, _fluentvalidation_validator, _cosmos_handler.

The generated F# adapter is shown as a static fenced block (its Generated.fs is regenerated by the gate, so it can't carry persistent snippet markers).

Verification

  • mdsnippets resolves all 9 snippets (exit 0); the page is fully populated.
  • All F# samples still compile (wolverine_fsharp.slnx clean) and the behavioural test stays green — the markers are F# comments.
  • Note: a full local vitepress build wasn't run (docs node_modules not installed here); the page uses only standard Vitepress constructs and the sidebar entry mirrors the existing ones.

🤖 Generated with Claude Code

A new tutorial (docs/tutorials/fsharp.md, wired into the Tutorials sidebar) covering
F# handler authoring, what Wolverine generates as F#, and running on pre-generated
F# code under TypeLoadMode.Static.

Pulls live code via mdsnippets from the F# samples + the behavioural test (mdsnippets
already scans .fs, so no config change was needed; F# uses the comment-based
// begin-snippet / // end-snippet markers). Snippets added:
- sample_fsharp_efcore_handler / _efcore_bootstrap (WolverineFSharpSample)
- sample_fsharp_behavioural_handler (Wolverine.Behavioural.FSharpApp) + the static host
  config (sample_fsharp_static_host, Wolverine.Behavioural.FSharpTests)
- sample_fsharp_marten_document_handler, _aggregate_handler, _aggregate_projection
- sample_fsharp_fluentvalidation_validator, _cosmos_handler

The generated F# adapter is shown as a static block (Generated.fs is regenerated, so it
can't carry persistent snippet markers). All samples still compile and the behavioural
test stays green (the markers are F# comments).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 4bcf29c into main May 30, 2026
24 checks passed
This was referenced Jun 1, 2026
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.

F# code generation audit: teach every Frame subclass to emit F# (phased)

1 participant