In 2019, Microsoft announced Blazor. Daniel Roth, Principal Program Manager, ASP.NET said: “A little over a year ago we started the Blazor experimental project with the goal of building a client web UI framework based on .NET and WebAssembly. At the time Blazor was little more than a prototype, and there were lots of open questions about the viability of running .NET in the browser.”
Roth concluded: “Since then we’ve shipped nine experimental Blazor releases addressing a variety of concerns including component model, data binding, event handling, routing, layouts, app size, hosting models, debugging, and tooling. We’re now at the point where we think Blazor is ready to take its next step.”
The technical challenges of developing rich user experiences within the browser either on the desktop or mobile are manifold. A lack of efficiency when executing commands are often at the route of poorly performing applications.
.NET on the Web
There are two flavours of Blazor: Blazor Server runs all the logic on the server, in the usual ASP.NET way. The version we’ve been waiting for, though, is Blazor WebAssembly. Single-Page-Apps (SPAs) written in .NET can run directly in the client browser. And that’s where things get very interesting.
With Blazor WebAssembly, both the client and the server code are written in .NET, allowing you to share code and libraries between both sides. Because it’s .NET code at both ends, you can reuse your existing server-side code and your existing libraries to create the client-side part of your application. So Blazor allows you to build reusable web UIs, on a stable platform, using .NET end-to-end.
Blazor also offers potentially massive performance gains. Blazor runs your client-side C# code directly in the browser, at near-native speeds – this is thanks to WebAssembly, which ships in all major browsers. No need for additional downloads or plugins as WebAssembly (WASM) is a new standard.
And Blazor is flexible. There’s an option for Blazor to run all the logic on the server-side if needed. And Blazor WebAssembly gives you a choice of languages to choose from, so it doesn’t require you to only use C# on the server-side (anyone for F#)? In fact, you don’t even need to use .NET on the server-side at all! If you already have a legacy backend written with PHP, Rails, or anything else, you can still write .NET client-side code to run against it.
A new age of Web application development
How Blazor has been architected is the real innovation: Blazor differs from established frameworks such as ReactJS or Angular in that Blazor uses different renderers to create web-based UIs that will also run on mobile browsers. Developers will also have the ability to write once use many times a library of components that Blazor WebAssembly can be used with each new application. This offers a considerable gain in productivity over established development processes.
The question, then, is should your development teams embrace Blazor WebAssembly now? The technology is its early days, so it’s not going to replace the established stalwarts of web programming anytime soon. But it holds tremendous promise for web developers and programmers.
Blazor offers, at the moment, a glimpse of a possible future where web application development becomes more efficient and far less complex. All eyes are on Microsoft to see how they evolve this enticing architecture.
Using .Net Core, Microsoft Azure, Cosmos DB or Power BI in a live or upcoming project? Reach out to us using our contact form, and a specialist will be in touch within 24 hours. You will also receive an email with contact details should you wish to get in touch immediately.