Skip to content

[Breaking change]: Aspire.Hosting.NodeJs library breaks #5444

@eerhardt

Description

@eerhardt

Description

We are renaming Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript.

The current AddNodeApp is being removed and the order of the parameters has changed for a new AddNodeApp overload.

The AddNpmApp is being removed and replaced by AddJavaScriptApp.

See Rename Aspire.Hosting.NodeJs to Aspire.Hosting.JavaScript (dotnet/aspire#12681)

Version

13

Previous behavior

Previously, the signature was:

AddNodeApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string scriptPath, string? workingDirectory = null, string[]? args = null)

New behavior

The new method takes the application directory first, and then a file path - relative to the application directory. There is no "args" parameter, instead call WithArgs to pass arguments to the app.

AddNodeApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string scriptPath)

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

This aligns with the rest of the Aspire language integrations. For example Python.

It also allows for a default Dockerfile to be created for the Node.js application.

Recommended action

Use the new library and change the order of the parameters for AddNodeApp.

Affected APIs

  • Aspire.Hosting.NodeJs.*

Metadata

Metadata

Assignees

Labels

Pri1High priority, do before Pri2 and Pri3area-docsdoc-ideaIndicates issues that are suggestions for new topics [org][type][category]⛓️‍💥 breaking-changeIssues or PRs tracking breaking changes.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions