Skip to content

Conversation

@maraf
Copy link
Member

@maraf maraf commented Oct 14, 2025

Expect fingerprint in SWA identity when searching for dotnet.js to apply preloading properties to.
The change is build-time only, we don't need to update the target for publish, because the publish.dotnet.js doesn't get fingerprint in the identity.

Contributes to dotnet/aspnetcore#64011

@maraf maraf added this to the 11.0.0 milestone Oct 14, 2025
@maraf maraf self-assigned this Oct 14, 2025
@maraf maraf added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Oct 14, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@maraf maraf force-pushed the BrowserPreloadFingerprintIdentity branch from d165553 to 60b7af6 Compare October 15, 2025 10:40
@maraf
Copy link
Member Author

maraf commented Oct 15, 2025

/backport to release/10.0

@github-actions
Copy link
Contributor

@maraf
Copy link
Member Author

maraf commented Oct 16, 2025

This requires an SDK for WBT with dotnet/sdk#51274

@maraf maraf added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 16, 2025
lewing added a commit that referenced this pull request Oct 17, 2025
…ng (#120746)

Backport of #120694 to release/10.0

In dotnet/sdk#50949 we changed the identity of
StaticWebAsset to contain fingerprint (dotnet.native.wasm ->
dotnet.native.FP.wasm). This PR accommodates this when checking for
dotnet.native.wasm asset from build.

The SDK change didn't flown to the runtime yet, and so Wasm.Build.Tests
won't test it yet.

Fixes dotnet/aspnetcore#64011

/cc @maraf

## Customer Impact

- [ ] Customer reported
- [x] Found internally

[[Select one or both of the boxes. Describe how this issue impacts
customers, citing the expected and actual behaviors and scope of the
issue. If customer-reported, provide the issue
number.]](dotnet/aspnetcore#64011)

## Regression

- [x] Yes
- [ ] No

Introduced in dotnet/sdk#50949 which added a
fingerprint to the msbuild item identity

## Testing

Manual and automated tests.

## Risk

Low. The change are very scoped to target and items used only by
preloading.

**IMPORTANT**: If this backport is for a servicing release, please
verify that:

- The PR target branch is `release/X.0-staging`, not `release/X.0`.

## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

---------

Co-authored-by: Marek Fišera <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>
@dotnet-policy-service dotnet-policy-service bot removed this from the 11.0.0 milestone Nov 16, 2025
@dotnet-policy-service
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@maraf maraf reopened this Nov 19, 2025
@maraf maraf removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Dec 15, 2025
@maraf maraf marked this pull request as ready for review December 15, 2025 20:49
Copilot AI review requested due to automatic review settings December 15, 2025 20:49
@maraf
Copy link
Member Author

maraf commented Dec 15, 2025

This is a fix from .NET 10 timeframe. Landed in .NET 10, but main was behind back then.

Copy link
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.

Pull request overview

This PR fixes the detection of fingerprinted dotnet.js files for preloading in WebAssembly browser builds. The change ensures that when fingerprinting is enabled for the boot config file (dotnet.js), the build system correctly identifies the fingerprinted version (e.g., dotnet.abc123.js) and applies preload properties to it.

Key changes:

  • Updated MSBuild targets to handle both fingerprinted and non-fingerprinted boot config file matching
  • Expanded test coverage to validate all combinations of publish/build, fingerprinting, and preload settings
  • Added a helper method to count occurrences in test assertions

Reviewed changes

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

File Description
src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets Added logic to match boot config files with fingerprints by splitting filename and extension, then constructing the pattern with %(Fingerprint) metadata
src/mono/wasm/Wasm.Build.Tests/PreloadingTests.cs Expanded test matrix from 4 to 8 cases to cover the new preloadAssets parameter, added CountOccurrences helper method for verification, and removed unnecessary null initialization

@maraf maraf merged commit e7eb44a into dotnet:main Dec 17, 2025
32 of 34 checks passed
@maraf maraf deleted the BrowserPreloadFingerprintIdentity branch December 17, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants