Skip to content

Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript (#12681)#12687

Merged
davidfowl merged 1 commit intodotnet:release/13.0from
eerhardt:Backport12681
Nov 5, 2025
Merged

Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript (#12681)#12687
davidfowl merged 1 commit intodotnet:release/13.0from
eerhardt:Backport12681

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Nov 5, 2025

Backport of #12681 to release/13.0

/cc @eerhardt

Customer Impact

We need to clean up our APIs since they will be stable in the future and we won't be able to change them. We are deciding to rename NodeJs to JavaScript to make it more future proof.

Testing

Automated tests.

Risk

The APIs and functionality stay the same. Just renames.

Regression?

No

* Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript

This makes the library consistent to use language naming, and not a single technology. It allows for more JS features in the future that aren't tied to Node.js.

Since the library is being renamed, I also removed the Obsolete APIs since there is no reason to ship them in the new library.

Contributes to dotnet#12058

* Fix build

* Fix Helix tests
Copilot AI review requested due to automatic review settings November 5, 2025 00:31
@eerhardt eerhardt added the Servicing-consider Issue for next servicing release review label Nov 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12687

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12687"

/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
[Obsolete("Use AddNodeApp that takes an appDirectory and relative scriptPath instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static IResourceBuilder<NodeAppResource> AddNodeApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string scriptPath, string? workingDirectory = null, string[]? args = null)
Copy link
Member

Choose a reason for hiding this comment

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

Where these just missed in the pass of things to remove after them being obsoleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

They weren't missed. Previously we Obsoleted these 2 methods because we were keeping the same library, so we didn't want to make a binary breaking change.

But since we decided to rename the library and the namespace, it made no sense to keep the methods as new signatures in a new library, but Obsolete.

@joperezr joperezr added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 5, 2025
joperezr

This comment was marked as outdated.

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

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

:shipit:

@dotnet-policy-service dotnet-policy-service bot added the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 5, 2025
@joperezr joperezr removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 5, 2025
Copy link
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 renames the Aspire.Hosting.NodeJs package to Aspire.Hosting.JavaScript and updates all references throughout the codebase. The renaming better reflects the package's broader support for JavaScript applications beyond just Node.js, including support for npm-based applications and Vite apps.

Key changes:

  • Package renamed from Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
  • All namespaces updated from Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
  • Obsolete AddNpmApp API replaced with AddJavaScriptApp throughout tests
  • Default script name for AddJavaScriptApp changed from "start" to "dev"

Reviewed Changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Shared/RepoTesting/Directory.Packages.Helix.props Updated package reference from Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationExtensions.cs Added using statement for new namespace
tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj Updated package reference
tests/Aspire.Hosting.Tests/PublishAsDockerfileTests.cs Replaced AddNpmApp calls with AddJavaScriptApp
tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj Updated project reference
tests/Aspire.Hosting.JavaScript.Tests/*.cs Updated namespace declarations from NodeJs.Tests to JavaScript.Tests
tests/Aspire.Hosting.JavaScript.Tests/NodeJsPublicApiTests.cs Removed [Obsolete] attributes and updated test method names
tests/Aspire.Hosting.JavaScript.Tests/NodeAppFixture.cs Updated NpmAppBuilder to use AddJavaScriptApp with "start" script
tests/Aspire.Hosting.JavaScript.Tests/AddNodeAppTests.cs Updated expected manifest script from "start" to "dev"
tests/Aspire.Cli.Tests/Projects/FallbackProjectParserTests.cs Added missing newline at end of file
src/Aspire.ProjectTemplates/templates/aspire-py-starter/13.0/apphost.cs Updated package reference in template
src/Aspire.Hosting.NodeJs/api/Aspire.Hosting.NodeJs.cs Removed obsolete API file
src/Aspire.Hosting.JavaScript/*.cs Updated namespace from Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript
src/Aspire.Hosting.JavaScript/README.md Updated package name and usage example
src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs Removed obsolete AddNpmApp and old AddNodeApp overload; removed unused imports
src/Aspire.Hosting.JavaScript/Aspire.Hosting.JavaScript.csproj Updated description and disabled package validation
playground/AspireWithNode/AspireWithNode.AppHost/NodeHostingExtensions.cs Updated resource type from NodeAppResource to JavaScriptAppResource
playground/AspireWithNode/AspireWithNode.AppHost/AspireWithNode.AppHost.csproj Updated package reference
playground/AspireWithJavaScript/AspireJavaScript.AppHost/AspireJavaScript.AppHost.csproj Updated package reference
AspireWithMaui.slnx, Aspire.slnx Updated project paths in solution files
Comments suppressed due to low confidence (3)

src/Aspire.Hosting.JavaScript/README.md:17

  • The text contains a typo or incomplete sentence. 'add a Or resource' should be 'add a JavaScript resource' or similar. This appears to be placeholder text that wasn't fully updated during the rename.
    src/Aspire.Hosting.JavaScript/README.md:22
  • The usage example is incorrect. According to the method signature AddJavaScriptApp(string name, string appDirectory, string runScriptName = \"dev\"), the third parameter should be a script name (like "dev" or "start"), not a file path ("app.js"). The example should be: builder.AddJavaScriptApp(\"frontend\", \"../frontend\", \"dev\"); or simply builder.AddJavaScriptApp(\"frontend\", \"../frontend\"); to use the default.
    tests/Aspire.Hosting.JavaScript.Tests/NodeAppFixture.cs:36
  • The test is using "start" as the script name, but the default for AddJavaScriptApp is "dev" (as seen in the method signature and AddNodeAppTests.cs line 64). This inconsistency means the test is not validating the default behavior. Consider either removing the "start" parameter to test the default, or add a comment explaining why "start" is explicitly specified.

@davidfowl
Copy link
Member

We need to mark this deprecated in the CLI @eerhardt @mitchdenny

@davidfowl davidfowl merged commit a52d36c into dotnet:release/13.0 Nov 5, 2025
302 of 303 checks passed
@eerhardt
Copy link
Member Author

eerhardt commented Nov 5, 2025

We need to mark this deprecated in the CLI @eerhardt @mitchdenny

What does "deprecated in the CLI" mean?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants