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
1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
<PackageVersion Update="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="$(MicrosoftExtensionsDiagnosticsHealthChecksEntityFrameworkCoreVersion)" />
<PackageVersion Update="Microsoft.Extensions.Diagnostics.HealthChecks" Version="$(MicrosoftExtensionsDiagnosticsHealthChecksVersion)" />
<PackageVersion Update="Microsoft.Extensions.Features" Version="$(MicrosoftExtensionsFeaturesVersion)" />
<PackageVersion Update="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedVersion)" />
<PackageVersion Update="Microsoft.AspNetCore.SignalR.Client" Version="$(MicrosoftAspNetCoreSignalRClientVersion)" />
<!-- Runtime -->
<PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="$(MicrosoftExtensionsHostingAbstractionsVersion)" />
Expand Down
1 change: 0 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
<MicrosoftExtensionsDiagnosticsHealthChecksEntityFrameworkCoreVersion>9.0.7</MicrosoftExtensionsDiagnosticsHealthChecksEntityFrameworkCoreVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksVersion>9.0.7</MicrosoftExtensionsDiagnosticsHealthChecksVersion>
<MicrosoftExtensionsFeaturesVersion>9.0.7</MicrosoftExtensionsFeaturesVersion>
<MicrosoftExtensionsFileProvidersEmbeddedVersion>9.0.7</MicrosoftExtensionsFileProvidersEmbeddedVersion>
<MicrosoftAspNetCoreSignalRClientVersion>9.0.7</MicrosoftAspNetCoreSignalRClientVersion>
<!-- Runtime -->
<MicrosoftExtensionsHostingAbstractionsVersion>9.0.7</MicrosoftExtensionsHostingAbstractionsVersion>
Expand Down
5 changes: 0 additions & 5 deletions src/Aspire.Dashboard/Aspire.Dashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<RollForward>Major</RollForward>

<DefineConstants>$(DefineConstants);ASPIRE_DASHBOARD</DefineConstants>

<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -37,8 +35,6 @@
<Protobuf Include="..\Aspire.Hosting\Dashboard\proto\dashboard_service.proto">
<Link>ServiceClient\dashboard_service.proto</Link>
</Protobuf>

<EmbeddedResource Include="Embedded\blazor.web.js" LogicalName="_aspire/blazor.web.js" />
</ItemGroup>

<!-- Used by publishing infrastructure to get the version to use for blob publishing -->
Expand All @@ -50,7 +46,6 @@
<PackageReference Include="Markdig" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Aspire.Dashboard/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
<Routes @rendermode="@(new InteractiveServerRenderMode(prerender: false))" />
<ReconnectModal />
@*
Use Blazor JS embedded in dashboard. This is done because the dashboard is currently built for .NET 8, and in .NET 8 the Blazor JS is embedded in the components assembly.
Use Blazor JS shipped in dashboard's wwwroot. This is done because the dashboard is currently built for .NET 8, and in .NET 8 the Blazor JS is embedded in the components assembly.
But in .NET 10 and later the Blazor JS file is an asset. We can rely on Blazor JS always being available. Remove and use asset file in the future once .NET 10 is the minimum version.
This file is copied from .NET 10 P4.
*@
<script src="_aspire/blazor.web.js"></script>
<script src="framework/blazor.web.js"></script>
<script src="js/app.js"></script>
<script src="js/app-reconnect.js"></script>

Expand Down
42 changes: 0 additions & 42 deletions src/Aspire.Dashboard/DashboardEndpointsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,12 @@
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers;

namespace Aspire.Dashboard;

public static class DashboardEndpointsBuilder
{
public static void MapDashboardBlazor(this IEndpointRouteBuilder endpoints)
{
var options = new StaticFileOptions
{
FileProvider = new ManifestEmbeddedFileProvider(typeof(DashboardEndpointsBuilder).Assembly),
OnPrepareResponse = SetCacheHeaders
};

var app = endpoints.CreateApplicationBuilder();
app.Use(next => context =>
{
// Set endpoint to null so the static files middleware will handle the request.
context.SetEndpoint(null);

return next(context);
});
app.UseStaticFiles(options);

endpoints.MapGet("/_aspire/blazor.web.js", app.Build());

static void SetCacheHeaders(StaticFileResponseContext ctx)
{
// By setting "Cache-Control: no-cache", we're allowing the browser to store
// a cached copy of the response, but telling it that it must check with the
// server for modifications (based on Etag) before using that cached copy.
// Longer term, we should generate URLs based on content hashes (at least
// for published apps) so that the browser doesn't need to make any requests
// for unchanged files.
var headers = ctx.Context.Response.GetTypedHeaders();
if (headers.CacheControl == null)
{
headers.CacheControl = new CacheControlHeaderValue
{
NoCache = true
};
}
}
}

public static void MapDashboardHealthChecks(this IEndpointRouteBuilder endpoints)
{
endpoints.MapHealthChecks($"/{DashboardUrls.HealthBasePath}").AllowAnonymous();
Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Dashboard/DashboardWebApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ public DashboardWebApplication(

_app.MapDashboardApi(dashboardOptions);
_app.MapDashboardHealthChecks();
_app.MapDashboardBlazor();
}

private ILogger<DashboardWebApplication> GetLogger()
Expand Down
1 change: 0 additions & 1 deletion src/Aspire.Dashboard/Embedded/blazor.web.js

This file was deleted.

1 change: 1 addition & 0 deletions src/Aspire.Dashboard/wwwroot/framework/blazor.web.js

Large diffs are not rendered by default.

Loading