What is Blazor WebAssembly?
As mentioned earlier Blazor can run your client-side C# code directly in the browser, using WebAssembly. Because it is real .NET running on WebAssembly, you can re-use code and libraries from server-side parts of your application.
Alternatively, Blazor can run your client logic on the server. Client UI events are sent back to the server using SignalR - a real-time messaging framework. Once execution completes, the required UI changes are sent to the client and merged into the DOM.
Blazor Server uses a standard ASP.NET Core application. Within that application, you can integrate server-side functionality, such as integrating a SQL Server database through Entity Framework (an open-source, object-relational mapping framework that originally shipped as an integral part of the .NET Framework).
The Blazor Server application communicates with the browser through a constant connection using SignalR. You can create client-side pages using Razor components or Razor pages.
Blazor Server apps are fast to load and simple to implement. Support for Blazor Server is available with .NET Core 3.1 LTS.
Blazor WebAssembly allows the browser to download the Blazor application.
This means that the Blazor application runs in the web browser. No need for a constant connection with a server for the application to work.
However, because it's solely a client-side application, you can't directly integrate any server-side functionality into the Blazor application.
In order to do that, you would need to hook it up with a server-side application, such as an ASP.NET Core Web API.
Like with Blazor Server, we can create client-side pages using Razor components or Razor pages.
- Blazor WebAssembly comes packed with features to keep you productive on your next web app project:
- Leverage the productivity of C# and strong runtime typing
- Build on the stable and mature .NET ecosystem
- Easily reuse code and existing .NET standard libraries on the client and server
- A shared component model with Blazor Server apps, implemented in Razor component files
- Deploy your app as a standalone static site, or host it with ASP.NET Core
- Build Progressive Web Apps (PWA) with offline capabilities and native OS integration
- Built-in support for authentication
- Integrated globalization & localization support
- Environment-based configuration
- IL trimming and build-time precompression
- Full-stack debugging
- Great tooling with Visual Studio, Visual Studio for Mac, and Visual Studio Code
SignalR is a library for ASP.NET developers to simplify the process of adding real-time web functionality to applications. Real-time web functionality is the ability to have server code push content to connected clients instantly as it becomes available, rather than having the server wait for a client to request new data. The chat application is often used as a SignalR example.
The hosting model you should use will depend on the objectives and the features you want to offer in your application. If you plan to use an application where Internet connectivity is weak, you might opt for Blazor WebAssembly as it functions well without a server connection. It’s also a better choice if you prefer to work offline.
On the other hand, if you’re looking to build client-facing applications that rank well in Google, Blazor Server is a better choice.
Angular has been around for a long time, unlike Blazor. It is a production-ready framework with full support for MVC/MVVM applications and it is being used by many large companies. Blazor, on the other hand, is continuously being changed and has not yet achieved enough maturity to contend with Angular, despite being very promising. Angular tooling is also more mature with full debugging support in IDEs like VS Code.
To help illustrate the kind of visualizations and analysis that can be supported in a Blazor application, our team at Infragistics created the U.S. Presidential Election Dashboard, a sample application that compares current and historical data and identifies data trends.
This dashboard provides interactive visualizations of election data up to the 2020 election. Built-in Blazor (WASM) using Ignite UI for Blazor, this sample application features our Blazor Data Grid, Blazor TreeMap, Blazor Map, and Blazor Data Chart components.
We built our full-featured, lightweight Blazor Data Grid and Blazor Table to meet the challenge of displaying high volumes of data while providing all the interactive features your customers expect. The Data Grid and all the Ignite UI Blazor components were designed for modern C# Blazor apps, including full support for Blazor WebAssembly, so you can deploy to any modern browser for the best possible user experience.
And here is something else exciting for Blazor devs. We have released App Builder® for Blazor! What does this mean for your app development process?
- App Builder is a complete cloud-based WYSIWYG drag & drop tool that eliminates the complexity of UI design with a cloud-based IDE that lets you create apps, themes and add data binding in a snap!
- You’ll be creating your Blazor apps 10x faster!
- With the App Builder acting as your low-code tool, everything that you design will result in production-ready code for Blazor.
- With the Code Preview, you can see your clean, testable source code that is getting generated in real-time while you are building your app!
- Get App Builder today in your Ignite UI, Infragistics Professional or Infragistics Ultimate subscription!
Find out more about our blazing-fast Blazor Data Grid and see a Blazor Grid example here.