You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotnet for wasm can be compiled with various MSBuild flags which enable the use of browser features. If you need to target an older version of the browser, then you may need to disable some of the dotnet features or optimizations.
4
+
5
+
For full set of MSBuild properties [see top of](src\mono\wasm\build\WasmApp.targets)
6
+
For set of [browser WASM features see](https://webassembly.org/roadmap/)
7
+
8
+
# Multi-threading
9
+
Is enabled by `<WasmEnableThreads>true</WasmEnableThreads>`.
10
+
It requires HTTP headers similar to `Cross-Origin-Embedder-Policy:require-corp` and `Cross-Origin-Opener-Policy:same-origin`.
11
+
See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
12
+
13
+
# SIMD - Single instruction, multiple data
14
+
Is performance optimization enabled by default. It requires recent version of browser.
15
+
You can disable it by `<WasmEnableSIMD>false</WasmEnableSIMD><WasmBuildNative>true</WasmBuildNative>`.
Copy file name to clipboardExpand all lines: src/mono/wasm/runtime/loader/polyfills.ts
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,19 +19,25 @@ const URLPolyfill = class URL {
19
19
};
20
20
21
21
exportfunctionverifyEnvironment(){
22
-
mono_assert(ENVIRONMENT_IS_SHELL||typeofglobalThis.URL==="function","This browser/engine doesn't support URL API. Please use a modern version.");
23
-
mono_assert(typeofglobalThis.BigInt64Array==="function","This browser/engine doesn't support BigInt64Array API. Please use a modern version.");
22
+
mono_assert(ENVIRONMENT_IS_SHELL||typeofglobalThis.URL==="function","This browser/engine doesn't support URL API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");
23
+
mono_assert(typeofglobalThis.BigInt64Array==="function","This browser/engine doesn't support BigInt64Array API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");
24
24
if(MonoWasmThreads){
25
-
mono_assert(!ENVIRONMENT_IS_SHELL&&!ENVIRONMENT_IS_NODE,"This build of dotnet is multi-threaded, it doesn't support shell environments like V8 or NodeJS.");
26
-
mono_assert(globalThis.SharedArrayBuffer!==undefined,"SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements");
27
-
mono_assert(typeofglobalThis.EventTarget==="function","This browser/engine doesn't support EventTarget API. Please use a modern version.");
25
+
mono_assert(!ENVIRONMENT_IS_SHELL&&!ENVIRONMENT_IS_NODE,"This build of dotnet is multi-threaded, it doesn't support shell environments like V8 or NodeJS. See also https://aka.ms/dotnet-wasm-features");
26
+
mono_assert(globalThis.SharedArrayBuffer!==undefined,"SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://aka.ms/dotnet-wasm-features");
27
+
mono_assert(typeofglobalThis.EventTarget==="function","This browser/engine doesn't support EventTarget API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");
28
28
}
29
-
30
-
// TODO detect other (WASM) features that are required for the runtime
31
-
// See https://github.com/dotnet/runtime/issues/84574
thrownewError(`NodeJS at '${process.execPath}' has too low version '${process.versions.node}', please use at least ${minNodeVersion}. See also https://aka.ms/dotnet-wasm-features`);
0 commit comments