DEV Community

Raul Aguilera
Raul Aguilera

Posted on

Blazor, a good bye from Dot Net developers to JS Frameworks?

I’ve been a Dot Net developer for quite some time and in recent years I’ve seen the buzz of the appearance of Front End Frameworks like React, Angular, Vue, etc.

As you might agree, the current trend for us as developers is to become full-stack. If you’re a backend dev, it could be challenging to keep up with learning JS frameworks. So, when I heard about Microsoft releasing this new member of the ASP.NET family named Blazor I felt really excited.

In the next section I’ll try to give an overview of what is Blazor about.

What is Blazor?

Blazor is a front-end development framework that uses C# instead of JavaScript.
With Blazor you’re able to create an app composed by reusable components implemented using C#, HTML and CSS.
It allows you to write client side application code with C# without having to rely on JavaScript like we do with Jquery, React, Angular, Vue, etc. So we basically use C# to write client and server code.

How Blazor can run client-side C#?

Blazor comes in two flavors:

*Blazor Server (supported in ASP.Net Core 3.0)

With Blazor server, the components are processed in the server not in the client. The UI updates and client events are managed/handled by a mechanism that uses a SignalR connection to work.

*Blazor Web Assembly (still on preview for ASP.NET Core 3.1)

The client side C# code is run directly on the browser by using Web Assembly.

Javascript interoperability

Something that I found very interesting is that if you need to access JavaScript libraries or interact with the browser APIs you can call JavaScript code from C# and vice versa.

What do I need to get started with Blazor?

You need to install the latest .NET Core 3.0 SDK release.

If you’re using Visual Studio, you only need to follow the process to create a new Project, select Blazor App and then choose the Blazor Server App Template.

If you want to use the .NET Core CLI you can use the following command:

dotnet new blazorserver -o WebApplication1

As mentioned in previous sections, only Blazor Server is supported on .NET Core 3.0. If you want to work with Blazor Web Assembly you need to install .NET Core 3.1 Preview SDK.

Blazor Server Template example

I created a repo that contains an empty Blazor Server project just to give you an idea of how it looks like. It was created with Visual Studio using the Blazor Server App template.

Blazor is still on its early steps but seems to be a very promising approach for backend developers that are already familiar with C# so they can move to the Front End side of development without having to learn a JS framework.

Do you think Blazor will help Dot Net developers forget about learning JS Frameworks ?. Please let me know what you think in the comments section.

Top comments (1)

codycoder profile image

I haven’t worked with it yet but I’ve been reading up on Blazor and I’m stoked about it!