News

Microsoft Updates Blazor Project for .NET Web Apps Using WebAssembly

Blazor, the experimental project underway at Microsoft to provide Web app development with .NET tools such as C#, has just been updated with new features as it journeys to beta status.

The new Blazor 0.3.0 release -- still in alpha stage -- comes just barely a couple weeks after 0.2.0 was announced last month, providing bug fixes and new features as Microsoft drives the much-ballyhooed project forward.

Meanwhile, Microsoft dev execs such as Scott Hunter are making the rounds to publicize the benefits of Blazor, which stole the show at a recent Hunter keynote address at the Visual Studio Live! conference in Austin. Expect more to come at Microsoft's Build conference next week.

To provide full-stack, client/server .NET Web apps without all that pesky and slow JavaScript, Blazor leverages the new WebAssembly project that converts higher-level language code to assembly-like code for native-speed performance. WebAssembly also works with programming languages such as C, C++ and Rust.

Blazor, meanwhile, is focused on putting WebAssembly to work with C#. The new updates announced Wednesday (May 2) include new project templates using Bootstrap4.

Bootstrap is an open source toolkit for creating HTML, CSS and JavaScript projects, letting developers quickly prototype ideas or build entire apps with its Sass variables and mixins, responsive grid system, extensive readymade components, and jQuery-based plug-ins, it's site says.

Microsoft' Daniel Roth said that in addition to providing a new fresh look to Blazor templates with new styles, "Bootstrap 4 includes lots of new features including an improved grid system based on flexbox, an improved reset file, new components, better tooltip support, better forms styling, built-in spacing utilities, and much more."

With support for async event handlers, meanwhile, "Event handlers can now be asynchronous and return a Task that gets managed by the runtime. Once the task is completed the component is rendered without the need to manually invoke StateHasChanged. Any exceptions that occur during the asynchronous execution of the event handler will be correctly handled and reported."

Roth also highlighted more strongly typed events for most common browser events, helping components handle user actions like mouse clicks, keypresses and even focus events.

He noted there's still work to be done on event handling, hopefully with the help of volunteers. "Most of the event arguments don't yet capture and surface the data from the events. That's something that we expect to handle in a future release. We welcome community contributions to help out with this effort."

Other new features include:

  • New component lifecycle events: OnAfterRender/OnAfterRenderAsync
  • Component and element refs
  • Better encapsulation of component parameters
  • Simplified layouts

In response to a reader question, Roth also revealed the team has no plans to target mobile development with Blazor -- just Web -- at this time, though he didn't rule out a change in that view in the future. For now, it's Xamarin for .NET-based mobile development.

Developers putting Blazor through its paces in this early experimental stage -- it requires the latest preview bits for .NET Core, Visual Studio, and so on, so the process might be a bit rough around the edges -- can file issues on GitHub and communicate on Gitter.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Uno Platform Ports Windows Calculator to Linux

    Uno Platform has ported the famed Windows Calculator, open sourced last year, to Linux as part of a continuing "proof point" effort to demonstrate the reach of what it describes as the sole UI offering available to target Windows, WebAssembly, iOS, macOS, Android and Linux with single-codebase applications coded in C# and XAML.

  • ASP.NET Core OData 8 Preview Supports .NET 5, but with Breaking Changes

    ASP.NET Core OData, which debuted in July 2018, is out in a v8.0 preview that for the first time supports the upcoming .NET 5 milestone release.

  • VS Code Java Team Details 5 Best Dev Practices

    Microsoft's Visual Studio Code team for Java development added a new Coding Pack for Java installer and detailed best practices for setting up a development environment.

  • Binary Classification Using PyTorch: Defining a Network

    Dr. James McCaffrey of Microsoft Research tackles how to define a network in the second of a series of four articles that present a complete end-to-end production-quality example of binary classification using a PyTorch neural network, including a full Python code sample and data files.

  • Blazor Debugging Boosted in .NET 5 RC 2

    In highlighting updates to ASP.NET Core in the just-launched second and final Release Candidate of .NET 5, Microsoft pointed out better debugging for Blazor, the red-hot project that allows for C# coding of web projects.

Upcoming Events