-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser][coreCLR] browserhost improvements #122233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
There was a problem hiding this 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 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 |
- fix ICU on selfhosted nodeJS
Co-authored-by: Copilot <[email protected]>
fetchWasmandinstantiateWasmwithinstantiateStreamingconfig->ENVvariables for browserhostdotnetBootConfigmerging todotnet.jslibSystem.Native.Browser.Utils.jsJsGlobalizationcorerun.wasmfrom runtimepackdotnetSidecarfromdotnet.d.tsisSharedArrayBufferto cryptogetHeapU32