Blazor – The Third Time’s the Charm from Microsoft
The first time is the ActiveX. The second time is the Silverlight. Now, Blazor is the third time. Is this the ONE?
If you are old enough, you must have heard of the ActiveX. For example, the Flash Player is an ActiveX control or browser’s plug-in that users can download for viewing a video. Did we enjoy developing the ActiveX controls for our users during the ’90s? Well, it was great at the very beginning, but toward at the end, it had become a nightmare since its security and maintenance issues. However, at that time, it was the only way to bring some advance feature like the spreadsheet function to work with our project requirements on the browser.
At that time, whenever we released some cool new features, we just published the plug-in program we developed to the web server, and the next time users refresh the web application, they will be prompted to download the latest and greatest program. In the pre .NET era, Microsoft and other software companies struggled to deliver advanced functionalities on a browser that were comparable to a desktop. Besides Microsoft’s ActiveX technology, we have the downloadable JavaBeans that ran under Java Virtual Machine (JVM) on a browser. It was great for Microsoft because they can pour existing functionalities from Microsoft’s frameworks into the Internet and secure the market share of browsers.
The Struggles of Video Presentation on Web Browsers
As the web technologies advanced, in 2007, Microsoft developed Silverlight technology is hoping to deliver the best streaming media experience and overthrow the King of media player, Flash. At the height of the Silverlight’s implementation, Microsoft’s Silverlight had a penetration of 64.2% in May 2011 in comparing Adobe Flash installed in 95.3% of browsers. Silverlight was used to provide video streaming for NBC coverage of 2008 Summer Olympics and 2010 Winter Olympics. Both Netflix and Amazon Video used Silverlight to deliver their instant video streaming services. Silverlight seemed to have a promising future at that time. However, the era of video plug-ins had come to an end. Both Silverlight and Flash were going down to the history because there was a new kid on the block, the HTML5 video element. After 2011, the rise of mobile devices had accelerated the need to have mobile-friendly websites and cross-browser support applications, and the HTML5 ended the years-long struggle of browser compatibility issues. Finally, Microsoft announced the end of life of Silverlight 5 in 2012. It was a short-lived product although so much effort has been put into since the video element in the HTML5 was proposed the same year as Silverlight was released. However, the effort was not in vain because XAML (Extensible Application Markup language) developed by Microsoft was once heavily used in the framework of Silverlight but now being used for building mobile applications under Xamarin. Ironically, combining of latest .NET technologies with Xamarin, mobile developers can develop cross-platform and multi-screen mobile apps that can be installed in Android, iOS, Mac, and Windows mobile devices. One code base serves them all.
Before we discuss further, we need to understand that prior the introduction of HTML5, it was not a matter of that we could not come up with a better technology that took care of our needs for a better browser experience. In reality, we did have the means, but the entire web community was in a turmoil. We had a browser war among different brands of browsers. An individual plug-in may have their licenses. Smaller components like the video rendering technology or the video decoding codecs have their own implementation to specific browsers and specification that wanted to follow. It was a difficult job for web developers during that time because you may need to build multiple versions of the same website due to the discrepancies between browser types, browser versions, plug-in compatibilities, codec licensing issues. It was always a struggle. One day your site worked and looked perfect, and another day, your site looked awful and did not work at all after the browser upgrade.
Back in the day, without downloading the ActiveX control or Silverlight, Microsoft could not deliver any advanced features to the browser. However, today with the new specification on the web that we discussed earlier, Microsoft can rely on a secret friend hidden inside the specification called WebAssembly (WASM) to make this secret mission a possibility.
Blazor in Action
Here are the processes of Blazor in Action:
A Blazor web application is developed in Visual Studio 2017 with .NET Core 2.1.
Many static files including Blazor page, blazor.js, and mono.js have been generated after publishing the app.
The Blazor page (.html) along with blazor.js and mono.js are downloaded to the browser’s Mono WebAssembly module
The mono.wasm (the Mono version of WASM) is the actual Mono WebAssembly .NET runtime that mono.js loads into the browser. It is the Mono compiled to WebAssembly.
The rest of the .NET code did not compile into WebAssembly, but replies on Mono’s own IL interpreter to be executed.
If you have any thoughts about Blazor or could this be the one or comments about the article, I would love to hear what you have to say. Thank you for reading.