Microsoft Blazor to become mainstream in 2020
WebAssembly (wasm) is a binary instruction format for web browsers that is designed to provide a compilation target for high-level languages like C++. In 2017, Microsoft began experimenting with WebAssembly to bring .NET to the browser using the Mono run-time.
npm and Webpack
One of the benefits of opening the web to .NET is that we now have alternatives to npm and Webpack. As a long time, .NET developer, I’m greeting NuGet package manager and MSBuild with excitement. For me, these technologies are less problematic, more familiar, and far more productive. While nothing is ever perfect, my relationship with NuGet and MSBuild has been mostly positive.
Reduced learning curve
You’ll find the Razor Component model very familiar to working with ASP.NET MVC or Razor Pages. Razor Components incorporates the Razor syntax with a new method of encapsulating markup into reusable components. With Razor Components you’ll quickly create the building blocks of your application’s user interface (UI). Components are .NET classes whose properties are component parameters; this basic system makes Razor Components easy to author. By breaking the component model down into three concepts: directives, markup, and code, we can understand how they are created.
While Razor Component, and Blazor Component are widely used interchangeably, the correct terminology is Razor Component. This is important when searching online as both terms are quite prevalent.
In Figure 1, components use directives to add special functionality like routing or dependency injection. Syntax for directives is like what’s used in ASP.NET MVC or Razor Pages. Component markup is primarily HTML which is enhanced through the Razor syntax. The Razor syntax allows C# to be used in-line with markup and can render values in the UI. The component’s logic is written inside a @code block. This is where component parameters and data bound values are defined. Alternatively, code be referenced using a code-behind approach much like ASP.NET WebForms. We’ll cover the code-behind approach in a later chapter, but for now it’s good to know the option exists. The Razor Component model allows us to break down our UI into manageable pieces. Components can then be assembled into larger UIs forming more complex components and pages.
SEE ALSO: Node.js is Dead – Long live Deno!