Skip to content

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Dec 5, 2025

  • implement fetchWasm and instantiateWasm with instantiateStreaming
  • propagate config->ENV variables for browserhost
  • allow dotnetBootConfig merging to dotnet.js
  • rename libSystem.Native.Browser.Utils.js
  • fix and rename JsGlobalization
  • skip corerun.wasm from runtimepack
  • remove dotnetSidecar from dotnet.d.ts
  • pass isSharedArrayBuffer to crypto
  • fix getHeapU32

- 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
@pavelsavara pavelsavara added this to the 11.0.0 milestone Dec 5, 2025
@pavelsavara pavelsavara self-assigned this Dec 5, 2025
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm labels Dec 5, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@pavelsavara pavelsavara marked this pull request as ready for review December 8, 2025 09:19
Copilot AI review requested due to automatic review settings December 8, 2025 09:19
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 implements several improvements to the browser/CoreCLR browserhost infrastructure, focusing on better WASM instantiation, configuration handling, and code organization.

Key Changes

  • Implemented fetchWasm and instantiateWasm using WebAssembly.instantiateStreaming for improved WASM loading
  • Renamed libSystem.Browser.Utils.js to libSystem.Native.Browser.Utils.js for naming consistency
  • Fixed library name resolution and split JsGlobalization interop into separate Mono/CoreCLR implementations
  • Propagated config environment variables to ENV for browserhost
  • Fixed getHeapU32 to properly return unsigned 32-bit integers
  • Passed isSharedArrayBuffer to crypto functions for threading support
  • Excluded corerun.wasm from 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants