Server-side is dead, long live client-side! BLAZOR + Sitecore = a match made in heaven

I have a dream…

I have a dream that one day I will not have to depend on massive JavaScript frameworks!
I have a dream that one day I will not have to learn new complicated JavaScript frameworks every second month!
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!!

This is indeed exciting times, what I really like about this is that we now have an option of doing front-end work without using messy and complicated JavaScript frameworks.

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


John stands for honor, loyalty and he will never fail you. He is having a tough time with the evil Lannisters
He will symbolize Asp.Net MVC and Asp.Net WebForms.

The evil Lannisters


They are tyrants who want to rule the world. They are not trustworthy and they will stab you in the back. So is it not fitting to let the Lannisters symbolize all the “messy” and “complicated” JavaScript frameworks(and libraries), like Angular, React, Vue etc.(the list is long)

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

Tyrion Lannister


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 Alliances…

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.
Why not let that symbolize JSS – Sitecore JavaScript Services

King In The North and the Dragon Queen


What a wonderful alliance. Who can stop them now?
A mix of Asp.Net Mvc, Razor and WebAssembley. What a powerful match and the outcome is… BLAZOR 🙂

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 🙂
https://visionsincode.github.io/SitecoreBlazor.io/

In my next post I will show you guys how it was made

That’s all for now folks 🙂


4 thoughts on “Server-side is dead, long live client-side! BLAZOR + Sitecore = a match made in heaven

  1. “Blazor and Sitecore LayoutService, a match made in heaven”, if the LayoutService is meant to be a facade over the Sitecore Rendering Engine and output JSON data, how could that be more useful than directly routing to the Rendering Engine itself?

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.