DEV Community

Cover image for Is Blazor the Future in Web App Development?
Tarun Gurang
Tarun Gurang

Posted on • Originally published at ifourtechnolab.com

Is Blazor the Future in Web App Development?

JavaScript has become the spine of modern web application development and it is the only programming language that is efficiently understood by browsers.

Just take a moment and think about how the web platforms would be if JavaScript isn’t there. JavaScript seamlessly helps developers build fascinating and intriguing UIs on both web and mobile platforms and provides a dynamic and interactive user experience. More importantly, it is used for validations on the websites and execute complex actions.

However, the release of Blazor has created a bit of competition for JavaScript. This evolving Microsoft framework allows you to employ client-side processing through C#.

What is Blazor?

Blazor is a single-page application framework whose main purpose is to execute Razor views on the client-side rather than having to execute them on the server to present HTML to the browser. The idea of Blazor basically resides on the combination of Browser and Razor.

Blazor supports JavaScript interoperability which means it can effectively invoke .NET methods from JS functions and vice versa. This open-source platform enables developers to seamlessly develop browser as well as server-side applications.

Why should I choose Blazor?

Blazor enables you to run your apps on any browser because of WebAssembly (WASM). Blazor does not require any add-ons or plugins for execution which is the case in Silverlight. To develop apps, Blazor utilizes a strongly typed object-oriented programming language called C#. And this allows us to catch errors during compile time.

Being a part of .NET CORE 3, Blazor can utilize all the libraries and public NuGet packages supported on the .NET platform.

Here are a few reasons why one should go with Blazor –

  1. WASM (Web Assembly) support in all browsers
  2. Code reusability
  3. Existing libraries can be reused
  4. Debugging and Tooling
  5. Native performance

Using different renderers, Blazor can efficiently create mobile as well as web-based user interfaces.

What are the hosting models of Blazor?

Talking about the hosting model, the Blazor framework has two i.e., Server-side blazor and Web Assembly.

Blazor WebAssembly

WASM allows applications to run on a browser and for this to happen, it downloads everything like HTML, CSS, images, assemblies, and even complete .NET runtime which is then converted to WASM bytecode. Because of all these, it doesn’t need a server connection, what it needs is just to load into the browser, that’s it.

Here are a few advantages of WebAssembly –

  1. Offline support for the Application
  2. No need for a server, what it needs is just resource processing at the client’s device.
  3. Seamless execution support in all modern browsers with faster performance.
  4. No Add-ons or plugins required.

Let’s have a look at the disadvantages of WebAssembly –

  1. It is limited to browser capabilities.
  2. Downloads everything including .NET runtime
  3. Might take longer load times because of increased downloads.
  4. Problems with outdated or traditional browsers.

Read More: Web Application Development Using Asp.net Blazor Framework

Server-side blazor

Server-side Blazor enables you to run your Blazor app on the server. This simply means that the components of blazor can be executed on the server-side with .Net Core while other essentialities like UI updates, JavaScript function calls, event handling are managed by SignalR connection.

When the app is running, the browser communicates with the Blazor server application through the help of a SignalR connection.

Here are a few advantages of Server-side blazor –

  1. Less need of downloading
  2. It runs faster
  3. Server-side keys are safe to use.
  4. No need for WASM.

Let’s have a look at the disadvantages of Server-side blazor –

  1. No offline support
  2. Requires a specific server or environment to execute on Asp.Net Core.
  3. High latency
  4. Scalability can be a challenge

In this blog, we will learn whether Blazor can be the future in web app development.

It is very early in its life cycle, with a lot of significant code churn

"I think that Blazor is very early in its life cycle, with a lot of significant code churn. With this in mind, there are a lot of potential performance issues you may need to think about solving or working around with it. It has not had enough tested deployments, so these smaller problems are going to be there in the many, rather than the few. Its single app framework competes against MVC and Razor pages, but until it can have some good tests and some further development into its life cycle, it is too early to tell if it will be a success or not.”

- Alex Magnin, CEO and Founder of Alexmagnin.com

It is absolutely on the right track

"In my opinion, Blazor is absolutely on the right track. It's taking a lot of great cues from React in terms of the architecture and if you're an experienced React developer, you're going to recognize the patterns right away and be able to start running.

However, it suffers from a few small issues such as the way they're managing state is not ideas (using [CascadingParameter]) and something like a Redux framework built in would make things simpler.

There is also some ugliness with C# variable closure which might cause the JavaScript developer some headaches.

Overall, it's a good start, but definitely requires some attention from Microsoft. However, Microsoft's MVC and Entity Frameworks suffered the same sorts of issues in version 1 and have spawned into what I would consider the best frameworks for designing APIs out there.”

- Tyler Findlay from TyFi Consulting Inc.

It is the future in C# Web App Development, quite possibly

Web Assembly, a growing new standard and runtime capitalizes on JavaScript ubiquity in the browser and ability to run on servers. Additionally, web assembly brings a secure by default capabilities model. In the next 5 years, web assembly will be a very popular deployment target, competing with docker containers and a replacement for PaaS Platform as a Service provider like Heroku.

Blazor will not be the future of all web development due to the diverse nature of web development. C#, JavaScript, Python and many other languages are used for server side coding of websites.

The nature of web assembly is to compile from a source language like C# to the target machine code of web assembly. This will not win C# or Blazor any new ground by default. C# competes with Microsoft other language TypeScript, which is a superset of JavaScript with types.

