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 at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube