Skip to content

Deprecate CommunityToolkit Bun hosting integration in favor of core Aspire.Hosting.JavaScript#1376

Merged
aaronpowell merged 4 commits into
mainfrom
copilot/deprecate-bun-integration
Jun 1, 2026
Merged

Deprecate CommunityToolkit Bun hosting integration in favor of core Aspire.Hosting.JavaScript#1376
aaronpowell merged 4 commits into
mainfrom
copilot/deprecate-bun-integration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

Aspire now provides first-class Bun support via Aspire.Hosting.JavaScript (AddBunApp), so the Toolkit Bun integration should guide users to migrate off the Toolkit package. This PR deprecates the Toolkit surface and updates package/docs with explicit migration guidance.

  • API deprecation

    • Marked Toolkit Bun extension methods as [Obsolete] with a migration message:
      • AddBunApp(...)
      • WithBunPackageInstallation(...)
    • Updated the generated API metadata file to reflect the same obsolete annotations.
  • Package deprecation signaling

    • Updated NuGet package metadata for CommunityToolkit.Aspire.Hosting.Bun:
      • Added deprecated package tag
      • Updated package description to indicate migration target (Aspire.Hosting.JavaScript) and planned removal.
  • Docs and migration guidance

    • Added a deprecation notice to Bun README.
    • Added explicit migration guidance from Toolkit API shape to core API shape.
    • Included TypeScript AppHost migration example using generated core bindings (builder.addBunApp(...)).
    • Updated root repository integration table entry for Bun to indicate deprecation and point to core API.
  • Compatibility posture

    • Kept the Toolkit API operational (deprecated, not removed) to provide a compatibility window while steering users to the core integration.
// Toolkit (deprecated)
builder.AddBunApp("api", "server.ts")
    .WithHttpEndpoint(env: "PORT");

// Core replacement
builder.AddBunApp("api", "./api", "server.ts")
    .WithHttpEndpoint(env: "PORT")
    .WithExternalHttpEndpoints();

Copilot AI and others added 2 commits May 28, 2026 06:09
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copilot AI changed the title [WIP] Deprecate Bun integration and update documentation Deprecate CommunityToolkit Bun hosting integration in favor of core Aspire.Hosting.JavaScript May 28, 2026
Copilot AI requested a review from aaronpowell May 28, 2026 06:13
@aaronpowell aaronpowell requested a review from davidfowl May 28, 2026 06:37
@aaronpowell aaronpowell marked this pull request as ready for review May 28, 2026 06:38
Copilot AI review requested due to automatic review settings May 28, 2026 06:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1376

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1376"

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

This PR deprecates the Toolkit Bun hosting integration in favor of Aspire’s core JavaScript hosting support, while keeping the current API available during the migration window.

Changes:

  • Adds obsolete annotations to Bun hosting extension methods and API metadata.
  • Updates NuGet/package README/root README deprecation messaging.
  • Suppresses obsolete warnings in Bun examples/tests and adds reflection coverage for deprecation attributes.
Show a summary per file
File Description
src/CommunityToolkit.Aspire.Hosting.Bun/BunAppExtensions.cs Adds deprecation message and obsolete annotations to Bun extension methods.
src/CommunityToolkit.Aspire.Hosting.Bun/api/CommunityToolkit.Aspire.Hosting.Bun.cs Mirrors obsolete annotations in generated API metadata.
src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj Updates package tags and description to signal deprecation.
src/CommunityToolkit.Aspire.Hosting.Bun/README.md Adds deprecation notice and migration examples.
README.md Marks the Bun integration as deprecated in the root integration table.
examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/Program.cs Suppresses obsolete warnings for the example AppHost.
tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs Suppresses obsolete warnings and adds deprecation attribute assertions.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Comment on lines +57 to 58
[Obsolete(BunDeprecationMessage)]
public static IResourceBuilder<BunAppResource> WithBunPackageInstallation(this IResourceBuilder<BunAppResource> resource, Action<IResourceBuilder<BunInstallerResource>>? configureInstaller = null)
Comment thread src/CommunityToolkit.Aspire.Hosting.Bun/README.md Outdated
Copilot AI temporarily deployed to azure-artifacts May 28, 2026 06:49 Inactive
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.Hosting.Bun 88% 69% 20
Summary 88% (29 / 33) 69% (11 / 16) 20

Minimum allowed line rate is 60%

@aaronpowell aaronpowell temporarily deployed to azure-artifacts June 1, 2026 15:27 — with GitHub Actions Inactive
@aaronpowell aaronpowell merged commit c2d90b3 into main Jun 1, 2026
14 checks passed
@aaronpowell aaronpowell deleted the copilot/deprecate-bun-integration branch June 1, 2026 15:35
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.

Deprecate Bun integration now that Aspire.Hosting.JavaScript has AddBunApp

3 participants