Skip to content

[StaticWebAssets] Compress generated html file #48980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025

Conversation

maraf
Copy link
Member

@maraf maraf commented May 15, 2025

Fixes dotnet/aspnetcore#61937

@maraf maraf added this to the 10.0.1xx milestone May 15, 2025
@maraf maraf requested a review from a team May 15, 2025 09:43
@maraf maraf self-assigned this May 15, 2025
@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 09:43
@maraf maraf requested a review from a team as a code owner May 15, 2025 09:43
@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label May 15, 2025
Copy link
Contributor

@Copilot 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 refines the Static Web Assets compression behavior by excluding the OriginalItemSpec metadata from generated HTML asset items and adding tests to verify gzip and brotli compressed output.

  • Removed OriginalItemSpec metadata for HTML assets to ensure the correct RelatedAsset is used.
  • Extended tests to read and assert both gzip and brotli compressed HTML files.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsFingerprintingTest.cs Added assertions to verify decompressed HTML content for gzip and brotli files and included required using statement for compression.
src/StaticWebAssetsSdk/Tasks/OverrideHtmlAssetPlaceholders.cs Updated task code to remove the OriginalItemSpec metadata from generated HTML asset items.

@maraf maraf merged commit 5082b92 into dotnet:main May 15, 2025
31 checks passed
@maraf maraf deleted the HtmlAssetPlaceholdersCompressed branch May 15, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Placeholders are not updated in precompressed index.html files for published Blazor WebAssembly standalone apps
2 participants