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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events