Oct 2024 | 2 min time

At "Codemotion Milan 2024," I attended a session titled "Blazor: Yesterday, Today, and Tomorrow," presented by Andrea Dottor. During the talk, we explored Blazor's evolution in detail, from its introduction in 2017 to its latest updates and future prospects.
Blazor was first released with .NET Core 3 in September 2019, initially limited to Blazor Server. In May 2020, the introduction of Blazor WebAssembly allowed applications to run directly in the browser.
With the advent of .NET 8, Blazor became a "Full Stack Web UI" framework, thanks to the addition of Blazor Web Apps, a solution that integrates both back-end and front-end development.
Blazor offers four different usage modes. The first, called Blazor Server, executes all application code on the server, with the client connected via SignalR. This approach is somewhat similar to the old terminal/mainframe systems. While it provides direct access to server resources, such as the file system, its major drawback is the constant need for a stable connection.
The second mode, Blazor WebAssembly, leverages WebAssembly technology to run the application, written in C#, directly inside the browser. While this enables offline execution, the trade-off is the need to download a large payload, essentially the entire application.
A third mode, Blazor Web SSR (Static Server-Side Render), delegates page rendering entirely to the server. This allows pages to be indexed and easily discoverable by search engines. However, since pages are almost entirely static, interactivity is significantly limited and only possible through JavaScript scripts.
Finally, Blazor Web App can be seen as a hybrid of the previous two solutions. Pages are partially rendered on the server, while still allowing dynamic sections that can be programmed in C#. However, this approach impacts performance.
With .NET 9, new features will be available, including a new middleware that provides advanced compression and content-based tags, improvements in page rendering, and the ability to use dependency injection directly in constructors.
In conclusion, Blazor's main advantage is the ability to use C# for both front-end and back-end development, enabling seamless code sharing between the two areas.