From b4bd20761966da2a08e19142a652cb9f52a070a3 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:53:14 +0000 Subject: [PATCH 1/3] Backport changes. --- .../runtime-extra-platforms-wasm.yml | 94 +++++++------------ eng/testing/WasmRunnerTemplate.cmd | 12 +-- eng/testing/WasmRunnerTemplate.sh | 23 ++++- eng/testing/tests.browser.targets | 6 -- .../LocalEchoServer.helix.targets | 2 +- .../Net/Prerequisites/LocalEchoServer.props | 11 --- ...ization.Calendars.Hybrid.WASM.Tests.csproj | 2 +- ...tem.Globalization.Hybrid.WASM.Tests.csproj | 2 +- ...System.IO.Compression.ZipFile.Tests.csproj | 2 +- .../tests/System.IO.Compression.Tests.csproj | 2 +- .../System.Net.Http.Functional.Tests.csproj | 2 +- .../System.Net.WebSockets.Client.Tests.csproj | 2 +- .../tests/System.Private.Xml.Tests.csproj | 2 +- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 1 - .../wasm/Wasm.Build.Tests/Common/RunHost.cs | 3 +- .../HostRunner/NodeJSHostRunner.cs | 15 --- .../Wasm.Build.Tests/MainWithArgsTests.cs | 8 -- src/mono/wasm/features.md | 30 +----- .../wasm/testassets/Blazor_net50/App.razor | 10 -- .../Blazor_net50/Blazor_net50.csproj | 13 --- .../Blazor_net50/Pages/Counter.razor | 16 ---- .../Blazor_net50/Pages/FetchData.razor | 55 ----------- .../testassets/Blazor_net50/Pages/Index.razor | 7 -- .../wasm/testassets/Blazor_net50/Program.cs | 25 ----- .../Blazor_net50/Shared/MainLayout.razor | 17 ---- .../Blazor_net50/Shared/MainLayout.razor.css | 70 -------------- .../Blazor_net50/Shared/NavMenu.razor | 37 -------- .../Blazor_net50/Shared/NavMenu.razor.css | 62 ------------ .../Blazor_net50/Shared/SurveyPrompt.razor | 16 ---- .../testassets/Blazor_net50/_Imports.razor | 10 -- 30 files changed, 63 insertions(+), 494 deletions(-) delete mode 100644 src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs delete mode 100644 src/mono/wasm/testassets/Blazor_net50/App.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Blazor_net50.csproj delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Pages/Counter.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Pages/FetchData.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Pages/Index.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Program.cs delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor.css delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor.css delete mode 100644 src/mono/wasm/testassets/Blazor_net50/Shared/SurveyPrompt.razor delete mode 100644 src/mono/wasm/testassets/Blazor_net50/_Imports.razor diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 3fe2e54610d925..3c5df807855b0d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -80,67 +80,6 @@ jobs: - normal - WasmTestOnBrowser - # this only runs on the extra pipeline - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - nameSuffix: _NodeJs - extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} - alwaysRun: ${{ parameters.isWasmOnlyBuild }} - scenarios: - - WasmTestOnNodeJS - - # Library tests - Windows - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm_win - # Don't run for rolling builds, as this is covered - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} - scenarios: - - WasmTestOnBrowser - - WasmTestOnNodeJS - - # Smoke tests only with full threading - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - #- browser_wasm_win - nameSuffix: _Threading_Smoke - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - shouldRunSmokeOnly: true - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} - # Always run for runtime-wasm because browser testing is not on runtime - alwaysRun: ${{ parameters.isWasmOnlyBuild }} - scenarios: - - WasmTestOnBrowser - - # Library tests with full threading - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - #- browser_wasm_win - nameSuffix: _Threading - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} - isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} - # Always run for runtime-wasm because tests are not run in runtime - alwaysRun: ${{ parameters.isWasmOnlyBuild }} - - # NOTE - Since threading is experimental, we don't want to block mainline work - shouldContinueOnError: true - scenarios: - - WasmTestOnBrowser - #- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592 - - # EAT Library tests - only run on linux - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml parameters: @@ -193,7 +132,38 @@ jobs: shouldContinueOnError: ${{ not(parameters.isWasmOnlyBuild) }} alwaysRun: ${{ variables.isRollingBuild }} scenarios: - - normal + - WasmTestOnWasmtime + + # Hybrid Globalization tests + - template: /eng/pipelines/common/templates/wasm-library-tests.yml + parameters: + platforms: + - browser_wasm + - browser_wasm_win + nameSuffix: _HybridGlobalization + extraBuildArgs: /p:HybridGlobalization=true + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + alwaysRun: true + scenarios: + - WasmTestOnChrome + - WasmTestOnFirefox + + # # Hybrid Globalization AOT tests + # # ActiveIssue: https://github.com/dotnet/runtime/issues/51746 + # - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml + # parameters: + # platforms: + # - browser_wasm + # - browser_wasm_win + # nameSuffix: _HybridGlobalization_AOT + # extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) /p:HybridGlobalization=true + # runAOT: true + # isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + # isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + # alwaysRun: true + # scenarios: + # - WasmTestOnChrome - ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeNonLibTests, true), ne(parameters.debuggerTestsOnly, true)) }}: # Builds only diff --git a/eng/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd index a8c9c0ac571269..3df85759dadf65 100644 --- a/eng/testing/WasmRunnerTemplate.cmd +++ b/eng/testing/WasmRunnerTemplate.cmd @@ -34,11 +34,7 @@ if [%XHARNESS_COMMAND%] == [] ( if /I [%XHARNESS_COMMAND%] == [test] ( if [%JS_ENGINE%] == [] ( - if /I [%SCENARIO%] == [WasmTestOnNodeJS] ( - set "JS_ENGINE=--engine^=NodeJS" - ) else ( - set "JS_ENGINE=--engine^=V8" - ) + set "JS_ENGINE=--engine^=V8" ) if [%MAIN_JS%] == [] ( set "MAIN_JS=--js-file^=test-main.js" @@ -46,12 +42,6 @@ if /I [%XHARNESS_COMMAND%] == [test] ( if [%JS_ENGINE_ARGS%] == [] ( set "JS_ENGINE_ARGS=--engine-arg^=--stack-trace-limit^=1000" - if /I NOT [%SCENARIO%] == [WasmTestOnNodeJS] ( - set "JS_ENGINE_ARGS=%JS_ENGINE_ARGS% --engine-arg^=--module" - ) - if /I [%SCENARIO%] == [WasmTestOnNodeJS] ( - set "JS_ENGINE_ARGS=%JS_ENGINE_ARGS% --engine-arg^=--experimental-wasm-eh" - ) ) ) else ( if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] ( diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index 8b4e9adb10c2ef..09adc96ac1a81e 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -48,11 +48,26 @@ if [[ "$XHARNESS_COMMAND" == "test" ]]; then if [[ -z "$JS_ENGINE_ARGS" ]]; then JS_ENGINE_ARGS="--engine-arg=--stack-trace-limit=1000" - if [[ "$SCENARIO" != "WasmTestOnNodeJS" && "$SCENARIO" != "wasmtestonnodejs" ]]; then - JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--module" + JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--module" + fi + + if [[ -z "$JS_ENGINE" ]]; then + JS_ENGINE="--engine=V8" + if [[ -n "$V8_PATH_FOR_TESTS" ]]; then + JS_ENGINE_ARGS="$JS_ENGINE_ARGS --js-engine-path=$V8_PATH_FOR_TESTS" fi - if [[ "$SCENARIO" == "WasmTestOnNodeJS" || "$SCENARIO" == "wasmtestonnodejs" ]]; then - JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--experimental-wasm-eh" + fi +else + if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then + if [[ -z "$JS_ENGINE_ARGS" ]]; then + JS_ENGINE_ARGS="--browser-arg=--js-flags=--stack-trace-limit=1000" + fi + elif [[ "$SCENARIO" == "WasmTestOnFirefox" || "$SCENARIO" == "wasmtestonfirefox" ]]; then + if [[ -z "$JS_ENGINE" ]]; then + JS_ENGINE="--browser=Firefox" + fi + if [[ -z "$JS_ENGINE_ARGS" ]]; then + JS_ENGINE_ARGS="--browser-arg=-private-window" fi fi fi diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index 8c4b3e46c9eac9..dc641cd37b27b4 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -244,15 +244,9 @@ - - - - - - diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets index 80f1eb750e10f1..0ce76102c0f71a 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets +++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets @@ -1,7 +1,7 @@ + '$(Scenario)' == 'WasmTestOnBrowser')"> $(HelixExtensionTargets);_AddMiddlewarePayload $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(Configuration)', '$(AspNetCoreAppCurrent)')) diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props index 53fe2308aa5458..d8aa8bcff26cfb 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props +++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props @@ -36,15 +36,4 @@ - - - - - - - - - - - diff --git a/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj b/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj index 79d84271152dc4..7d12092bdbd88d 100644 --- a/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj +++ b/src/libraries/System.Globalization.Calendars/tests/Hybrid/System.Globalization.Calendars.Hybrid.WASM.Tests.csproj @@ -8,7 +8,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER true diff --git a/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj b/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj index f4e811abb490be..2f42822fdae435 100644 --- a/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj +++ b/src/libraries/System.Globalization/tests/Hybrid/System.Globalization.Hybrid.WASM.Tests.csproj @@ -9,7 +9,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER true diff --git a/src/libraries/System.IO.Compression.ZipFile/tests/System.IO.Compression.ZipFile.Tests.csproj b/src/libraries/System.IO.Compression.ZipFile/tests/System.IO.Compression.ZipFile.Tests.csproj index be0d1f463fad79..7b3d6b295d7a37 100644 --- a/src/libraries/System.IO.Compression.ZipFile/tests/System.IO.Compression.ZipFile.Tests.csproj +++ b/src/libraries/System.IO.Compression.ZipFile/tests/System.IO.Compression.ZipFile.Tests.csproj @@ -9,7 +9,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER diff --git a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj index 7715606fcfdd4d..028991a625cb98 100644 --- a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj +++ b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj @@ -8,7 +8,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index ecb5832af79ca1..61435a06dc484c 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -22,7 +22,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER --setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot diff --git a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj index ab217e8efea8ea..8ee9d5bc721510 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj +++ b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj @@ -12,7 +12,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER --setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot diff --git a/src/libraries/System.Private.Xml/tests/System.Private.Xml.Tests.csproj b/src/libraries/System.Private.Xml/tests/System.Private.Xml.Tests.csproj index d349b820a32b82..306038a36fb371 100644 --- a/src/libraries/System.Private.Xml/tests/System.Private.Xml.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/System.Private.Xml.Tests.csproj @@ -14,7 +14,7 @@ WasmTestOnBrowser - $(TestArchiveRoot)browserornodejs/ + $(TestArchiveRoot)browseronly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 9633d22701cf0d..680d2efd5c5cbc 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -603,7 +603,6 @@ public static int Main() private static IHostRunner GetHostRunnerFromRunHost(RunHost host) => host switch { RunHost.V8 => new V8HostRunner(), - RunHost.NodeJS => new NodeJSHostRunner(), _ => new BrowserHostRunner(), }; } diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs b/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs index 137316ebb546c5..0aa1ae14ea8120 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs @@ -13,8 +13,7 @@ public enum RunHost Chrome = 2, Safari = 4, Firefox = 8, - NodeJS = 16, - All = V8 | NodeJS | Chrome//| Firefox//Safari + All = V8 | Chrome//| Firefox//Safari } } diff --git a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs b/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs deleted file mode 100644 index cf311557c27f2e..00000000000000 --- a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable enable - -namespace Wasm.Build.Tests; - -public class NodeJSHostRunner : IHostRunner -{ - public string GetTestCommand() => "wasm test"; - public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace"; - public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale}"; - public bool UseWasmConsoleOutput() => true; - public bool CanRunWBT() => true; -} diff --git a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs index eb9829438f75d4..57fce4790ec70c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs @@ -38,14 +38,6 @@ public static async System.Threading.Tasks.Task Main(string[] args) }", buildArgs, args, host, id); - [Theory] - [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] - [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] - public void TopLevelWithArgs(BuildArgs buildArgs, string[] args, RunHost host, string id) - => TestMainWithArgs("top_level_args", - @"##CODE## return await System.Threading.Tasks.Task.FromResult(42 + count);", - buildArgs, args, host, id); - [Theory] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] diff --git a/src/mono/wasm/features.md b/src/mono/wasm/features.md index d3d85f2e570a9e..46d3f5b702cb71 100644 --- a/src/mono/wasm/features.md +++ b/src/mono/wasm/features.md @@ -40,15 +40,11 @@ It can be enabled with `true` and disabled with For more information on this feature, see [SIMD.md](https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md). -Older versions of NodeJS hosts may need `--experimental-wasm-simd` command line option. - ### EH - Exception handling WebAssembly exception handling provides higher performance for code containing `try` blocks by allowing exceptions to be caught and thrown natively without the use of JavaScript. It is currently enabled by default and can be disabled via `false`. For more information on this feature, see [Exceptions.md](https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md) -Older versions of NodeJS hosts may need `--experimental-wasm-eh` command line option. - ### BigInt Passing Int64 and UInt64 values between JavaScript and C# requires support for the JavaScript `BigInt` type. See [JS-BigInt](https://github.com/WebAssembly/JS-BigInt-integration) for more information on this API. @@ -59,15 +55,11 @@ Because web browsers do not expose direct access to sockets, we are unable to pr A prominent limitation is that your application must obey `Cross-Origin Resource Sharing` (CORS) rules in order to perform network requests successfully - see [CORS on MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) for more information. -For your application to be able to perform HTTP requests in a NodeJS host, you need to install the `node-fetch` and `node-abort-controller` npm packages. - ### WebSocket Applications using the [WebSocketClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket) managed API will require the browser to support the [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) API. As with HTTP and HttpClient, we are unable to ship a custom implementation of this feature, so its behavior will depend on the browser being used to run the application. -WebSocket support in NodeJS hosts requires the `ws` npm package. - ### Initial Memory Size By default the .NET runtime will reserve a small amount of memory at startup, and as your application allocates more objects the runtime will attempt to "grow" this memory. This growth operation takes time and could fail if your device's memory is limited, which would result in an application error or "tab crash". @@ -289,26 +281,8 @@ Mobile browsers typically have strict limits on the amount of memory they can us A WebAssembly application that works well on desktop PCs browser may take minutes to download or run out of memory before it is able to start on a mobile device, and the same is true for .NET. -### Shell environments - NodeJS & V8 -While our primary target is web browsers, we have partial support for Node.JS v14 sufficient to pass most of our automated tests. We also have partial support for the D8 command-line shell, version 11 or higher, sufficient to pass most of our automated tests. Both of these environments may lack support for features that are available in the browser. - -#### NodeJS < 20 -Until node version 20, you may need to pass these arguments when running the application `--experimental-wasm-simd --experimental-wasm-eh`. When you run the application using `dotnet run`, you can add these to the runtimeconfig template - -```json -"wasmHostProperties": { - "perHostConfig": [ - { - "name": "node", - ... - "host-args": [ - "--experimental-wasm-simd", // 👈 Enable SIMD support - "--experimental-wasm-eh" // 👈 Enable exception handling support - ] - } - ] -} -``` +### Shell environments - V8 +While our primary target is web browsers, we have partial support for D8/V8 command-line shell, version 11 or higher, sufficient to pass most of our automated tests. Both of these environments may lack support for features that are available in the browser. ## Choosing the right platform target Every end user has different needs, so the right platform for every application may differ. diff --git a/src/mono/wasm/testassets/Blazor_net50/App.razor b/src/mono/wasm/testassets/Blazor_net50/App.razor deleted file mode 100644 index b941644e298f13..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/App.razor +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - -

