Welcome back! Haven’t been here for a while! But I got inspired, so I had to drop by unannounced. What’s my inspiration, you might ask? My buddy – Marcin – has recently published an article, comparing two of many Blazor hosting options. If you’ve missed it by any chance, definitely go back there and have a read.
Marcin is our business development director, so his article has a business approach. I thought it would be a great counterpart to have a technical comparison as well. And as I’ll be comparing Blazor to Blazor, you won’t even feel that I’m being biased towards Blazor over any other front-end development technology.
Introducing the contenders- Blazor WebAssembly Progressive Web App and .NET MAUI Blazor Hybrid
First things first – what are we comparing?
In the blue corner – Blazor WebAssembly Progressive Web App
It’s a long name, so I’ll try to explain at least what’s beneath. It’s a combination of two technologies mentioned in the name. The WebAssembly part enables building single-page applications, that run solely in the user’s browser. Progressive Web App capability provides an almost native feel to the application, including local installation, offline support, and push notifications. With that said, users can access the app traditionally – through a browser but can also add a native shortcut on their desktop. And the best part – all that is done (almost) purely in C#!
In the red corner – .NET MAUI Blazor Hybrid
As the hybrid word implies, here we have another mix of technologies. MAUI is the freshest toy out of the Santa Microsoft workshop. It’s a successor of Xamarin. To make it clearer, it’s a new development framework for all things mobile and IoT. And if you have ever imagined a tool that would convert a code-base to a native app for all platforms (Android, iOS, macOS, Windows, Tizen), that’s what MAUI does best. Then it goes without saying – combining MAUI with Blazor capabilities (even to your existing Blazor code-base) makes total sense and opens a lot of new markets. And opens them fast.
Jab: Blazor will be a superpower in any case
A while back, I wrote an article about why Blazor is the future of cross-platform development. It still stands true today. With one difference – it became even more true with time. Blazor as a Progressive Web App and as a .NET MAUI Hybrid will have similar perks.
Let’s recap what those are:
- Taking advantage of the .NET ecosystem
Blazor is mostly a .NET based framework, which means you can share your code between the client and the server as well as from your already existing applications. Code reusability increases delivery velocity.
- Extensive collection of .NET libraries
.NET has a huge community behind it and has been around for a while. You can leverage existing libraries to boost your development cycle and shorten the product feedback loop.
- Limited usage of other front-end languages
In the vast majority of cases, you will not be required to write nor utilize any JavaScript or TypeScript. But be aware – some of the component libraries you can find are imposters! Well, kind of. They will be just .NET wrappers over underlying scripts. It could have an impact on your development.
Left hook: When should you choose Progressive Web App (PWA)?
- Cross-platform compatibility (nearly)
As it leverages a modern browser sandbox to run, PWA will run on all platforms where the browser concept exists. According to LambdaTest, it has a 92/100 browser compatibility score. But there’s a little catch, the underlying technology – web assembly – is only supported on modern browsers. Which, at the moment, excludes Internet Explorer. Still, it’s something to keep in mind.
- Consistent, native-like experience across platforms
The fact that it runs in the isolated browser sandbox means your application will virtually look and behave the same on any platform it’s going to be installed on. It will also scale the same on all devices. Which would be an ease for your UI/UX Team. Users will be able to install it on their devices, work offline and even receive push notifications, granting a native-like experience. Be mindful though, that a browser virtual machine has limitations to follow while interacting with its operating system.
- Performance that beats any other front-end framework
With PWA you can leverage browser caching and background updates to improve overall performance. On top of that, your application is compiled to a WebAssembly code which allows for near-native performance in the browser. WebAssembly binaries will always outperform any other front-end framework. If you’re curious to learn why, check out one of my LinkedIn posts.
- Simple and unified deployment
PWA is still a web-based application. That results in having a simple and unified deployment to any environment you’d want to support. It doesn’t require app store registrations or platform-specific code. Users would load the application through an URL, like any other website. The installation then comes down to adding PWA to the home screen.
Right hook: When should you choose .NET MAUI Blazor Hybrid?
- True native compatibility and performance
MAUI application is compiled into native applications for the platforms of your choosing, i.e. Android, iOS, Tizen, and Windows. The native version ensures native compatibility. Native code leverages hardware in the most efficient way to achieve the best performance.
- Platform native experience
As your application will be a true native installation, it will provide a truly native experience. That means, your UI/UX may vary between different platforms but will be consistent with their general behaviors. It will feel like any other application on your user device, which could make it even more friendly to work with. But be aware that experience might require adding a bit of a native code to the shared .NET codebase.
- Rapid development
Imagine writing one command, one view, then with a click of a button having it available to install on all commonly available operating systems. That’s what .NET MAUI’s main premise is. One codebase, one framework, an entire application market of possibilities supported out of the box. Improvement of the delivery time, reduction of the development lifecycle, higher maintainability and support – all that sure sounds nice.
- Security and stability of delivery through an app store
Having an application that’s native to a given platform, allows you to distribute it through official app stores. You have a huge addressable market at your fingertips. You’re also getting an additional security level. App stores will ensure that your application files are not tampered with. It will also ensure that communication from your application to your servers is trusted and secure.
And the winner is… it depends!
But I’m not going to leave you with just “it depends”. As the development process is similar for both of our contenders, you should base your decision on your business idea requirements. What would that look like?
- Do you know who’s your targeted audience?
- Are they browser users (PWA) or rather value mobility and mobile device support as a top priority (MAUI)?
- Would you need to support remote areas with a poor Internet connection?
- Maybe even an offline mode is required? (PWA supports it out of the box, while MAUI might require some platform-specific implementation)
- Are you striving for a common experience anywhere your app is used (PWA) or a relay on the smoothness of usage of the application that complies with platform-specific flows and controls (MAUI)?
- Will your application utilize integrations just with commonly available services (sending email, downloading files, etc.) (PWA) or will it be a more advanced flow that requires provisioning of Bluetooth or location data (MAUI)?
- Is the performance of your application critical, like stock monitoring, auctions, etc. (MAUI) or you’re not in the realm of high-frequency data changes (PWA)?
- What kind of SLA are you going to offer?
- Is fast resolution and distribution a business-critical requirement? (PWA)
- Or you can accept app store validation times and unique deployment requirements for each supported platform? (MAUI)
Still not sure? Drop us a line!
And lastly, we invite you to get in touch with us! We have expertise in executing entire development cycles, as well as consulting and guiding you and your Team on your journey. Let’s set up a workshop and analyze your business requirements together. I, for one, would be extremely excited to learn about all the challenges you’re facing and how we could use the .NET ecosystem to solve them.
What to discover more?
Have you got hooked on Blazor, WebAssembly, .NET MAUI, Progressive Web Application, or all of them? Great!
Here’s your queue and some resources to discover those topics further:
- You can find more on our blog and by following me and Marcin on LinkedIn
- James Montemagno’s blog – MAUI and Blazor insights from a Microsoft MAUI Team expert –https://montemagno.com/
- Gerald Versluis’s YouTube channel – all things MAUI, tips, tricks, dos, and don’ts –
https://www.youtube.com/c/GeraldVersluis - Jon Hilton’s blog – everything around Blazor, from high level to low level as well as cases studies – https://jonhilton.net/