What is Blazor?

Vaibhav Bhapkar
3 min readJul 3, 2020

Kindly check the previous article about WebAssembly before proceeding further,

In this article, we will explore Blazor in details,

Before we dive into Blazor lets look into current web application how we are building,

Current Web Development Architecture

Here, we are developing our server-side code using Java,.Net, NodeJs, or any other backend programming language and for client-side we are using available JavaScript frameworks that may include Angular, React, or Vue.js. When you look into these there is a fundamental disconnect between server-side and client-side as we are using different technologies on both sides.so question here is why can't we use the same technologies on both sides? and the answer is we can and this is what exactly Blazor provides a solution. Blazor allows the developer to use C# on the server-side and on the client-side.

What is Blazor-:

  • Blazor is a free and open-source single page application web framework that enables developers to create interactive web apps using C# and HTML. It is being developed by Microsoft and it works in all modern browsers and mobile browsers.
  • You write C# in case of JavaScript and you can use other .NET ecosystem and other open standard libraries to develop web applications.
  • The .NET code runs inside the context of WebAssembly. You’re running “a .NET” inside your browser on the client-side with no plugins, no Silverlight, Java, Flash, just open web standards. Blazor is the client-side hosting model for Razor Components. I can write Razor Components. I can host them on the server or host them on the client with Blazor.

How Blazor app Runs-:

Run Blazor Application

Hosting models in Blazor-:

1) Blazor web assembly hosting model:

Using web assembly hosting model application runs directly on a web browser so everything that application needs include compiled application, its dependencies, and .NET runtime on the client browser from the server. A web assembly app completely runs on the client without connection to the server.

2) Blazor server hosting model:

The application executed on the server. Between client and server, the SignalR connection is established. When an event occurs on the client-side information about that event sent on server-side over the SignalR connection server handles the request and for the generated response(HTML) diff is calculated. Entire HTML is not sent back again to the client it’s the difference that sent back to the client and then the browser will update the UI and because of which application will fill faster and more responsive to the user.

Thank You, See you in the next article !!

You can reach out to me here,

LinkedIn: https://www.linkedin.com/in/vaibhav-bhapkar

Email: vaibhavbhapkar.medium@gmail.com

--

--

Vaibhav Bhapkar

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *