Safari 16.4 Support for WebAssembly fixed-width SIMD. How to use it with C#

Share on twitter Share on linkedin Share on reddit This article covers: What is WebAssembly’s fixed-width SIDM. Creating an Uno Platform WebAssembly project with code using the Vector128 type. Adjusting the project file to ahead-of-time (AOT) compile and include SIMD support. Fixing a publishing error if you accidentally checked the AOT compile option in the Publish dialog. WebAssembly has a feature called fixed-width SIMD that takes advantage of hardware instructions to speed up calculations by running them in parallel. Chrome and Firefox added support for the feature back in 2021, which was good, but many devices couldn’t leverage the performance improvements without Safari’s support. That all changed on March 27th, 2023, because Safari 16.4 was released, and now all modern browsers support WebAssembly fixed-width SIMD! Fixed-Width SIMD (Single Instruction, Multiple data) is a type of parallel processing that takes advantage of an architecture’s SIMD instructions to perform the same operation on multiple data points simultaneously. Because there are multiple types of SIMD, the WebAssembly Community Group decided that it would be best to start with fixed-width 128-bit operations because they’re available across most modern architectures and are proven to be performant. More details on the proposal can be found here if you’re

Optimizing Uno Platform WebAssembly Applications for Peak Performance

Share on twitter Share on linkedin Share on reddit In this article, we will be discussing various tips and best practices for maximizing the performance of your Uno Platform WebAssembly applications, including ways to reduce startup times, improve rendering, and optimize memory usage. Whether you’re a seasoned developer or new to the Uno Platform, this article will provide valuable insights and techniques to help you create fast and efficient applications. A natural question to ask is – “Why aren’t these options available by default?”. Fair question! The defaults we have set are there to optimize your ‘inner dev loop’ productivity. Once the Web app is deployed you can get significant performance improvements just by toggling a few options. So, let’s dive in and start optimizing! Steps to Optimize Performance Make sure to build using the Release configuration dotnet build -c Release on the command line in your CI pipeline). Debug configuration disables a lot of performance optimizations. This is the prime spot where we’ve prioritizet the “inner, developer, loop”. Just changing this option will get you 2x improvements or more, depending on the scenario. Upgrade to the latest Uno.Wasm.Bootstrap packages (7.0.17 as of writing of this blog) to benefit from

Creating Elegant Reports in WebAssembly Apps with DevExpress Reporting and Uno Platform

Share on twitter Share on linkedin Share on reddit Good engineers integrate when and where it makes sense regardless of the territory being charted. Great engineers and community members explore that uncharted territory and map it out for others.  This is what one of our clients and contributors – Kahua – faced when facing a business challenge. They solved it and shared some tips on how to go about it for anyone who walks the same path.   The Challenge Kahua needed to create a large number of dashboards and reports across platforms and devices on top of the Uno Platform powered Web Application and soon mobile and desktop applications.  On the technical side, this meant connecting two advanced and complex frameworks with an enterprise application and bringing forward what all three entities do the best.  DevExpress is a widely used powerful reporting framework which is highly configurable and works cross-platform.   Uno Platform provides multi-platform support for applications built with C# and XAML. Kahua is an enterprise application which provides complex configuration, user-defined applications and runs on .NET.   Uno Platform and DevExpress are using .NET and JavaScript to provide their functionality beside other technologies. Meanwhile, Kahua is utilizing .NET

The State of WebAssembly – 2022 and 2023

Share on twitter Share on linkedin Share on reddit In this article, I will look at the current state of WebAssembly (wasm). I’ll start by revisiting 2022 developments to see if any of my predictions came true and if there were any surprises. Then I’ll try to predict where I think things will go in 2023. 2022 In Review In 2021, Safari surprised me with how much work went into catching up to the other browsers’ WebAssembly support. So how did Safari do over the past year? Safari Safari has continued to improve its WebAssembly support by implementing several bug fixes and improvements, but most of its visible work went into improving the browser in other areas. Although there weren’t prominent wasm features implemented this past year compared to what happened the year before, a lot is happening under the hood. For example, in last year’s prediction, I thought fixed-width SIMD was something that Safari would implement in 2022 and round out browser support for it. Unfortunately, fixed-width SIMD didn’t make it into Safari in 2022, but it’s now complete and part of Technical Preview 161! Update: Safari added support for WASM SIMD on March 28th, 2023. See Safari 16.4 Support for WebAssembly

Building Apps for MS Teams in C# and XAML with Uno Platform

In this blog, we’ll explore how Uno Platform and WebAssembly make it possible to develop apps for Microsoft Teams using C# and XAML. And how they can help streamline your workflows, automate tasks, and bring new capabilities to your team. By the end of this tutorial, you will have a simple sample app running in web version of Microsoft Teams, similar to our Getting Started tutorial. (Create a Single Page App with Uno Platform) Prerequisites 1. Visual Studio 2022 includes built-in support for Microsoft Teams and provides useful starter templates, but they are not installed by default with any workloads. Instead, we need to select them in the Visual Studio Installer manually. Open the Visual Studio Installer and click Modify on your favourite Visual Studio 2022 instance. Next, select the ASP.NET and web development workload and then find and check the Microsoft Teams development tools option in the Installation details pane. 2. While you can technically test your Microsoft Teams on your production tenant, creating a developer account in the Microsoft 365 Developer Program is preferable. First, go to the official website here and click Join. Next, log in using your Microsoft or company account and fill out the requested information. When successfully logged in, click the Set up E5

