Skip to content

[docs] Update multi-language integration guide for ATS-first API design#756

Draft
aspire-repo-bot[bot] wants to merge 1 commit intorelease/13.3from
docs/ats-first-api-design-16403-0866c8de3c4580de
Draft

[docs] Update multi-language integration guide for ATS-first API design#756
aspire-repo-bot[bot] wants to merge 1 commit intorelease/13.3from
docs/ats-first-api-design-16403-0866c8de3c4580de

Conversation

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#16403

Author: @sebastienros

Targeting main — falling back to main because release/13.3 (resolved from the source PR milestone 13.3) does not exist on microsoft/aspire.dev.

Why this PR is needed

PR microsoft/aspire#16403 adopts an ATS-first API design for Aspire.Hosting exported capabilities. This introduces two user-facing changes that the current docs don't cover:

  1. Getter-only properties → async methods in TypeScript. When a C# property is getter-only (no setter, and not a mutable-collection type), the code generator now emits it as an async method in the TypeScript SDK (property(): Promise<T>). Previously it was a readonly getter. This is a breaking change for any TypeScript AppHost code that uses ATS-generated properties. The current multi-language-integration-authoring.mdx page says "each public property becomes a capability" but doesn't explain this distinction.

  2. New ATS-first callback context pattern. The PR introduces EnvironmentEditor, CommandLineArgsEditor, and ResourceUrlsEditor facade types, and exports withEnvironmentCallback, withArgsCallback, and withUrls callback APIs. Integration authors following the old pattern of ExposeProperties = true on callback context classes need to know the new recommended approach: use individual [AspireExport] attributes and wrap mutable state in editor classes.

What was changed

  • Updated src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx:
    • Expanded the "Export resource types" section with individual-property export guidance alongside ExposeProperties = true
    • Added a new subsection "How getter-only properties appear in TypeScript" explaining the async-method vs readonly-getter distinction with before/after code examples
    • Added a new top-level section "Callback context types and the ATS-first editor pattern" covering:
      • The three-rule design checklist for callback context types
      • How to define an editor class ([AspireExport] on the class + [AspireExport] on its methods)
      • How to define the context class with individual [AspireExport] attributes on the properties TypeScript callers need
      • How to export the callback extension method and what the generated TypeScript looks like

Files modified

File Action
src/frontend/src/content/docs/extensibility/multi-language-integration-authoring.mdx Updated

This draft PR needs human review before merging — in particular, the C# code examples for the editor class and callback context type should be verified against the actual types shipped in 13.3.

Note

🔒 Integrity filter blocked 1 item

The following item was blocked because it doesn't meet the GitHub integrity level.

  • #16243 issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by PR Documentation Check for issue #16403 · ● 2M ·

Documents the getter-only-to-async-method behavior introduced in
microsoft/aspire#16403 and adds a new 'Callback context types and the
ATS-first editor pattern' section explaining:

- How getter-only C# properties map to async methods in generated
  TypeScript SDKs, while mutable-collection properties remain as
  readonly getters
- The ATS-first editor/facade pattern for callback context types
  (EnvironmentEditor, etc.) that should be used instead of
  ExposeProperties = true on callback context classes
- How to define, export, and consume callback extension methods like
  withEnvironmentCallback, withArgsCallback, and withUrls

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist IEvangelist force-pushed the docs/ats-first-api-design-16403-0866c8de3c4580de branch from e2faff6 to 93b70f3 Compare April 28, 2026 16:44
@IEvangelist IEvangelist changed the base branch from main to release/13.3 April 28, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants