Skip to content

docs: document Native AOT guidance and fix [PromptBindable] code examples (#412) - #413

Open
mkarimdev wants to merge 1 commit into
shibayan:masterfrom
mkarimdev:docs/native-aot-guidance
Open

mkarimdev wants to merge 1 commit into
shibayan:masterfrom
mkarimdev:docs/native-aot-guidance

Conversation

@mkarimdev

Copy link
Copy Markdown

Fixes #412

Summary of Changes

  1. Fixed Prompt.Bind Documentation Examples:

    • Added using Sharprompt; and [PromptBindable] attributes across model examples in README.md, docs/en/prompt-types/bind.md, and docs/ja/prompt-types/bind.md to resolve runtime InvalidOperationException issues for new users.
    • Documented model requirements (class type, public parameterless constructor, accessible setters).
    • Documented [MemberItems] usage and CancellationToken support in Prompt.Bind.
  2. Documented Native AOT & Roslyn Source Generators:

    • Added a dedicated "Native AOT & Source Generators" section in docs/en/advanced.md and docs/ja/advanced.md.
    • Documented project configuration (<PublishAot>true</PublishAot>) and publish CLI commands.
    • Clarified enum metadata handling (source-generated module initializers for local enums vs. reflection fallback/EnumMetadataRegistry.Register<TEnum>() for external assembly enums).
    • Documented TypeConverter behavior under trimming.
  3. Sample Alignment:

    • Updated samples/Sharprompt.Example/Program.cs with a source-generated JsonSerializerContext (SampleJsonSerializerContext) for MyFormModel to ensure trim/AOT warning-free execution.

Verification

  • dotnet build -c Release (0 Warnings, 0 Errors)
  • dotnet test -c Release --no-build -f net10.0 (351 Passed)
  • dotnet format --verify-no-changes (0 formatting issues)
  • npm run docs:build (VitePress site compiled with 0 errors)

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.

Document Native AOT support and current API usage

1 participant