Skip to content

[docs] Add TypeScript publish lifecycle event APIs to eventing docs#998

Open
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/polyglot-publish-events-v2-1f543c295151fcb4
Open

[docs] Add TypeScript publish lifecycle event APIs to eventing docs#998
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/polyglot-publish-events-v2-1f543c295151fcb4

Conversation

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#17129 by @sebastienros

Targeting release/13.4 based on the source PR milestone 13.4.

Why this PR is needed

PR microsoft/aspire#17129 added subscribeBeforePublish and subscribeAfterPublish builder methods to the TypeScript polyglot AppHost SDK, allowing TypeScript (and other non-C#) AppHosts to subscribe to publish lifecycle events (BeforePublishEvent and AfterPublishEvent). Previously these events were only accessible in C# via OnBeforePublish / OnAfterPublish. The eventing docs covered the C# side but had no TypeScript examples for publish events.

Changes

  • Updated src/frontend/src/content/docs/app-host/eventing.mdx:
    • Added a reference table to the TypeScript tab in the "Subscribe to AppHost events" section listing all four TypeScript builder-level event subscription methods, including the new subscribeBeforePublish and subscribeAfterPublish.
    • Wrapped the "Publishing events" code sample in a <Tabs syncKey='aspire-lang'> component and added a TypeScript tab showing subscribeBeforePublish / subscribeAfterPublish alongside the existing C# tab.

Files modified

  • src/frontend/src/content/docs/app-host/eventing.mdx (updated)

Generated by PR Documentation Check for issue #17129 · ● 58.3M ·

…eventing page

Documents the new publish lifecycle event APIs for polyglot AppHosts
added in microsoft/aspire#17129. TypeScript AppHosts can now subscribe
to BeforePublishEvent and AfterPublishEvent using subscribeBeforePublish
and subscribeAfterPublish builder methods.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label May 18, 2026
@aspire-repo-bot aspire-repo-bot Bot requested a review from JamesNK May 18, 2026 16:40
@IEvangelist IEvangelist marked this pull request as ready for review May 20, 2026 02:16
@IEvangelist IEvangelist self-requested a review as a code owner May 20, 2026 02:16
Copilot AI review requested due to automatic review settings May 20, 2026 02:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the AppHost eventing documentation to include the newly added TypeScript publish lifecycle event subscription APIs, aligning the docs with recent polyglot AppHost SDK capabilities.

Changes:

  • Adds a TypeScript reference table for builder-level AppHost event subscription methods, including publish events.
  • Wraps the “Publishing events” example in synced language tabs and adds a TypeScript example using the new publish subscriptions.
Comments suppressed due to low confidence (1)

src/frontend/src/content/docs/app-host/eventing.mdx:432

  • Same as above: subscribeAfterPublish isn’t present in the current Twoslash aspire.d.ts typings, so this twoslash snippet is likely to error during docs validation unless the typings are updated (or the block isn’t type-checked).

await builder.subscribeAfterPublish(async (event) => {
    // Post-publish actions
    console.log("AfterPublishEvent");
});

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +423 to +427

await builder.subscribeBeforePublish(async (event) => {
// Validate resources before publishing
console.log("BeforePublishEvent");
});
Comment on lines +97 to +99
| `subscribeBeforeStart` | `BeforeStartEvent` — raised before the AppHost starts |
| `subscribeAfterResourcesCreated` | `AfterResourcesCreatedEvent` — raised after the AppHost created resources |
| `subscribeBeforePublish` | `BeforePublishEvent` — raised before manifest publishing begins |
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.

1 participant