7.0.6
WebAssembly Bootstrap 7.0
Along with the .NET 7 support, we’re introducing a stable version of the Uno.Wasm.Bootstrap package, the foundation of Uno.UI’s WebAssembly support. We’ve adjusted the versioning scheme so that the major version number matches the associated .NET runtime version.
This new version of the bootstrapper is backward compatible with your net6.0 apps, and you don’t need to upgrade to .NET 7 to use it.
This release is built using the .NET 7.0.100 sources that the .NET team will use on release day, meaning that you’re already set to use the latest and greatest.
This release introduces a lot of new fixes and features, let’s dive in detail.
-
Obfuscation and custom extensions support has been added to work around firewalls and antiviruses that may block .NET binaries. Uno already uses the “.clr” extension, yet some anti-viruses may still detect the Win32 header through deep inspection, which simple obfuscation can work around.
-
Static assets support, used for ASP.NET Core hosting. See the ASP.NET Core Hosting section in this post for more information. This feature allows for an ASP.NET Core project to take a “project reference” on a WebAssembly app, to include its output in the “wwwroot” folder to deploy in a single package. The introduction of the new
Uno.Wasm.Bootstrap.Server
package supports ASP.NET Core projects host Uno Wasm Bootstrap projects to serve these static assets. -
Threading preview support, a big demand for performance hungry users. Threading makes use of WebAssembly threads and comes close to the desktop threading model. A new SynchronizationContext has been introduced to easily go back and forth the main thread. The support is still in preview as there are still some threading affinity issues with JS-bound APIs that need to be fixed. As we mentioned back in June, give it a try and let us know what you can do with it!
Also note that threading requires a specific security context in browsers, which can cause SSO flows to fail.
Threading can be enabled using
<WasmShellEnableThreads>true</WasmShellEnableThreads>
in your csproj. -
SIMD support, another big demand from performance hungry apps. This feature enables the use of the Fixed-width SIMD WebAssembly specification and is available when building with AOT enabled. The hardware support for SIMD can be checked through the Vector.IsHardwareAccelerated.
-
Native libraries support updated layout, where the inclusion of optional Threading and SIMD makes for a new matrix of possibilities for native libraries. While threading is supported by all browsers (its preview status and security restrictions can make it inapplicable for some apps), and SIMD is not yet supported by Safari, it’s required for native libraries to be providing a matrix of already compiled versions of binaries.
You’ll find examples of this new format in Uno.Sqlite-wasm and SkiaSharp, which looks like this in a package:
-
Native signatures generation support, which enables P/Invoke signatures to be anything that the app’s code will provide. This is particularly useful for interoperability with large native libraries, like SQLite.
Finally, as the main branch of dotnet/runtime is already on .NET 8, so are the Uno.Wasm.Bootstrap development builds, and there are some amazing improvements coming.