Blazor
Episode Six
Intro
Welcome to RoguePlanetoid podcast where each episode you can find insights for developers, whether you are a beginner or an experienced professional for Microsoft and related platforms, along with related technology and so much more to help Keep Current, Keep Coding.
Welcome
I'm Peter and welcome to episode six of the RoguePlanetoid Podcast about Blazor including how it came about, how it continues to evolve along with what I have used it for and what I think about Blazor. However, first of all I'd like to start by saying it was great to help represent a different kind of podcast last month when I attended CrimeCon the true-crime conference in London for Scottish Murders, while there was able to give out some promotional business cards for the RoguePlanetoid Podcast as quite a few people there knew someone who was interested in tech and might want to listen, so welcome to those of you who may have started listening to this podcast after hearing about it from someone who was there, and of course if you are interested in true-crime you can check out Scottish Murders at scottishmurders.com or check out the link in the show notes.
Blazor
Blazor allows you to build beautiful web applications using the power of .NET and C# to build full stack web apps without writing any JavaScript. Blazor was created back in 2017 by Steve Sanderson, who is a developer architect for Microsoft on the ASP.NET core team. It was an experimental idea that brought together Razor files that were introduced with ASP.NET Razor Pages that combine C# and HTML markup along with getting an actual .NET runtime that loads and runs .NET standard assemblies using WebAssembly in the browser to create a client-side version of ASP.NET Razor Pages called Blazor. Steve initially used a project called DotNetAnywhere or DNA, however this lacked .NET standard support and other .NET runtime features available, although thanks to work on Mono, which was the open-source version of .NET, to get this working with WebAssembly that allowed for a vastly more complete .NET API service, Steve was able to use this instead and the first preview version of Blazor was released to developers that year. It would be a year later in 2018 when Steve Sanderson announced that Blazor would be moved into the ASP.NET organisation itself within Microsoft, and they would be developing Blazor as a shipping product, by the next year in 2019 Blazor was made officially available as a preview from Microsoft, using the then latest version of .NET Core 3.0. Blazor has continued to evolve, and new versions have been released with each new version of .NET that not only allow developers to run web applications client-side using a version of .NET running on WebAssembly in the browser, but also server-side powered by ASP.NET and communicate with the client using SignalR, which enables real-time web functionality enabling server-side code to push content to client-side instantly. Blazor Components form a key part of Blazor and the same components can be shared between client-side and server-side projects. Blazor Hybrid was later created to allow applications created using Windows Forms, Windows Presentation Foundation, and .NET MAUI to blend desktop and mobile native client frameworks with Blazor, where components run natively on a device and render to an embedded web view without using WebAssembly and have full access to the native capabilities of the device via the .NET platform. Blazor United is coming with .NET 8 which will allow developers to use client-side or server-side Blazor in combination with each other, where you can initially serve an application server-side using Blazor Server and then when the WebAssembly runtime has been downloaded locally can switch to client-side using Blazor WebAssembly, this allows developers to finetune the rendering mode they need within a web application. Blazor is the modern web application technology from Microsoft which enables experiences such as interactive single page applications and more with access to .NET ecosystem based on a flexible component model that uses HTML and can run C# code in the browser using WebAssembly. If you want to find out more about Blazor including documentation, examples and more then visit blazor.net or check out the link in the show notes.
I first became more aware of Blazor, after hearing a few things about it beforehand, when I attended Developer Developer Developer in Reading a few years ago where I was speaking about Spotify for Developers later that day, but the first talk of the day was from Chris Sainty, who spoke about Blazor, it was then I saw Blazor in person for the first time, it was really interesting to see it in action and learn more about it! It would be a while before I got to use Blazor myself, but that opportunity came when I was working on another talk, One Rule Engine to Rule Them All for HaintonDotNet in Newcastle when a colleague suggested using Blazor for part of the demo, and wrote a proof of concept and it was amazing to see how far it had come, I then learned how to create the final demo using Blazor showing how you could use different Rule Engines to control behaviour in a web application. My next opportunity to use Blazor came when I was trying out a couple of other front-end frameworks and created some workshops based on the learning materials for them, once done I realised I could take those same examples and create a new one in Blazor, it was amazing to see how much easier it was to do that in Blazor as it had been compared to the other front-end frameworks. Blazor was something I wanted to do more with and that opportunity came from Tech on the Tyne also in Newcastle, where they asked if I was interested in doing something for them, I instantly thought of using Blazor along with Spotify for Developers, the same topic I was speaking about when I had seen Blazor shown off for the first time and created Blazorfy which was a workshop to create a web application using Blazor and Spotify. Blazorfy was popular with many of those attending and still have people who were there comment how much they enjoyed creating it! Blazor would also make an appearance as part of the demo for a talk about Modern .NET and WPF for HaintonDotNet in Newcastle and for DDD North in Hull where I used Blazor Hybrid to show a Blazor component being used in a Windows Presentation Foundation application, that demo also included a few more parts of the .NET ecosystem including Razor Pages and even Minimal APIs along with Blazor. Later I wanted to do even more with Blazor and had written many games using the Windows App SDK so I decided to port a few of them to Blazor, which was far more straightforward that I had expected and also learned how to publish a Blazor WebAssembly application to GitHub Pages so people could play the games in a browser without even needed to write any code! Another opportunity arose to use Blazor when at my job when they were planning on a learning at work week and I jumped at the chance to create another workshop, this would be a brand-new bingo and emoji based game called Blazor Emoji Bingo, and it was another success where I and those there followed along with the workshop in real-time and then we all played the game together at the end. If you want to try out or find out more about the Blazor Games I created then you can check out the article about them at rogueplanetoid.com/articles/blazor-games or you can find the workshops for Blazor, Blazorfy using Spotify for Developers and Blazor Emoji Bingo at tutorialr.com/workshops or you can check out those links in the show notes.
Blazor is now a fully-fledged web application technology used by developers all over the world, from its humble beginnings as an experiment to a major part of the .NET ecosystem, that demonstrates how a small individual project can become a key product to enable client-side or server-side development using .NET, C# and HTML. Blazor is something I've been using more and more in workshops and talks or even just for fun and whether you already know .NET and C# or not, you'll find it easy to get started and be able to put something together in Blazor and as Blazor continues to evolve there will be more opportunities to use Blazor, whether that be for personal projects or for professional purposes. If you've never tried Blazor then you should do so when you get the chance, and if you've used it before like, me then hopefully the next opportunity to use it, is just around the corner.
Outro
Thanks for listening to the RoguePlanetoid podcast where you can find insights for developers, whether you are a beginner or an experienced professional using Microsoft and related platforms, along with related technology and so much more. You can also find any links in the show notes for this episode or visit rogueplanetoid.com/podcast for details of this episode and podcast. Keep Current, Keep Coding!
- Website - rogueplanetoid.com/podcast
- Twitter - twitter.com/rogueplanetoid
- YouTube - youtube.com/@rogueplanetoid
- Scottish Murders - blazor.net
- Blazor - blazor.net
- Blazor Games - rogueplanetoid.com/articles/blazor-games
- Blazor Workshops - tutorialr.com/workshops
RoguePlanetoid Podcast is a production of cluarantonn.com
Hosted, Written, Produced and Edited by Peter Bull
Music based on Like a Tiger by Jo Wandrini
Production Company Name by Granny Robertson