DEV Community

Miguel Teheran
Miguel Teheran

Posted on

Discussion: Where is Blazor a better option than React, Angular or any JavaScript library or framework?

Blazor is a web framework developed by Microsoft that allows developers to create web applications using C# and .NET. It offers several deployment options, including Blazor Server, Blazor WebAssembly, Blazor Hybrid, and Blazor United.

Blazor is a good alternative for .NET developer who are not experts at JavaScript and want to build web-rich applications.

Blazor was released in 2018, and now we can see that is a mature technology, but it still has some issues, and we need to consider:

  • Working with canvas could be hard, or maybe we need to use JavaScript
  • Render a high number of HTML elements
  • Intacting with other technologies that use WebAssembly

Considering these weaknesses, Blazor remains an extraordinary technology. Here are a few instances where I believe Blazor is an exceptional choice for developing web applications:

  • Dashboard and monitoring applications
  • Stores and marketplaces
  • Real-time apps like chats and streaming
  • Simple multiplatform app (To use Blazor hybrid)
  • Search portals
  • Scenarios where developers are expert at C# and Microsoft technologies but have some gaps in JavaScript

What do you think about using Blazor on these project?
Where do you think Blazor is a great option?

Let's discuss. Be Kind and Open to talk.

Top comments (8)

Collapse
 
rasheedmozaffar profile image
Rasheed K Mozaffar

For many people, they believe Blazor is no better or even on the same level as JavaScript frameworks, and in my opinion that holds true (partially) for a few reasons:

  • Js is more beginner friendly and much more of a starter language to begin with

  • Js been there for decades now while Blazor is still relatively new

  • And most importantly, the abundance of existing Js libraries that solve tons of things.

For me personally, I've learned C# last year and been using it since then, I've used MVC and Web Api and when I first used Blazor, I was shocked by how easy it is to just shift and make use of my existing C# knowledge in Blazor, like the transition between the project types felt exceptionally seamless, and overtime we can see the framework is growing rapidly with constant and drastic updates ruling out every year, the future for Blazor is bright for sure, besides its simple learning curve, good documentation, there's plenty to consider.
Before the framework was mature, there was sorta lack of flexibility, you would need decent amounts of Js to get things done, but now in 2023 it's so different, many things are easily achievable in Blazor right now, and when the case requires Js, Js Interop is more than lovely and simple to use to get the job done.
So my final take would be, Blazor is a solid option for all the project types you listed above, and I don't think any existing .NET developer would need to make a switch to a Js SPA framework to make incredible projects.

Collapse
 
mteheran profile image
Miguel Teheran

Good comment. I agree with you about Blazor as a mature framework now. it is too easy to use and it has many features.
Regarding JavaScript libraries that's true there are many utilities that we can reuse in our projects and save time but We need to also highlight that we can use nuget libraries in Blazor and there are many of them that we can use in the backend and the frontend side at the same time.

Collapse
 
kedzior_io profile image
Artur Kedzior

As much as I love dotnet ecosystem I'm not on board with Blazor yet and I did give it a go.

I had my team create a backoffice with it. The front end team (react devs) was excited to do something new but was not used to C# which delayed things. The backend team (C#) was also excited about it but wasn't as good building front end components.

We did both WASM and Blazor Server. Everything was ok until the features were getting complex and we started to injecting more and more javascript. I have stopped it and moved everything to react.

I also built a SAAS with it, couldn't not passed the annoyance of heavily cached DLLs and customers not getting my latest updates immediately.

That's said it was a year ago and I haven't came back to Blazor since then. I will give it a shot by the end of the year to check how things have evolved.

For the moment we get the best productivity with dotnet + svelte.

Collapse
 
mteheran profile image
Miguel Teheran

Thanks for sharing your experience, this has a big value for people that are starting with Blazor or people that are thinking about use this technology for complex scenarios.

Collapse
 
dukeacureds profile image
Santiago Arango Toro

As someone who loves most of the C#/Net ecosystem, I do not believe that Blazor is a good option to replace enterprise apps made with Angular/React/Vue, etc. The simple reason for this is because it is too tightly integrated with the Microsoft tech stack, a mistake they have made in the past with other frameworks.

Furthermore, Blazor is not as popular, which means that support, both in terms of the community and in terms of finding pre-made or reusable components, is not as robust.

I have been using Blazor for small projects, and I do love the integration with SignalR, which allows you to build robust apps using CQRS and Event Sourcing. However, it needs more time and greater popularity before a big company might decide to adopt it

Collapse
 
mteheran profile image
Miguel Teheran

The growth and competitiveness of Blazor will be revealed over time. We need to wait and see.

Collapse
 
kiss_code profile image
kis.stupid

As a contract worker, I can confirm that Blazor is being adopted by multinationals. But as the author says, more often for internal apps like admin dashboards ect.

Collapse
 
kiss_code profile image
kis.stupid

As a full-stack, I made the jump when Blazor came out. I jumped from Angular + Nest.JS to Blazor + Web API.
I have used React, Svelte, jQuery, Knockout.js, ... as well but ...

In a professional environment, I prefer structured frameworks to build sustainable codebases. Structure, good practices & standardization help produce predictable codebases resulting in maintainable projects.

Nest.JS did provide most of the above but soon our go-to ORM package lost maintainers while containing bugs, WebPack glitching every now and then, our projects containing too many configuration files, NPM giving us more work than expected etc. .NET's out-of-the box ORM, authentication & authorization plus LINQ and other tooling, started looking more and more attractive.

In Nest.JS we could already organize & test our codebases better thanks to the modular setup and dependency injection capabilities. We could separate our concerns better with the supported mono-repo setup. .NET provides all that and more.

It had long been the wet-dream since Node.JS came out, to re-use code between front-end and back-end. Unfortunately, that has never been easy to do nor to have front-end & back-end projects in one mono-repo.
In a .NET solution it is very easy to setup a mono-repo with multiple projects. Whether those projects are client-side or server-side, does not matter.
That said, the re-using of code between front- and back-end is usually limited to constants, helper classes & DTOs.

Nest.JS and a .NET Web API are structured similarly with similar features & with good practices borrowed from other languages or frameworks. The jump was easier than expected, never looked back.

In the early days, .NET has indeed been too overwhelming for beginners. Nowadays, it's way more accessible. And Blazor is an absolute gem to use!

If you want to see how I fullstack in .NET: YouTube channel

IMO, Angular provided great structure but went a bit too far with its features NgRx & async pipes, ... React Redux, not a fan but it did provide some more structure.
Svelte was very accessible and global state management was a breeze. But it did not support TypeScript when I was working with it so I only used it for small business websites.