Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/frontend/config/sidebar/reference.topics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = {
label: 'ASPIREINTERACTION001',
link: '/diagnostics/aspireinteraction001',
},
{
label: 'ASPIREJAVASCRIPT001',
link: '/diagnostics/aspirejavascript001',
},
{
label: 'ASPIREMCP001',
link: '/diagnostics/aspiremcp001',
Expand Down
64 changes: 64 additions & 0 deletions src/frontend/src/content/docs/diagnostics/aspirejavascript001.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Compiler Warning ASPIREJAVASCRIPT001
description: Learn more about compiler Warning ASPIREJAVASCRIPT001. JavaScript hosting APIs are for evaluation purposes only and are subject to change or removal in future updates.
---

import { Badge } from '@astrojs/starlight/components';

<Badge
text="Version introduced: 13.3"
variant="note"
size="large"
class:list={'mb-1'}
/>

> JavaScript hosting APIs are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.

This diagnostic warning is reported when using experimental JavaScript hosting APIs in Aspire, including:

- `PublishAsStaticWebsite<TResource>` extension method
- `NextJsAppResource` class
- `PublishAsStaticWebsiteOptions` class

These APIs allow you to configure JavaScript and Next.js applications as static websites during publishing.

## Example

The following code generates `ASPIREJAVASCRIPT001`:

```csharp title="C# — AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

var frontend = builder.AddNextJsApp("frontend", "../frontend")
.PublishAsStaticWebsite(options =>
{
options.OutputPath = "out";
});

builder.Build().Run();
```

## To correct this warning

Suppress the warning with either of the following methods:

- Set the severity of the rule in the _.editorconfig_ file.

```ini title=".editorconfig"
[*.{cs,vb}]
dotnet_diagnostic.ASPIREJAVASCRIPT001.severity = none
```

For more information about editor config files, see [Configuration files for code analysis rules](/diagnostics/overview/#suppress-in-the-editorconfig-file).

- Add the following `PropertyGroup` to your project file:

```xml title="C# project file"
<PropertyGroup>
<NoWarn>$(NoWarn);ASPIREJAVASCRIPT001</NoWarn>
</PropertyGroup>
```

## See also

- [Deploy JavaScript apps](/deployment/javascript-apps/) - Learn about deploying JavaScript applications with Aspire
1 change: 1 addition & 0 deletions src/frontend/src/content/docs/diagnostics/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The following table lists the possible MSBuild and analyzer warnings and errors
| [ASPIREEXTENSION001](/diagnostics/aspireextension001/) | (Experimental) Warning | Extension debugging support APIs are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREFILESYSTEM001](/diagnostics/aspirefilesystem001/) | (Experimental) Warning | File system service types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREINTERACTION001](/diagnostics/aspireinteraction001/) | (Experimental) Warning | Interaction service types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREJAVASCRIPT001](/diagnostics/aspirejavascript001/) | (Experimental) Warning | JavaScript hosting APIs are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREHOSTINGPYTHON001](/diagnostics/aspirehostingpython001/) | (Experimental) Error | `AddPythonApp` is for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIREMCP001](/diagnostics/aspiremcp001/) | (Experimental) Warning | <abbr title="Model Context Protocol" data-tooltip-placement="top">MCP</abbr> server types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREPIPELINES001](/diagnostics/aspirepipelines001/) | (Experimental) Error | Pipeline infrastructure APIs are for evaluation purposes only and are subject to change or removal in future updates. |
Expand Down