Sorry, there's nothing at this address.

-
-
-
diff --git a/src/mono/wasm/testassets/Blazor_net50/Blazor_net50.csproj b/src/mono/wasm/testassets/Blazor_net50/Blazor_net50.csproj deleted file mode 100644 index 533c04800b235a..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Blazor_net50.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net5.0 - - - - - - - - - diff --git a/src/mono/wasm/testassets/Blazor_net50/Pages/Counter.razor b/src/mono/wasm/testassets/Blazor_net50/Pages/Counter.razor deleted file mode 100644 index 8641f781999a93..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Pages/Counter.razor +++ /dev/null @@ -1,16 +0,0 @@ -@page "/counter" - -

Counter

- -

Current count: @currentCount

- - - -@code { - private int currentCount = 0; - - private void IncrementCount() - { - currentCount++; - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Pages/FetchData.razor b/src/mono/wasm/testassets/Blazor_net50/Pages/FetchData.razor deleted file mode 100644 index 4432ee5d90174c..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Pages/FetchData.razor +++ /dev/null @@ -1,55 +0,0 @@ -@page "/fetchdata" -@inject HttpClient Http - -

Weather forecast

- -

This component demonstrates fetching data from the server.

- -@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - -@code { - private WeatherForecast[] forecasts; - - protected override async Task OnInitializedAsync() - { - forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); - } - - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public string Summary { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Pages/Index.razor b/src/mono/wasm/testassets/Blazor_net50/Pages/Index.razor deleted file mode 100644 index e54d914390e1d8..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Pages/Index.razor +++ /dev/null @@ -1,7 +0,0 @@ -@page "/" - -

Hello, world!

- -Welcome to your new app. - - diff --git a/src/mono/wasm/testassets/Blazor_net50/Program.cs b/src/mono/wasm/testassets/Blazor_net50/Program.cs deleted file mode 100644 index b1926ec328b4e2..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Net.Http; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Text; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace Blazor_net50 -{ - public class Program - { - public static async Task Main(string[] args) - { - var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("#app"); - - builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - - await builder.Build().RunAsync(); - } - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor b/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor deleted file mode 100644 index b416cb95698cc1..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor +++ /dev/null @@ -1,17 +0,0 @@ -@inherits LayoutComponentBase - -
- - -
-
- About -
- -
- @Body -
-
-
diff --git a/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor.css b/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor.css deleted file mode 100644 index 43c355a47ac73a..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Shared/MainLayout.razor.css +++ /dev/null @@ -1,70 +0,0 @@ -.page { - position: relative; - display: flex; - flex-direction: column; -} - -.main { - flex: 1; -} - -.sidebar { - background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); -} - -.top-row { - background-color: #f7f7f7; - border-bottom: 1px solid #d6d5d5; - justify-content: flex-end; - height: 3.5rem; - display: flex; - align-items: center; -} - - .top-row ::deep a, .top-row .btn-link { - white-space: nowrap; - margin-left: 1.5rem; - } - - .top-row a:first-child { - overflow: hidden; - text-overflow: ellipsis; - } - -@media (max-width: 640.98px) { - .top-row:not(.auth) { - display: none; - } - - .top-row.auth { - justify-content: space-between; - } - - .top-row a, .top-row .btn-link { - margin-left: 0; - } -} - -@media (min-width: 641px) { - .page { - flex-direction: row; - } - - .sidebar { - width: 250px; - height: 100vh; - position: sticky; - top: 0; - } - - .top-row { - position: sticky; - top: 0; - z-index: 1; - } - - .main > div { - padding-left: 2rem !important; - padding-right: 1.5rem !important; - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor b/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor deleted file mode 100644 index d2f6197a2433da..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor +++ /dev/null @@ -1,37 +0,0 @@ - - -
- -
- -@code { - private bool collapseNavMenu = true; - - private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; - - private void ToggleNavMenu() - { - collapseNavMenu = !collapseNavMenu; - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor.css b/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor.css deleted file mode 100644 index acc5f9f8191976..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Shared/NavMenu.razor.css +++ /dev/null @@ -1,62 +0,0 @@ -.navbar-toggler { - background-color: rgba(255, 255, 255, 0.1); -} - -.top-row { - height: 3.5rem; - background-color: rgba(0,0,0,0.4); -} - -.navbar-brand { - font-size: 1.1rem; -} - -.oi { - width: 2rem; - font-size: 1.1rem; - vertical-align: text-top; - top: -2px; -} - -.nav-item { - font-size: 0.9rem; - padding-bottom: 0.5rem; -} - - .nav-item:first-of-type { - padding-top: 1rem; - } - - .nav-item:last-of-type { - padding-bottom: 1rem; - } - - .nav-item ::deep a { - color: #d7d7d7; - border-radius: 4px; - height: 3rem; - display: flex; - align-items: center; - line-height: 3rem; - } - -.nav-item ::deep a.active { - background-color: rgba(255,255,255,0.25); - color: white; -} - -.nav-item ::deep a:hover { - background-color: rgba(255,255,255,0.1); - color: white; -} - -@media (min-width: 641px) { - .navbar-toggler { - display: none; - } - - .collapse { - /* Never collapse the sidebar for wide screens */ - display: block; - } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/Shared/SurveyPrompt.razor b/src/mono/wasm/testassets/Blazor_net50/Shared/SurveyPrompt.razor deleted file mode 100644 index 67828b574bb9df..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/Shared/SurveyPrompt.razor +++ /dev/null @@ -1,16 +0,0 @@ - - -@code { - // Demonstrates how a parent component can supply parameters - [Parameter] - public string Title { get; set; } -} diff --git a/src/mono/wasm/testassets/Blazor_net50/_Imports.razor b/src/mono/wasm/testassets/Blazor_net50/_Imports.razor deleted file mode 100644 index d6b66f28b94f7d..00000000000000 --- a/src/mono/wasm/testassets/Blazor_net50/_Imports.razor +++ /dev/null @@ -1,10 +0,0 @@ -@using System.Net.Http -@using System.Net.Http.Json -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using Microsoft.AspNetCore.Components.Web.Virtualization -@using Microsoft.AspNetCore.Components.WebAssembly.Http -@using Microsoft.JSInterop -@using Blazor_net50 -@using Blazor_net50.Shared From 3df7abd833349083755529c3c1b3fc0cf6bbe9b0 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:32:54 +0000 Subject: [PATCH 2/3] Fix build. --- src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs index dbaeba4bb1165b..eb05d5bfc81416 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs @@ -35,8 +35,8 @@ public IcuShardingTests(ITestOutputHelper output, SharedBuildPerTestClassFixture .UnwrapItemsAsArrays(); [Theory] - [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { true, RunHost.Chrome })] public void CustomIcuShard(BuildArgs buildArgs, string shardName, string testedLocales, bool onlyPredefinedCultures, RunHost host, string id) => TestIcuShards(buildArgs, shardName, testedLocales, host, id, onlyPredefinedCultures); From c73dcc3001e77a64f982aa63033809fd58baf4fc Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:34:12 +0000 Subject: [PATCH 3/3] Remaining. --- src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs | 4 ++-- src/mono/wasm/Wasm.Build.Tests/IcuTests.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs index c04d5c1114dc00..221850f27a188d 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs @@ -32,8 +32,8 @@ public IcuShardingTests2(ITestOutputHelper output, SharedBuildPerTestClassFixtur [Theory] - [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { true, RunHost.Chrome })] public void DefaultAvailableIcuShardsFromRuntimePack(BuildArgs buildArgs, string shardName, string testedLocales, RunHost host, string id) => TestIcuShards(buildArgs, shardName, testedLocales, host, id); } \ No newline at end of file diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs index 0f58d24ac9f3d0..5137de3c096a2b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs @@ -37,8 +37,8 @@ public IcuTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildCo .UnwrapItemsAsArrays(); [Theory] - [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { true, RunHost.Chrome })] public void FullIcuFromRuntimePackWithInvariant(BuildArgs buildArgs, bool invariant, bool fullIcu, string testedLocales, RunHost host, string id) { string projectName = $"fullIcuInvariant_{fullIcu}_{invariant}_{buildArgs.Config}_{buildArgs.AOT}"; @@ -60,8 +60,8 @@ public void FullIcuFromRuntimePackWithInvariant(BuildArgs buildArgs, bool invari } [Theory] - [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { true, RunHost.Chrome })] public void FullIcuFromRuntimePackWithCustomIcu(BuildArgs buildArgs, bool fullIcu, RunHost host, string id) { string projectName = $"fullIcuCustom_{fullIcu}_{buildArgs.Config}_{buildArgs.AOT}";