Blazor is a free and open-source web framework that enables developers to create web apps using C# and HTML.[1][2][3][4][5] It is being developed by Microsoft.
Overview[edit]
Five different editions of Blazor apps have been announced.
- Blazor Server: These apps are hosted on an ASP.NET Core server in ASP.NET Razor format. Remote clients act as thin clients, meaning that the bulk of the processing load is on the server. The client's web browser downloads a small page and updates its UI over a SignalR connection. Blazor Server was released as a part of .NET Core 3.[6]
- Blazor WebAssembly: Single-page apps that are downloaded to the client's web browser before running. The size of the download is larger than for Blazor Server, depends on the app, and the processing is entirely done on the client hardware. However, this app type enjoys rapid response time. As its name suggests, this client-side framework is written in WebAssembly, as opposed to JavaScript (while they can be used together).[7]
Microsoft plans to release Blazor PWA and Blazor Hybrid editions. The former supports progressive web apps (PWA). The latter is a platform-native framework (as opposed to a web framework) but still renders the user interface using web technologies (e.g. HTML and CSS). A third, Blazor Native – platform-native framework that renders a platform-native user interface – has also been considered but has not reached the planning stage.[6]
With the release of .NET 5, Blazor has stopped working on Internet Explorer and the legacy version of Microsoft Edge.[8]
Example[edit]
The following example shows how to implement a simple counter that can be incremented by clicking a button:
<h1>Blazor code example</h1>
<p>count: @count</p>
<button class="btn btn-primary" @onclick="IncCount">Click to increment</button>
@code {
private int count = 0;
private void IncCount()
{
count++;
}
}
See also[edit]
- asm.js – precursor of WebAssembly enabling client-side web apps written in C or C++
- Google Native Client – deprecated Google's precursor to WebAssembly that enables running native code in a web browser, independent of browser's operating system
References[edit]
- ^ Strahl, Rick (31 July 2018). "Web Assembly and Blazor: Re-assembling the Web". Rick Strahl's Weblog. Self-published. Archived from the original on 22 October 2018.
- ^ Tomassetti, Federico (September 4, 2018). "Blazor: .NET in the Browser". tomassetti.me. Strumenta. Archived from the original on 22 October 2018.
- ^ James, Mike (12 February 2018). "Blazor .NET In The Browser". i-programmer.info. Self-published. Archived from the original on 2018-02-18.
- ^ Miller, Jonathan (September 2018). "C# in the Browser with Blazor". MSDN Magazine. 33 (9). Archived from the original on 22 October 2018.
- ^ Roth, Daniel (22 March 2018). "Get started building .NET web apps that run in the browser with Blazor". ASP.NET Blog. Microsoft. Archived from the original on 2019-04-30.
- ^ a b Roth, Daniel (10 October 2019). "Blazor Server in .NET Core 3.0 scenarios and performance". ASP.NET Blog. Microsoft.
- ^ Roth, Daniel (19 May 2020). "Blazor WebAssembly 3.2.0 now available". ASP.NET Blog. Microsoft. What is Blazor WebAssembly?.
- ^ Roth, Daniel (30 September 2020). "Updated Blazor browser support for .NET 5". dotnet/aspnetcore repo. Microsoft – via GitHub.com.
External links[edit]
- Official website
- AspNetCore on GitHub
- Blazor School - The Blazor community documentation.
- Blazor University—Blazor documentation from a secondary, independent source