Page 8 - MSDN Magazine, September 2018
P. 8
Editor’s NotE MICHAEL DESMOND .NET in the Browser
In February, Microsoft Senior Engineer Steve Sanderson announced thattheASP.NETteamhadtakenformalownershipofBlazor—an experimental Web UI framework he created that’s based on C#, Razor, and HTML and runs in the browser. The announcement set off a bit of a firestorm. After all, the project aims to do what earlier efforts like Silverlight could not: Enable developers to write .NET-based Web apps for the browser without a plug-in.
The secret behind Blazor is WebAssembly, a standard, binary instruction format that provides a portable target for compiling high-level languages like C++. WebAssembly is supported by all mainline browser families—desktop and mobile—released since mid-2017. Blazor leverages work from the Xamarin Mono proj- ect, enabling a .NET runtime for the Web. Code compiled to WebAssembly can run in any browser at native speeds.
Microsoft Principal Program Manager Daniel Roth has been elbow deep in Blazor going back to the February announcement, and helped vet two articles in this month’s issue focused on it: Jonathan Miller’s “C# in the Browser with Blazor” and Dino Esposito’s Cutting Edge column, “Never Mind JavaScript, Here’s Blazor.” I asked Roth about his thoughts on Blazor and the promise it holds for .NET developers.
“With WebAssembly, for the first time, we have the opportunity to enable full-stack Web development with .NET, where you can use the .NET languages, frameworks, and tools to fully utilize the browser in an open and standardized way,” Roth says. “We’re seeing interest in Blazor for writing a wide variety of applications, from line-of-business apps to health care apps to games.”
Since the February launch of the Blazor project, the ASP.NET team has been releasing updates every one to two months, with version 0.5.0 shipped in July. Roth says the most recent spin does some pretty cool stuff.
“Our latest Blazor release explored running Blazor in a separate process from the rendering process. For example, you might run Blazor in Web Worker, in an Electron app, or even server-side on .NET Core, and then handle all the UI updates and event handling over a cross-process channel.”
Roth offers the example of Blazor running on the server-side and usingSignalRtoconnectwithclients.Theapproacheliminatesthe need to download a full .NET runtime to the browser.
“The nice thing about this model is that it’s completely symmet- ric with running Blazor in the browser, but all the existing .NET libraries and tools just work, and you don’t have to pay the cost of downloading a full .NET runtime into the browser.”
Since the February launch of the Blazor project, the ASP.NET team has been releasing updates every one to two months, with version 0.5.0 shipped in July.
There’s plenty of work ahead, says Roth. The WebAssembly-based .NET runtime needs improvement—smaller download sizes, bet- ter runtime performance and support for .NET Standard 2.0 are all priorities. The IL linker needs refinement to scrub more unused code from apps, and the team plans to explore support for Ahead- of-Time compilation of .NET code. And there’s more.
“Besides the runtime, we need to complete the Blazor compo- nent model to support scenarios like template-based components, forms and validation, and handling more event types. We’d also love to have a tooling story for Blazor apps that can run cross-platform in Visual Studio Code,” says Roth.
Blazor remains very much an experiment-in-progress, but one that could redefine Web application development. This much is certain: We’ll be keeping an
eye on this promising effort in
the months and years to come.
Visit us at msdn.microsoft.com/magazine. Questions, comments or suggestions for MSDN Magazine? Send them to the editor: mmeditor@microsoft.com.
© 2018 Microsoft Corporation. All rights reserved.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, you are not permitted to reproduce, store, or introduce into a retrieval system MSDN Magazine or any part of MSDN Magazine. If you have purchased or have otherwise properly acquired a copy of MSDN Magazine in paper format, you are permitted to physically transfer this paper copy in unmodified form. Otherwise, you are not permitted to transmit copies of MSDN Magazine (or any part of MSDN Magazine) in any form or by any means without the express written permission of Microsoft Corporation.
A listing of Microsoft Corporation trademarks can be found at microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx. Other trademarks or trade names mentioned herein are the property of their respective owners.
MSDN Magazine is published by 1105 Media, Inc. 1105 Media, Inc. is an independent company not affiliated with Microsoft Corporation. Microsoft Corporation is solely responsible for the editorial contents of this magazine. The recommendations and technical guidelines in MSDN Magazine are based on specific environments and configurations. These recommendations or guidelines may not apply to dissimilar configurations. Microsoft Corporation does not make any representation or warranty, express or implied, with respect to any code or other information herein and disclaims any liability whatsoever for any use of such code or other information. MSDN Magazine, MSDN and Microsoft logos are used by 1105 Media, Inc. under license from owner.
4 msdn magazine