[browser][coreCLR] asset loading improvements#122886
Merged
pavelsavara merged 13 commits intodotnet:mainfrom Jan 8, 2026
Merged
[browser][coreCLR] asset loading improvements#122886pavelsavara merged 13 commits intodotnet:mainfrom
pavelsavara merged 13 commits intodotnet:mainfrom
Conversation
- fixed loadBootResourceCallback for non-JS assets - implemented onRuntimeConfigLoaded and onRuntimeReady initializer modules - implemented Module.onDownloadResourceProgress - removed support for remoteSources - simplifies emscripten API - fetchPdb and seed of registerPdbBytes - support for asset.isOptional - support for asset.buffer - support for asset.pendingDownload
Contributor
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
This was referenced Jan 5, 2026
# Conflicts: # src/native/corehost/browserhost/loader/assets.ts
Contributor
There was a problem hiding this comment.
Pull request overview
This PR significantly improves asset loading infrastructure for the browser/CoreCLR host by implementing throttling and retry mechanisms, adding PDB file support, introducing module lifecycle hooks, and simplifying the Emscripten API surface. These changes contribute to addressing issues tracked in #120226 for browser host improvements.
Key changes include:
- Implemented download throttling (configurable via
maxParallelDownloads) and retry logic to prevent resource exhaustion and improve reliability - Added PDB file loading support with
fetchPdbandregisterPdbBytes(stub implementation) - Introduced
onRuntimeConfigLoadedandonRuntimeReadymodule lifecycle hooks for better extensibility - Added
Module.onDownloadResourceProgresscallback for download progress tracking - Implemented support for
asset.isOptional,asset.buffer, andasset.pendingDownloadto enable pre-fetched assets - Simplified Emscripten module type definitions by moving properties to
EmscriptenModuleInternal - Removed support for
remoteSourcesconfiguration option
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/Common/JavaScript/types/public-api.ts | Removed remoteSources from LoaderConfig |
| src/native/libs/Common/JavaScript/types/internal.ts | Simplified EmscriptenModuleInternal by removing unused Emscripten properties and adding onAbort/onExit |
| src/native/libs/Common/JavaScript/types/exchange.ts | Added registerPdbBytes to BrowserHostExports |
| src/native/libs/Common/JavaScript/types/emscripten.ts | Removed lifecycle hooks from EmscriptenModule (moved to internal types) |
| src/native/libs/Common/JavaScript/cross-module/index.ts | Updated to include registerPdbBytes in the exports table |
| src/native/corehost/browserhost/loader/run.ts | Refactored initialization flow to support module lifecycle hooks and PDB loading |
| src/native/corehost/browserhost/loader/promise-completion-source.ts | Added delay utility function |
| src/native/corehost/browserhost/loader/polyfills.ts | Changed json() method to throw NotImplementedException for consistency |
| src/native/corehost/browserhost/loader/icu.ts | Refactored to use global loaderConfig instead of passing config as parameter |
| src/native/corehost/browserhost/loader/dotnet.d.ts | Updated type definitions to match changes in public-api.ts and emscripten.ts |
| src/native/corehost/browserhost/loader/config.ts | Added maxParallelDownloads default configuration |
| src/native/corehost/browserhost/loader/assets.ts | Major refactor adding throttling, retry logic, PDB support, progress tracking, and optional asset handling |
| src/native/corehost/browserhost/host/index.ts | Added registerPdbBytes to exports |
| src/native/corehost/browserhost/host/host.ts | Added registerPdbBytes stub function (not yet implemented) |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
- fix WASM EXIT prefix
This was referenced Jan 6, 2026
Open
Member
Author
|
/ba-g CI failures are #122927 |
ilonatommy
approved these changes
Jan 7, 2026
- cleanup dotnetGetInternals
- rename loaderConfig
This was referenced Jan 9, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
loadBootResourceCallbackso that it is now invoked for all asset types (not just JavaScript modules).onRuntimeConfigLoadedandonRuntimeReadyinitializer modules to enable modular runtime configuration and startup customization.Module.onDownloadResourceProgressfetchPdband seed ofregisterPdbBytesfor dynamic retrieval and registration of debugging symbols.asset.isOptional,asset.buffer,asset.pendingDownload.remoteSources- coreCLR does not support it backups for asset sources.defaultConfigfromnormalizeConfigto consistently set default values for missing properties and ensure all required config fields are initialized.Contributes to #120226