If you are an enterprise software developer, WebAssembly probably crosses your news feeds frequently. Usually the use cases are related to games – someone has ported Doom3 or the Flight Simulator, or some performance improvement over a JavaScript library, which may create the illusion WebAssembly is ‘not meant for you’.
The reality couldn’t be more different. If you are not paying attention to WebAssembly – you should. The adoption rate is accelerating and WebAssembly is shifting from being relatively unknown technology to mainstream technology as we speak. Below is the list of use cases we come across most often when talking to our customers and community, and sometimes those use cases are even interlocked.
1 – Greenfield Development – Multi-Platform Development
Of the five scenarios, this is the most frequent one. You’ve been tasked to develop an app that ‘runs everywhere’ – desktop, mobile, web. Good news for you – no luggage to carry forward, it is a net new app and there is no old code base to consider. A dream job, really. Naturally, no other deployment mechanism will beat the web. However, you are not a fan of JavaScript. WebAssembly to the rescue! As of last year, W3C has declared WebAssembly to be the 4th ‘programming language’ of the web. While we don’t necessarily agree that WebAssembly is a language, the most important part here is that W3C has declared that WebAssembly is here to stay, meaning you can safely bet on it. JavaScript, like it or not, has been around for decades. And for enterprise development the tech stack longevity is the key.
Clients pursuing WebAssembly for this reason usually have questions about performance, security, authentication, deployment, testing, designing for multiple form factors, as well as general skillset questions. Each one of these topics deserves a discussion on its own and we suggest you research this further before deciding which stack to use when targeting WebAssembly.
Our recommendation here is using WinUI and Uno Platform for multi-platform development . The Windows has you covered for most, if not all, of those important enterprise considerations mentioned above over the decades they have used to evolve one amazing framework after another – WinForms, WPF, UWP and finally WinUI – the way forward for building Windows apps. And Uno Platform has you covered on WebAssembly side as well as on mobile devices, and non-Windows desktops.
2 – Moving from Desktop-Only to (also) Browser-Based Applications
In a way, this scenario is like #1. However, it requires a lot of platform specific and legacy code considerations, as well as up-skilling the development team. Typically, these are the developers who in the past might have used WebForms (AJAX). More recently, many WebForms developers have looked to Angular for enterprise JavaScript development. Some liked it, and from what the feedback is to us – many didn’t. One of the biggest appeals for WebForms has been the WYSIWYG nature of Visual Studio app building, which is the experience you can replicate by creating a desktop app, and taking that user experience over WebAssembly to the Web.
The same recommendations from #1 above about WinUI and Uno Platform apply. What’s more, the project Reunion that Microsoft announced at this year’s Build conference may make this even more appealing to you. Not only will you unify all your Windows applications, but you will unify even the non-Windows platforms.
We’ve had great success with lifting and modernizing traditional desktop app – Windows Calculator – to run on WebAssembly. Read all about it here.
3 – Modernization of an Older app Written in Silverlight
This is a very typical scenario – or what used to be dubbed as creating Rich Internet Applications (RIA) during Silverlight glory days. If you’ve loved Silverlight, there is a lot to love with WebAssembly and technologies like Uno which help you target it. If you are a Silverlight developer, looking to finally migrate that Silverlight app, and you want to use Uno Platform in order to target WebAssembly and Web Browser, you will be able to reuse most of your code and C#/XAML skillset to modernize your app. Another side benefit Silverlight developers usually cite to us is the fact you will not need to use JavaScript at all. Our customer HubSe has been able to achieve 10x productivity by using Uno Platform to migrate their Silverlight-based Web App, see the case study here.
4 – Backward Compatibility with Windows 7 and earlier
Windows 7 extended end of life was about 6 months ago – January 14, 2020. However, Windows 7 stlll held about 30% of the OS market share. In addition, our surveys from December 2019 showed that over 20% of the developer still have plans to support Windows 7 over the next 3 years.
If you are one of these developers, and you are starting work on net new desktop applications targeting Windows 10 and later, than using WebAssembly as part of your development stack can ensure you have backward compatibility with Windows 7 and before. It will mean that you wrap your WebAssembly (and Uno Platform built application in an Electron shell so you can run it as a native Windows 7 app. Alternatively, you can ask your Windows 7 users to use the WebAssembly powered Web Application you can get from the same source code you produced using WinUI & Uno Platform.
5 – Progressive Web Apps / Complementary Mobile App
Wikipedia defines PWAs as:
A progressive web application (PWA) is a type of application software delivered through the web, built using common web technologies including HTML, CSS and JavaScript. It is intended to work on any platform that uses a standards-compliant browser. Functionality includes working offline, push notifications, and device hardware access, enabling creating user experiences similar to native applications on desktop and mobile devices. Since a progressive web app is a type of webpage or website known as a web application, there is no requirement for developers or users to install the web apps via digital distribution systems like Apple App Store or Google Play.
The general appeal of PWAs is bypassing the store publications, and for dotnet developers, general drawback of PWAs is using JavaScript.
Be it that you are looking to develop a pure PWA for your mobile-first, mobile-only approach, or you are looking to ‘peel off’ a piece of your LOB desktop app and make it mobile (I.e. a time-tracking app), WebAssembly is your friend as you can use C# and XAML to target PWA. Deployment is a breeze – users will be able to install your app by simply ‘+’ on your WebApp.
Next Steps
At OSS Uno Platform we have been working on WebAssembly since 2018 and have achieved some great performance advantages (LINK). We hope you check out Uno through this getting started tutorial and that you also check out our annual UnoConf – virtual and free this year, on August 12. Register Now.
About Uno Platform
For those new to Uno Platform – it enables for creation of single-source C# and XAML apps which run natively on iOS and Android, macOS and Web via WebAssembly. Uno Platform is Open Source (Apache 2.0) and available on GitHub. To learn more about Uno Platform, see how it works, or create a small sample app.
Sasha Krsmanovic, on behalf of Uno Platform team