'Blazor vs Razor

With the invention of Blazor, I'm wondering if there are significant efficiencies (both in creation of code and in the actual compilation / execution of code) between these two languages?

https://github.com/SteveSanderson/Blazor

If anyone has actually implemented it, have you undertaken any performance tests, or have anecdotal (yes sorry, apologies I'm requesting this) feedback on the code-writing process, when compared with plain old Razor?



Solution 1:[1]

In nutshell:

Razor is a popular template markup syntax for .NET. Blazor (Browser + Razor) is a .NET-based web framework that can run on the client using WebAssembly or running on the server via SignalR.

To give an example, Razor is the syntax you use when creating web apps with ASP.NET, which you’ve probably seen before:

<h1>
  Hello @Model.Username
</h1> 

The razor takes care of rendering your HTML based on the data in your model, while also supporting various conditionals and loops.

On the other hand, Blazor is a technology similar to ASP.NET Core & ASP.NET MVC in that:

It powers web applications It uses Razor as its template syntax for the creation of UI. A common point of misconception is that Blazor uses Razor. This was further exacerbated by two other similar terms – Blazor components and Razor components. Those are widely used interchangeably but the correct terminology is Razor Component. A component is the combination of markup (written in HTML) and logic (in C#) in a single Razor file (with the .cshtml extension).

You can find more information here.

Solution 2:[2]

You can call Blazor as Razor Components with extra abilities! The other variants of the Razor family are Razor views and Razor Pages. ASP.NET has merged them all together and you can just have them and use them all in one project. They are just services in ASP.NET Core and you can register or inject only stuff you want, It is a very nice feature of ASP.NET. Check the eShopOnWeb reference application. eShopOnWeb

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Majid Parvin
Solution 2 Armin Fisher