Skip to content

F# pre-generated code via codegen write --language fsharp; JasperFx 2.4.1 (6.3.1)#2998

Merged
jeremydmiller merged 2 commits into
mainfrom
feat-fsharp-codegen-write
Jun 1, 2026
Merged

F# pre-generated code via codegen write --language fsharp; JasperFx 2.4.1 (6.3.1)#2998
jeremydmiller merged 2 commits into
mainfrom
feat-fsharp-codegen-write

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Completes the Wolverine-on-F# story — pre-generate Wolverine's runtime code as F# from the command line — and cuts 6.3.1.

JasperFx side (already published as 2.4.1)

JasperFx 2.4.1 (JasperFx/jasperfx#406) adds a --language flag to the codegen command:

dotnet run -- codegen write --language fsharp

Wolverine side (this PR)

  • Pin JasperFx.* → 2.4.1.
  • F# emit for the static HandlerRegistry (WriteTypeArrayFrame): emits F# array literals of typeof<…> via Type.FSharpName(). This frame previously threw NotSupportedException, which made codegen write --language fsharp fail for any real Wolverine app — every app generates the internal HandlerRegistry, not just user handlers. This is the "& Wolverine" half of the work.
  • Made Wolverine.Behavioural.FSharpApp runnable (a Program.fs calling RunJasperFxCommands, with discovery config matching BehaviouralCodegen.Configure) so the CLI can target it.
  • New CI proof (CodegenWriteFSharpCli): runs dotnet run -- codegen write --language fsharp against the F# app, asserts exit 0 (every chain — including the internal HandlerRegistry — emits F#), and that the generated handler adapter is byte-identical to the committed Generated.fs that the behavioural run-step already compiles and executes under TypeLoadMode.Static. So: the CLI produces the same F# that's proven to run. (Behavioural F# test classes serialized into one non-parallel collection — they spawn nested dotnet build/run.)
  • fsharp CI step updated to cover the CLI proof.
  • F# tutorial: documents the codegen write --language fsharp workflow and the ordered <Compile> includes F# requires.
  • Version → 6.3.1.

Verification

  • dotnet build wolverine.slnx -c Release clean against JasperFx 2.4.1.
  • ✅ Behavioural F# tests (run-step + regenerate + new CLI proof) pass; locally confirmed the CLI-generated GeneratedHandlerRegistry.fs compiles.
  • ✅ VitePress docs build clean.

Merge-order note

This bumps Directory.Packages.props JasperFx pins to 2.4.1, superseding the 2.4.0 bump in the still-open #2997 (docs/Aspire). Merge this after, or rebase #2997, to avoid a downgrade.

🤖 Generated with Claude Code

jeremydmiller and others added 2 commits June 1, 2026 07:01
….4.1 (6.3.1)

Completes the Wolverine-on-F# story: pre-generate Wolverine's runtime code as F#
from the CLI.

- Pin JasperFx.* to 2.4.1 (adds the codegen `--language fsharp` flag).
- Add F# emit to the static HandlerRegistry frame (WriteTypeArrayFrame): F# array
  literals of typeof<...> via Type.FSharpName(). Previously this threw
  NotSupportedException, which made `codegen write --language fsharp` fail for ANY
  real Wolverine app (every app generates the internal HandlerRegistry, not just
  user handlers).
- Make Wolverine.Behavioural.FSharpApp a runnable exe (Program.fs + RunJasperFxCommands,
  config matching BehaviouralCodegen.Configure) so the CLI can target it.
- New CI proof (CodegenWriteFSharpCli): runs `dotnet run -- codegen write --language
  fsharp` against the F# app, asserts exit 0 (every chain emits F#) and that the
  generated adapter is byte-identical to the committed Generated.fs the behavioural
  run-step already compiles + executes under TypeLoadMode.Static. Behavioural F#
  test classes serialized into one non-parallel collection (nested dotnet build/run).
- fsharp CI step updated to cover the CLI proof.
- F# tutorial: document the `codegen write --language fsharp` workflow + the .fsproj
  ordered <Compile> includes.
- Wolverine 6.3.1.

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

# Conflicts:
#	Directory.Build.props
#	Directory.Packages.props
@jeremydmiller jeremydmiller merged commit 0c9413c into main Jun 1, 2026
24 checks passed
This was referenced Jun 2, 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.

1 participant