What is ASP.NET Core Blazor?

3

Looking at the list of news that is in Visual Studio, I came across something talking about ASP.NET Core Blazor, and apparently has almost nothing talking about, I found very little material, and in English, but even using the translator was very confused and I could not know what that would be, let alone what it does.

  • What is this ASP.NET Core Blazor, what is its purpose and what does it do?
  • Is it related to Razor or ASP.NET Core Razor Pages? (Similar names kkk)
asked by anonymous 04.04.2018 / 05:01

2 answers

3
  

What would this ASP.NET Core Blazor be?

It is the engine that takes your code in C # and generates a WebAssemply . That is, it allows you to use C # code in your browser, provided it is in the newer versions that WebAssembly already supports (it will run on older versions with limitations and poor performance).

It's not that C # will run in the browser, it's a compilation that will generate code that the browser understands and executes. In a way it replaces JavaScript as the unique language of browsers , although some have not yet understood that this is in practice (the project description says that it does not replace JS, but it is not which happens in practice).

In fact, it's not just C #, since Blazer takes IL to generate WebAssembly, so may be other languages that compile for IL.

Just understand that does not mean that you can get any C # code and will run on Chrome, FF, Edge, etc. The code needs to be written thinking about being run there. The API is almost all different and has to work with more or less the same things that you work in JS. And it can work with Node as well. But much of the runtime is there to use, so it also does not change that much, but it has the limitations of the platform.

It can be especially interesting to make it easier for DRY for validations and other codes that should run on both the server and the client. Or it will be useful for those who do not want to learn more than one programming language.

We can say that it is an Angular killer :) And React, and others ... Not only it, but "all" languages are preparing to land in browsers and compete with JS. p>

  

Is it any relation to Razor or ASP.NET Core Razor Pages?

Not directly but indirectly clear that it has. Razor is to mount the page on the server, so only the HTML is created, none of the page drawn or executed. Blazor is for the frontend , it runs in the browser, speaking roughly.

    
04.04.2018 / 05:13
-1

According to the project documentation:

Blazor uses only the latest web standards. No plugins or transpilation needed. It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. It works in older browsers too by falling back to an asm.js based .NET runtime.

ie, they implemented .net in WebAssembly and thus their programs in .net will run in the browser. In a project generated with Blazor the resulting dll (its assembly) is loaded into the browser and executed.

More details see link

    
07.04.2018 / 18:56