Skip to content

Conversation

@pavelsavara
Copy link
Member

transforming those from API methods to flags, allows independent JS module other than dotnet.js to implement the functionality.

Contributes to #101169

@pavelsavara pavelsavara added this to the 11.0.0 milestone Dec 17, 2025
@pavelsavara pavelsavara self-assigned this Dec 17, 2025
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Dec 17, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

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 refactors internal testing switches from dedicated API methods to configuration flags, enabling independent JavaScript modules (not just dotnet.js) to implement the functionality. This is part of the effort to modularize the WebAssembly runtime initialization.

Key changes:

  • Removed dedicated API methods like withElementOnExit(), withConsoleForwarding(), withExitCodeLogging(), etc.
  • Replaced them with a unified .withConfig() approach accepting configuration flags
  • Updated installUnhandledErrorHandler() to be called conditionally based on the config flag rather than within a method

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tests/FunctionalTests/WebAssembly/Browser/HotReload/main.js Converts .withElementOnExit() to .withConfig({ appendElementOnExit: true })
src/mono/wasm/testassets/WasmOnAspNetCore/WasmBrowserClient/wwwroot/main.js Consolidates three method calls into a single .withConfig() call with three flags
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Replaces multiple chained method calls with unified config object approach
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTestsBase.cs Updates C# test template generation to use new config syntax
src/mono/sample/wasm/browser/wwwroot/main.js Converts testing switch methods to config flags
src/mono/sample/wasm/browser-threads/wwwroot/main.js Merges testing flags into existing .withConfig() call
src/mono/sample/wasm/browser-shutdown/wwwroot/main.js Replaces .withOnConfigLoaded() with .withModuleConfig({ onConfigLoaded: ... })
src/mono/sample/wasm/browser-profile/wwwroot/main.js Moves testing flags into existing config object
src/mono/sample/wasm/browser-logprofile/wwwroot/main.js Consolidates testing switches and fixes spacing in unrelated line
src/mono/sample/wasm/browser-eventpipe/wwwroot/main.js Converts two method calls to config flags
src/mono/sample/wasm/browser-bench/wwwroot/main.js Removes two method calls and adds config flags (incomplete migration)
src/mono/sample/wasm/browser-advanced/wwwroot/main.js Moves testing flag into existing config object
src/mono/sample/wasm/Directory.Build.targets Adds additional nested build properties for better build configuration
src/mono/browser/test-main.js Consolidates multiple testing method calls into unified config object
src/mono/browser/runtime/types/internal.ts Removes obsolete linkerEnabled field from internal config type
src/mono/browser/runtime/loader/run.ts Removes API methods and moves installUnhandledErrorHandler() call to be conditional on config flag
src/libraries/sendtohelix-browser.targets Updates comment to reference new config flag name instead of old method name

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

Labels

arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants