[browser][coreCLR] Fix loadBootResourceCallback receiving undefined integrity and refactor config merge#127030
Merged
pavelsavara merged 5 commits intodotnet:mainfrom Apr 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the browser/CoreCLR JavaScript loader configuration and asset handling to improve config merging and align asset metadata with the public API (hash/integrity handling).
Changes:
- Adjust config merging to mutate the target config/resources directly (and add
coreVfsnormalization/merge). - Switch
loadBootResourceCallbackintegrity argument fromasset.integritytoasset.hash. - Remove
integrityfrom internal asset entry typings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/native/libs/Common/JavaScript/types/internal.ts | Removes internal integrity field from AssetEntryInternal to rely on AssetEntry.hash. |
| src/native/libs/Common/JavaScript/loader/config.ts | Reworks config/resource merge behavior; adds coreVfs normalization and merges resources.hash. |
| src/native/libs/Common/JavaScript/loader/assets.ts | Passes asset.hash into loadBootResourceCallback where integrity was previously used. |
loadBootResourceCallback receiving undefined integrity and refactor config merge
maraf
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug where the
loadBootResourceCallbackwas always receivingundefinedfor theintegrityparameter, and refactors the loader config merge logic for correctness and clarity.Changes
Bug fix:
integrityparameter inloadBootResourceCallbackThe
AssetEntryInternal.integrityfield was never assigned anywhere in the codebase, so both call sites inassets.tsthat passedassetInternal.integrity!toloadBootResourceCallbackwere always passingundefined. The fix replaces this withassetInternal.hash ?? "", using thehashfield from the baseAssetEntrytype which is actually populated from the asset manifest. The deadintegrityfield is removed fromAssetEntryInternal.Config merge refactor (
mergeResources/mergeConfigs)The old
mergeResourceswrote merged values intosource, then usedObject.assign(target, source)to copy everything back totarget. This was:Object.assignoverwrote the already-mergedresourcesobject ontargetwith the unmerged one fromsource.The new code writes directly to
target, which:|| []fallbacks on source arrays for defensive handling of partialAssetsobjects.hashmerge for the top-levelAssets.hashmanifest hash.In
mergeConfigs, the mergedtarget.resourcesis saved beforeObject.assign(target, source)and restored afterward, so the scalar property copy doesn't overwrite the already-merged resources.Missing
coreVfshandlingThe
coreVfsfield existed on theAssetstype but was missing from bothmergeResourcesandnormalizeResources. Both functions now handle it.