All popular languages can be compiled to web assembly today.

An early challenger and likely candidate to be a dominant web development framework that targets Web Assembly is deno. It is the successor project from the creator of NodeJS. It let's developers work in TypeScript or JavaScript and deploy into a security sandboxed runtime environment.

It is very likely that Blazor will be the dominant web assembly framework in the C# space, given it's support by Microsoft.”

- Austin King, Sr. Full Stack Developer at OpsDrill.com

It doesn't need the traditional requirement of JavaScript

"There has been a lot of hype about Blazor and rightly so. This effort on Microsoft's end is a client-focused UI framework. The reason for its popularity is that it doesn't need the traditional requirement of JavaScript but can use HTML, CSS, and C# to write rich web UI experiences. Blazor is highly efficient and has a productive programming model and poses a threat to JavaScript single application (SPA) framework. The way Blazor has been made makes it highly flexible and its runs on the full .NET Core runtime. It also runs on a fast development cycle and has a small download size.”

- Ethel Favors, Content Curator at RankSoldier International Private Limited

Looking to Hire ASP.Net Developer? Contact Now.

It only makes sense if you are familiar with C#

"I'm unsure if Blazor is the future for Web App Development because C# is on the decline and is generally not a language new developers get started with these days. We are moving in the direction of JavaScript everywhere, so it makes more sense to pick up JavaScript than C#.

If you are already familiar and working with C#, Blazor is super interesting as it runs WebAssembly. But on the other hand, other languages can also handle this, so it only makes sense if you are familiar with C#.”

- Andreas Pettersson, CTO of Right People Group

It took off as an individual task depending on .NET and WebAssembly

"Barely a year prior Blazor took off as an individual task started by Steve Sanderson of Microsoft to fabricate a customer web UI system dependent on .NET and WebAssembly. .NET web developers liked Blazor right away. The energy and gab made Microsoft pay heed. It turned into an authority project.

  • Blazor permits you to construct intelligent web UIs utilizing C# rather than JavaScript. Both customer and worker code are written in C#, permitting you to share code and libraries.

  • Blazor is an open-source structure and is a piece of the .NET improvement stage that has a solid local area of more than 71264 benefactors from more than 2500 organizations.

  • Net Solutions got Blazor right around a year prior when its first trial discharge came out. Presently, with Microsoft's true declaration of its delivery, we are anticipating building future tasks on this new structure.”

- Christian Velitchkov, Co-Founder of Twiz LLC

Quite possible because of features and various Hosting Models

A new breed of web app framework, Blazor can seamlessly render razor views on the browser with the assistance of WebAssembly. The capability to develop captivating web UIs with C#, HTML and CSS instead of JavaScript makes it the biggest selling platform.

It has the support for so many exciting and improved features such as –

  1. Layouts
  2. Routing
  3. JavaScript Interoperability
  4. Forms and validations
  5. Authentication support
  6. Server-side rendering
  7. Dependency injection
  8. High compatibility for web application
  9. Libraries and Code reusability
  10. A strong community that solves concerns
  11. signalR without JS
  12. Lazy loading, gRPC, and many more.

Talking about the hosting models, Blazor has support for four hosting models that weigh its popularity.

  1. Blazor Server and Blazor WASM for web platform
  2. Mobile Blazor Binding renderer for Android and iOS platforms
  3. Blazor Electron for desktops such as Linux, Windows, and Mac.

Because of multiple renderers, Blazor can efficiently develop web-based components and native mobile UIs.

May be if you focus on offline support

Blazor has been impressive for many reasons like performance, hosting models, features, compatibility, etc. With Blazor you can seamlessly build Progressive Web Apps or client-side applications that can run even in offline mode. To make this possible, blazor utilizes modern web standards in addition to the service workers whose main purpose is to cache the files. Hence when you simply turn off the internet and type the app URL in the browser, these apps would work flawlessly. With this, you will benefit with faster performance and responsiveness of an application.

Conclusion

Before Blazor’s existence, JavaScript was known to be the most popular language to build Single Page Applications. But this belief has got shattered when Microsoft launched the Blazor framework that helps to build browser-based and Single Page Applications using C#. This created competition for JavaScript at some point. In this blog, we have learned the reasons why Blazor can be the future in web app development. With these top reasons, you will understand the possibilities and limitations of Blazor to remain dominant in web app development.

Discussion (2)

Collapse
moay profile image
moay

Yes. Web developers, who have suffered for years from Microsoft's incompetence in creating a web browser that doesn't s*ck, will love a framework that is not web native and comes directly from IE hell.

Before Blazor’s existence, JavaScript was known to be the most popular language to build Single Page Applications. But this belief has got shattered when Microsoft launched the Blazor framework that helps to build browser-based and Single Page Applications using C#.

No way. I bet, 90% of web devs would rather use IE6 for one entire week than try to use some framework from .NET from Microsoft. Blazor is never going to replace anything for web SPAs.

Collapse
dewofyouryouth_43 profile image
Jacob E. Shore

Really?? A bit much on the hype here. It's possible that it will see a modest adoption, but let's take this into perspective. Blazor is not the "future of web app development". It is an (possibly) appealing alternative for SPA development for developers already highly invested in the .NET ecosystem.

And yes, it can use WASM.