Skip to content

[StaticWebAssets] Detects pre-compressed assets (#44976)#45448

Closed
javiercn wants to merge 0 commit intomainfrom
javiercn/port-pr-44976
Closed

[StaticWebAssets] Detects pre-compressed assets (#44976)#45448
javiercn wants to merge 0 commit intomainfrom
javiercn/port-pr-44976

Conversation

@javiercn
Copy link
Copy Markdown
Member

Detects assets that have been pre-compressed by an external tool to avoid conflicts when we compress our own assets, and they end up on the same path as the existing pre-compressed assets.

Forward port of #44976

@ghost ghost added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK untriaged Request triage from a team member labels Dec 13, 2024
@javiercn javiercn force-pushed the javiercn/port-pr-44976 branch from 01083a1 to 2e860c3 Compare December 13, 2024 10:57
@javiercn javiercn marked this pull request as ready for review December 13, 2024 20:25
@javiercn javiercn requested a review from a team as a code owner December 13, 2024 20:25
@javiercn javiercn requested review from MackinnonBuck and Copilot and removed request for a team December 13, 2024 20:25
Copy link
Copy Markdown
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.

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

Files not reviewed (3)
  • src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.Compression.targets: Language not supported
  • test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_Detects_PrecompressedAssets.Build.files.json: Language not supported
  • test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishWorks_With_PrecompressedAssets.Build.files.json: Language not supported
Comments suppressed due to low confidence (2)

test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DiscoverPrecompressedAssetsTest.cs:93

  • [nitpick] The placeholder in the RelativePath metadata should be updated to reflect the actual fingerprint value used in the test.
asset.GetMetadata("RelativePath").Should().Be("js/site#[.{fingerprint=uncompressed}]?.js.gz");

src/StaticWebAssetsSdk/Tasks/Compression/DiscoverPrecompressedAssets.cs:95

  • The conditional check should first check for '.br' before '.gz' to ensure correct assignment of 'fileExtension' and 'assetTraitValue'.
if (!asset.RelativePath.EndsWith(".gz", StringComparison.OrdinalIgnoreCase))

@javiercn javiercn closed this Dec 19, 2024
@javiercn javiercn force-pushed the javiercn/port-pr-44976 branch from 2e860c3 to 4a7aa40 Compare December 19, 2024 10:18
@javiercn javiercn deleted the javiercn/port-pr-44976 branch December 19, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants