Copied RSS Feed

Blazor

Blazor WebAssembly: An Overview

Nowadays, applications that run in browsers are becoming more and more complete. Examples of these are office programs such as Microsoft 365 or Google Docs, which frequently present new functions and therefore require more resources. These types of web applications are often built in JavaScript, but more and more developers are now turning to WebAssembly—a new approach with surprising results. Blazor, the latest trending platform from Microsoft, also offers provisions for developers to use WebAssembly in their applications. This blog provides an overview of both Blazor and WebAssembly.

Introduction to Blazor

 Before we get into WebAssembly, let’s talk about Blazor. This framework runs through web standards, so there is no need to install any plugins or perform any transpilation for it to work. All the code is executed in the browser itself using a .NET runtime framework implemented in WebAssembly.

In other words, Blazor is an open-source framework created by Microsoft that is officially included in .NET Core 3.0 version for developing single-page applications (SPA) in .NET using Razor and C #.

How is Blazor different from other tools like Silverlight?

 Blazor is implemented based on HTML, CSS, and other standard web technologies. It is a very complete framework for the development of SPAs, similar to the sophisticated development possible in Angular, React, and Vue applications. It is worth mentioning that Blazor has systems for bindings, routing, components, lifecycles, validations, templates, error management, dependency injection, and more. Blazor provides everything we need to create a high-quality web applications.

Note: The first version of Blazor was launched accompanying .NET Core 3.0 in September 2019, although only in one of its hosted models: the so-called server-side or Blazor Server.

Here is a demo website developed in Blazor: https://blazor-demo.github.io/.

What is WebAssembly?

If we are looking for a short description, it would be that it is an open standard that allows the execution of binary code on the web, providing a level of performance superior to the performance offered by an interpreted language such as JavaScript.

Definition

The official WebAssembly website states: WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.

So…?

That definition is not very easy to understand, so I will try to explain it not so literally. For me, Wasm enables the possibility that the web can execute more than one programming language, such as C++ and Rust, through an assembly process. With this process, we can improve the performance or speed of our applications, and we have the opportunity to implement new improvements and innovations on the web.

Previously, web developers created applications on the internet with JavaScript, which is relatively slow and, in certain scenarios, limited.

To encourage better web app development and functionality, the World Wide Web Consortium (W3C) has promoted the use of Wasm. However, for Wasm to work, the browser must support it. For this reason, Mozilla (Firefox), Microsoft (Edge), Apple (Safari), and Google (Chrome) have participated in its development.

Note: WebAssembly applications can run in all current browser versions from these providers.

Currently, WebAssembly has one drawback: it is spreading very slowly. Most web developers working with JavaScript have no plans to stop using it. The Wasm project management places great importance on presenting Wasm as a complementary option for JavaScript in application communication. Thanks to compatibility with the big browser providers and the efforts of W3C, Wasm is starting to take off. Its adoption is also on the rise because web applications built with WebAssembly load as easily as those built with JavaScript, and are faster.

Advantages of WebAssembly

The advantages of Blazor WebAssembly are:

  • High performance.
  • W3C open web standard.
  • No limitations for users.
  • Possibility of using virtual reality in browsers.
  • Compatible with all major browser providers.
  • No new programming language is required.
  • Allows C, C ++, or Rust for web application programming.
  • Small file sizes, perfect for mobile browsing.

So, there are no excuses for developers to avoid studying WebAssembly in more detail.

Note: If you want to experiment with WebAssembly for the first time, you can do so in WebAssembly Studio, an online development environment for Wasm.

Essential Studio® for Blazor

Essential Studio® for Blazor provides 65+ high-performance, lightweight, and responsive UI components, including file-format libraries, for the web and WebAssembly applications. Use them to enhance your productivity!

Summary

To conclude, let’s remember that Blazor has grown into a professional web development platform used to build SPAs using C#/Razor and HTML executed in the browser. Its name comes from the combination of the words “Browser” and “Razor.”

This framework runs through web standards, so there is no need to use any plugin or perform any transpilation for it to work. This is because all the code is executed in the browser using a .NET runtime implemented in WebAssembly.

If you have any questions or feedback, please leave your message in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal.

Happy coding!

If you like this post, we think you’ll like the following articles too:

Meet the Author

Vicente Gerardo Guzmán Lucio

Vicente Guzmán has more than 8 years of experience in the professional field, focusing on the development of mobile apps.
He was acknowledged as MVP of Microsoft in the category of Windows Development. Currently he works as a Mobile Project Leader, centered in the development with Xamarin technology.