Uh oh!
There was an error while loading. Please reload this page.
[browser][mono] simplify internal testing switches - #122616
Conversation
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
transforming those from API methods to flags, allows independent JS module other than
dotnet.jsto implement the functionality.Contributes to #101169