I have a dream…
I have a dream that one day I will be able to run c# and razor, client-side in the browser!
Hallelujah! Brothers and sisters that day has come and the answer to our prayers is – BLAZOR.
I have been waiting for this since the modern browsers started to support WebAssembly.
A year ago Steve Sanderson(the creator of KnockOutJs) showed an amazing demo at NDC Oslo, where you could run c# client-side in the browser, it was called Blazor.
Three months ago, Microsoft saw great opportunities and added Blazor as an official ASP.NET project with its own repository under the official ASPNET collection of repositories. This means that Microsoft is now actively working on Blazor in this and started it as an experimental face. Now it has grown and soon it will be a full-fledged member of the .Net family.
What is Blazor then?
It stands for Browser + Razor. The true hero and creator behind this is Steve Sanderson, he is a god!
Blazor uses WebAssembly to bootstrap a Mono runtime within the browser. It’s described in the official GitHub repository in the following way:
Blazor uses only the latest web standards. No plugins or transpilation needed. It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. It works in older browsers too by falling back to an asm.js based .NET runtime.
Or as Steve Sanderson describes it:
It’s a framework for browser-based (client-side) applications written in .NET, running under WebAssembly. It gives you all the benefits of a rich, modern single-page application (SPA) platform while letting you use .NET end-to-end, including sharing code across server and client.
This means that Blazor allows you to run/code C# and Razor clientside (alongside standard HTML) in the browser, this is huge!!
How will this end? Will Blazor conquer the world or just fade away.
Let me give you a Game of Thrones(Sitecore) analogy on this 😄
King In The North
The evil Lannisters
Daenerys Targaryen – The mother of dragons
She believes in right and wrong, she stands behind the weak. She is fearsome and strong. Perfect symbolism for the powerful WebAssembly.
WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications
The adviser to the feared dragon queen, he guides her to make the right decisions.
He will symbolize the Mono team(at Microsoft), who are doing a fantastic job adding .Net support for WebAssembly
The Lannisters and Euron
A strong alliance – Lannisters and Euron(the King of the Iron Islands). Suddenly the Lannisters have a gigantic fleet of ships at their disposal.
King In The North and the Dragon Queen
How will this end?
Well, perhaps Jaime Lannister will end up joining the Dragon Queen and the King In The North?
We could symbolize it as The Sitecore Layout Service.
Blazor and Sitecore LayoutService, a match made in heaven… 😉
My focus this year will be on BLAZOR and make it play with Sitecore, so be prepared for blog posts of the wonderful Blazor playing well with Sitecore…
I have setup a demo page on the GitHub 🙂
In my next post I will show you guys how it was made
That’s all for now folks 🙂