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

  • Visual Studio Code Dev Team Cleans Up

    The Visual Studio Code development team focused on some housekeeping in the October update, closing more than 4,000 issues on GitHub, where the cross-platform, open-source editor lives.

  • ML.NET Model Builder Update Boosts Image Classification

    Microsoft announced an update to the Model Builder component of its ML.NET machine learning framework, boosting image classification and adding "try your model" functionality for predictions with sample input.

  • How to Do Naive Bayes with Numeric Data Using C#

    Dr. James McCaffrey of Microsoft Research uses a full code sample and screenshots to demonstrate how to create a naive Bayes classification system when the predictor values are numeric, using the C# language without any special code libraries.

  • Vortex

    Open Source 'Infrastructure-as-Code' SDK Adds .NET Core Support for Working with Azure

    Pulumi, known for its "Infrastructure-as-Code" cloud development tooling, has added support for .NET Core, letting .NET-centric developers use C#, F# and VB.NET to create, deploy, and manage Azure infrastructure.

  • .NET Framework Not Forgotten: Repair Tool Updated

    Even though Microsoft's development focus has shifted to the open-source, cross-platform .NET Core initiative -- with the aging, traditional, Windows-only .NET Framework relegated primarily to fixes and maintenance such as quality and reliability improvements -- the latter is still getting some other attention, as exemplified in a repair tool update.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events