Adding Google Maps to your Uno Platform-WASM App

Google Maps is the leading location data and visualization platform for the web, but the functionality of Google Maps extends well beyond its mobile app — if you are building a mobile, web, or desktop app and want to include location displays in any way, Google Maps offers  developer APIs that give access to Google’s geographical data.  Google Maps API allows you to display and leverage interactive maps to help users create itineraries, routes, and more. Its data also refreshes in real-time, meaning that maps you create with Google API will always be up to date for visitors.  Recently, a new Uno Platform user was looking to implement Google Maps into his Uno Platform WASM application but was running into some blockers since MapControl does not provide WASM support yet. Luckily, you can integrate Uno-WASM Web Applications with existing JavaScript components and it’s quite simple.   In this article, Martin Zickmund works through a step-by-step guide on how you can easily implement Google Maps into your WASM application.    Get the Google Maps API key You can follow any tutorial available on the web like here on how to get an API key via the Google Developer Console. It involves creating a

Theme-Aware Splash Screen in Uno Platform WebAssembly

We’re always keeping an ear out for feature requests, bugs, and issues raised by the community so we can continue to better improve Uno Platform. So when @TopperDEL brought up a great question about the possibility to use theme-aware splash screens on Uno Platform Discord channel, Martin Zikmund was quick to offer a solution. Splash Screen A “Splash Screen” is the first image or page displayed when you first load your application, while the application is initializing. The splash screen remains visible until the first page of the application is ready to display. Unlike iOS, Android and Windows, WebAssembly does not yet support theme respecting splash screens. For those interested, the PR can be seen here. And now, with the stable release of Uno.Wasm.Bootstrap 3.3.1 it can be used in all Uno Platforms apps literally with a single line change! Here’s How To Do ItOpen the AppManifest.js file in the WasmScripts folder of the WASM project in any Uno Platform app solution and either set the splashScreenColor to transparent or delete the property entirely: var UnoAppManifest = { splashScreenImage: “Assets/SplashScreen.png”, splashScreenColor: “transparent”, displayName: “Theme-aware splash screen” } And voilà! The splash screen will now match the theme of your OS or browser! Note: To achieve the same effect in UWP/WinAppSDK the exact same change is required in the

The State of WebAssembly – 2021 and 2022

In this article, I’m going to take the same approach that I used last year to show you the current state of WebAssembly. I’ll look at the big events of the past year and then try to predict where I think things are going in 2022. 2021 in Review This past year turned out to be a much bigger year for WebAssembly than I was expecting, especially around the Safari web browser. Safari When the MVP of WebAssembly was released back in 2017, Safari was right there with the same features as the rest of the browsers. In the years that followed, Safari unfortunately fell behind. Over 2021, I was very pleased to see a lot of work put into Safari to bring its WebAssembly support up to date. As of the Safari 15.2 release on December 14th, some of the features added to Safari over 2021 include: Streaming Compilation Bulk Memory Operations Addressable Memory can now reach 4GB Exception Handling Support for the COOP (Cross-Origin-Opener-Policy) and COEP (Cross-Origin-Embedder-Policy) response headers Atomic Instructions The re-enabling of the SharedArrayBuffer for sites that use the COOP/COEP response header SharedArrayBuffer WebAssembly uses the SharedArrayBuffer to share memory between WebAssembly threads. Unfortunately, the buffer

Uno Platform SQLite for WebAssembly support on .NET 5 and .NET 6

WebAssembly Support for SQLite and Erik Sink’s SQLitePCL.raw has been present in Uno Platform for quite some time now, when running under the mono runtime but .NET 5+ support was missing. We’re pleased to announce that support has now been added in our SQLite provider for WebAssembly starting from 3.1.1, allowing to build with the latest and greatest features available, alongside with Entity Framework Core 6 previews and the Frank Krueger‘s awesome sqlite-net-pcl library. We’ve updated our online sample repository for you to try SQLite and EntityFramework Core directly in your browser: https://sqliteefcore-wasm.platform.uno   Getting started using SQLite in your browser You can find an up-to-date documentation for this walkthrough here, the full example for this tutorial here, and Entity Framework Core sample here. First, you’ll need to setup your environment using our getting started steps. Once you’re done, you can create a new application using our visual studio extension or dotnet new templates. You’ll then need to add new dependencies in your application as follows: <PackageReference Include=”sqlite-net-pcl” Version=”1.7.335″ /> <PackageReference Include=”Uno.SQLitePCLRaw.provider.wasm” Version=”3.1.1″ /> <!– Required when using sqlite-net-pcl which otherwise overrides the WebAssembly compatible version of the SQLitePCL.raw provider. –> <PackageReference Include=”SQLitePCLRaw.bundle_green” Version=”2.0.5-pre20210521085756″ IncludeAssets=”none” />   Once done, in