BT

InfoQ Homepage News Blazor: Client-Side Web UI with .NET Core 3.0

Blazor: Client-Side Web UI with .NET Core 3.0

Bookmarks

Last month, together with the .NET Core 3.0 release, Microsoft announced the new features of ASP.NET Core 3.0. There were significant changes in the new release, such as support for gRPC and integration with the new .NET Core JSON serialization API. The official announcement of Blazor, however, took the spotlight.

Blazor is a new framework in ASP.NET Core that allows developers to create interactive web applications using C# and HTML. According to Daniel Roth, principal program manager for ASP.NET at Microsoft:

With Blazor a developer can write client-side web UI using .NET and C# instead of JavaScript. Interactive UIs (with components that encapsulate UI logic) are written using C# and Razor and then rendered as HTML and CSS for multiple browser support. All .NET code can be shared with both the client and the server. The new framework supports scenarios with reusable UI components (Razor), client-side routing, forms, and JavaScript interoperability.

During the 2019 edition of .NET Conf, Microsoft demonstrated two different Blazor editions: Blazor Server and Blazor WebAssembly. Blazor Server, shipped together with .NET Core 3.0, allows web applications using Razor components to be hosted in ASP.NET Core servers. Remote clients accessing the application act as thin clients, and the UI in the browser is updated through the use of asynchronous notifications (using the SignalR library).

Blazor WebAssembly, on the other hand, allows single-page applications to run in the client's web browser using a WebAssembly-based .NET runtime. This edition allows support for scenarios involving progressive web applications (PWAs) and offline applications using the client's resources.

Image source: .NET Conf 2019 presentations

Microsoft also announced three other future Blazor editions: Blazor PWA, Blazor Hybrid, and Blazor Native. Also according to Daniel Roth, the main idea behind Blazor PWA is to allow applications developed for Blazor WebAssembly to be distributed as progressive web applications, which would appear as native applications to the target environment. Blazor Hybrid would be used in scenarios involving rendering native .NET applications to Electron, and Blazor Native would use the same programming model - but rendering non-HTML interfaces. While these editions are far ahead in the roadmap, Steve Sanderson - a Microsoft developer on the ASP.NET team - showed how Blazor can be used to build a Flutter application.

The .NET development community has been following the Blazor development with continuous interest. Scott Hanselman, a partner program manager at Microsoft, states in one of his recent blog posts about Blazor:

It's a pretty exciting time on the open web. There's a lot of great work happening in this space and I'm very interesting to see how frameworks like Razor Components/Blazor and Phoenix LiveView change (or don't) how we write apps for the web.

Positive feedback also appeared in other forums. Last year, after the release of a demonstration of Blazor using WebAssembly, quickthrower2 commented on Hacker News:

This framework is still fledgling, however, it is very exciting for a .NET developer, not because it's a shiny new thing to learn, but because it's the opposite ... it's allowing you to reuse existing skills to code for the web, while seemingly allowing you to create a React-like architecture of components/state. All using a decent language C#. This is simplifying things if you are already doing a full stack and working half the time with JS/TS and the other half with C#.

Blazor WebAssembly is currently in preview (with the official release expected to May 2020), and Blazor PWA is scheduled to have previews released with .NET 5. Blazor Native, however, is still listed as "under investigation". Developing Blazor applications requires .NET Core 3.0 and Visual Studio (VS 2019 16.3 for Windows and VS Code with the C# extension for Mac/Linux). All presentations from the .NET Conf 2019 can be found here.

Image source: .NET Conf 2019 presentations

Rate this Article

Adoption
Style

Educational Content

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Ms gravy train

    by Mike Orson /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I was on the Microsoft gravy train for a lot of years. They made simple leaders billions and the rest of us jobs for quite a while. When i read about a "new" .NET with c# front end , I can't help but laugh at how many people they continue to brainwash and keep developers "hooked". Why on earth would I invest time and energy in something that will simply be changed in 2 years with some new thing Microsoft comes out with? It's the same broken record for 30 years now. except this time, they convert it to web standards (as long you learn their technology first). I'm so tired of it. Javascript, css , html are not going anywhere folks. I dont need to learn a new flavor of razor every 2 years to use it.

  • The "open web"

    by Mike Orson /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Yea folks, with Microsoft you can keep using the "open web" with razor and c#!!!

  • C# on JavaScript libraries?

    by Ian Marteens /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Will the C# code access a true .NET environment or the crappy JavaScript runtime? I see no reasons for the excitement.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.