Skip to content

Conversation

@maraf
Copy link
Member

@maraf maraf commented Dec 9, 2025

JavaScript part of .NET expects assets to have field hash. This PR unifies it between internal structure and boot config generated during build. It is a regression from boot config structure change from #116300.

This PR will cause failure of some tests once it flows to dotnet/sdk.
This PR will be a candidate for backport to 10.0.

Fixes #121876

@maraf maraf added this to the 11.0.0 milestone Dec 9, 2025
@maraf maraf self-assigned this Dec 9, 2025
@maraf maraf added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Dec 9, 2025
@maraf maraf changed the title [browser] Generate boot config with hash expected by javascript instead of integrity [browser] Generate boot config with hash field instead of integrity Dec 9, 2025
@maraf maraf requested a review from pavelsavara December 9, 2025 18:38
@maraf maraf marked this pull request as ready for review December 10, 2025 08:53
@maraf maraf requested a review from ilonatommy as a code owner December 10, 2025 08:53
Copilot AI review requested due to automatic review settings December 10, 2025 08:53
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 a regression from #116300 by renaming the integrity field to hash in the boot configuration classes and their usage. The JavaScript runtime expects assets to have a hash field, which was incorrectly changed to integrity in the previous PR.

Key Changes:

  • Renamed property from integrity to hash in three asset classes: WasmAsset, GeneralAsset, and VfsAsset
  • Updated all property assignments in BootJsonBuilderHelper.cs to use the hash field name
  • Added test case to verify that assets have integrity/hash values

Reviewed changes

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

File Description
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs Renamed integrity property to hash in WasmAsset, GeneralAsset, and VfsAsset classes
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs Updated all property assignments from integrity to hash when creating asset instances
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Added new test case "AssetIntegrity" to log integrity values for all assets via resource loader
src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs Added test method to verify that non-JS/non-JSON assets have integrity hash values

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.

[browser] Integrity passed to withResourceLoader is always empty

2 participants