free and open-source
Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
Five different editions of Blazor apps have been announced.
Blazor Server: These apps are hosted on an
ASP.NET Core
ASP.NET Core is a free and open-source web framework and successor to ASP.NET, developed by Microsoft. It is a modular framework that runs on both the full .NET Framework, on Windows, and the cross-platform .NET. However, ASP.NET Core version 3 on ...
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
The domain name net is a generic top-level domain (gTLD) used in the Domain Name System of the Internet. The name is derived from the word ''network'', indicating it was originally intended for organizations involved in networking technologies ...
3.
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
WebAssembly (sometimes abbreviated Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment ...
, as opposed to JavaScript (while they can be used together).
Blazor PWA and Blazor Hybrid editions: The former supports
progressive web apps
Progressive may refer to:
Politics
* Progressivism, a political philosophy in support of social reform
** Progressivism in the United States, the political philosophy in the American context
* Progressive realism, an American foreign policy par ...
(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
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone techno ...
).
Blazor Native: A platform-native framework that renders a platform-native user interface – has also been considered but has not reached the planning stage.
Despite the confusion that the descriptions of ASP.NET and Blazor could generate, the latter focuses on the creation of web applications with the aim of using the C# programming language instead of the JavaScript language, which is commonly used in this type of application.
With the release of .NET 5, Blazor has stopped working on Internet Explorer and the legacy version of Microsoft Edge.
Example
The following example shows how to implement a simple counter that can be incremented by clicking a button:
Blazor code example
count: @count
@code
See also
*
asm.js
asm.js is a subset of JavaScript designed to allow computer software written in languages such as C to be run as web applications while maintaining performance characteristics considerably better than standard JavaScript, which is the typical l ...
– precursor of WebAssembly enabling client-side web apps written in C or C++
* Google Native Client – deprecated
Google's
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
precursor to WebAssembly that enables running native code in a web browser, independent of browser's operating system