[browser][coreCLR] browserhost improvements#122233
Merged
pavelsavara merged 5 commits intodotnet:mainfrom Dec 9, 2025
Merged
Conversation
- fix and rename JsGlobalization - skip corerun.wasm from runtimepack - propagate config->ENV variables for browserhost - implement fetchWasm and instantiateWasm with instantiateStreaming - remove dotnetSidecar from dotnet.d.ts - allow dotnetBootConfig merging to dotnet.js - pass isSharedArrayBuffer to crypto - fix getHeapU32
Contributor
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements several improvements to the browser/CoreCLR browserhost infrastructure, focusing on better WASM instantiation, configuration handling, and code organization.
Key Changes
- Implemented
fetchWasmandinstantiateWasmusingWebAssembly.instantiateStreamingfor improved WASM loading - Renamed
libSystem.Browser.Utils.jstolibSystem.Native.Browser.Utils.jsfor naming consistency - Fixed library name resolution and split
JsGlobalizationinterop into separate Mono/CoreCLR implementations - Propagated
configenvironment variables toENVfor browserhost - Fixed
getHeapU32to properly return unsigned 32-bit integers - Passed
isSharedArrayBufferto crypto functions for threading support - Excluded
corerun.wasmfrom browser runtimepack
Reviewed changes
Copilot reviewed 26 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/rollup.config.js | Updated output file name for renamed Utils library |
| src/native/libs/System.Native.Browser/utils/memory.ts | Fixed getHeapU32 functions to ensure unsigned 32-bit integer values with >>> 0 |
| src/native/libs/System.Native.Browser/utils/index.ts | Added isSharedArrayBuffer export for crypto threading support |
| src/native/libs/System.Native.Browser/native/globalization-locale.ts | Fixed spacing in setHeapI32 call and comment indentation |
| src/native/libs/System.Native.Browser/native/crypto.ts | Enabled isSharedArrayBuffer check for SharedArrayBuffer compatibility |
| src/native/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js | Renamed from libSystem.Browser.Utils.footer.js |
| src/native/libs/System.Native.Browser/ReadMe.md | Updated documentation for renamed library file |
| src/native/libs/Common/JavaScript/types/export-api.ts | Removed unused global dotnetSidecar declaration |
| src/native/libs/Common/JavaScript/types/exchange.ts | Added isSharedArrayBuffer to BrowserUtilsExports types |
| src/native/libs/Common/JavaScript/per-module/index.ts | Fixed dotnetSidecar check to use globalThis |
| src/native/libs/Common/JavaScript/cross-module/index.ts | Added isSharedArrayBuffer mapping in internals subscriber |
| src/native/libs/Common/JavaScript/cross-linked/index.ts | Updated comment reference to renamed Utils file |
| src/native/libs/Common/JavaScript/CMakeLists.txt | Updated build dependencies for renamed files and new assets.ts |
| src/native/corehost/browserhost/loader/index.ts | Added instantiateWasm to Module for custom WASM instantiation |
| src/native/corehost/browserhost/loader/host-builder.ts | Changed import from bootstrap to assets module |
| src/native/corehost/browserhost/loader/dotnet.ts | Added dotnetBootConfig merging support |
| src/native/corehost/browserhost/loader/dotnet.d.ts | Removed duplicate dotnetSidecar declaration |
| src/native/corehost/browserhost/loader/bootstrap.ts | Moved asset loading logic to new assets.ts module, kept URL utilities |
| src/native/corehost/browserhost/loader/assets.ts | New file implementing fetchWasm, instantiateWasm with instantiateStreaming |
| src/native/corehost/browserhost/libBrowserHost.footer.js | Fixed environment variable propagation to set all config.environmentVariables in ENV |
| src/native/corehost/browserhost/browserhost.cpp | Fixed library name from libSystem.JavaScript.Native to libSystem.Native.Browser |
| src/native/corehost/browserhost/ReadMe.md | Updated documentation for renamed Utils file |
| src/native/corehost/browserhost/CMakeLists.txt | Updated JS_SYSTEM_BROWSER_UTILS path for renamed file |
| src/libraries/externals.csproj | Excluded corerun files from browser targets in runtimepack |
| src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems | Renamed Interop.Locale.cs to Interop.Locale.Mono.cs for Mono builds |
| src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs | Added SystemBrowserNative constant and moved JavaScriptNative |
| src/libraries/Common/src/Interop/Browser/Interop.Locale.Mono.cs | New file for Mono-specific JsGlobalization interop |
| src/libraries/Common/src/Interop/Browser/Interop.Locale.CoreCLR.cs | Updated to use SystemBrowserNative library |
| src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | Updated platform manifest for renamed Utils files |
| src/coreclr/hosts/corerun/CMakeLists.txt | Updated corerun build for renamed Utils file |
maraf
approved these changes
Dec 8, 2025
- fix ICU on selfhosted nodeJS
Co-authored-by: Copilot <[email protected]>
Member
Author
|
/ba-g CI failures are #122228 |
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.
fetchWasmandinstantiateWasmwithinstantiateStreamingconfig->ENVvariables for browserhostdotnetBootConfigmerging todotnet.jslibSystem.Native.Browser.Utils.jsJsGlobalizationcorerun.wasmfrom runtimepackdotnetSidecarfromdotnet.d.tsisSharedArrayBufferto cryptogetHeapU32Fixes #102200