News

.NET 8 Preview 2: QuickGrid, WebAssembly Boost for Blazor

Microsoft's second preview of .NET 8 is just "a quick follow-up" to Preview 1, highlighted by a couple of improvements to Blazor, for creating web apps in C# instead of JavaScript.

.NET 8 Preview 2 was announced today (March 14), shipping just three weeks after Preview 1, which was notable for a native Ahead-of-Time (AOT) compilation upgrade and the new "Blazor United," a project that melds mix-and-match server-side and client-side rendering functionality.

While Preview 2 introduces some new library functionality, the Blazor side of things gets a high-performance grid component for displaying data in tabular form, QuickGrid.

It's "built to be a simple and convenient way to display your data, while still providing powerful features like sorting, filtering, paging and virtualization," said Daniel Roth, principal program manager for ASP.NET, the web-dev part of .NET.

[Click on image for larger view.] QuickGrid (source: Microsoft).

A QuickGrid demo site explains its purpose isn't to replace advanced datagrid components such as those from commercial component vendors, but rather:

  • To provide a convenient, simple, and flexible datagrid component for Blazor developers with the most common needs
  • To provide a reference architecture and performance baseline for anyone building Blazor datagrid components. Feel free to build on this, or simply copy code from it.

Another improvement is a boost to BlazorWeb WebAssembly (client-side Blazor) performance with the jiterpreter, a new .NET 8 runtime feature that enables partial just-in-time (JIT) compilation support in the .NET IL interpreter to achieve improved runtime performance.

Roth explained:

Blazor WebAssembly apps are able to run .NET code in browser thanks to a small .NET runtime implemented in WebAssembly that gets downloaded with the app. This runtime is a .NET IL interpreter that is fully functional, reasonably small in size, and allows for fast developer iteration, but lacks the runtime performance benefits of native code execution through just-in-time (JIT) compilation. JITing to WebAssembly requires creating new WebAssembly modules on the fly and instantiating them, which poses unique challenges for the runtime. Blazor WebAssembly apps can instead choose to compile ahead-of-time (AOT) to WebAssembly to improve runtime performance but at the expense of a much larger download size. Since some common .NET coding patterns are incompatible with AOT, the .NET IL interpreter is still needed as a fallback mechanism to maintain full functionality.
By optimizing the execution of interpreter bytecodes by replacing them with tiny blobs of WebAssembly code, he said, jiterpreter -- while not a full JIT implentation -- speeded up low-level operations and higher-layer features like JSON serialiation.
[Click on image for larger view.] Low-Level Operations (source: Microsoft).
[Click on image for larger view.] JSON Serialization (source: Microsoft).

As far as the general .NET 8 preview, Alexandra Barry, product manager for .NET Team/NuGet, said it comes with "a short, but exciting array of theme updates, new features and improvements" with library functionality including new System.ComponentModel.DataAnnotations features.

"This release is a quick follow-up to the larger Preview 1 release," she said. "You'll continue to see many more features show up with these monthly releases. .NET 6 and 7 users will want to follow this release closely. We've focused on making it a straightforward upgrade path."

On the data-driven side of things, the successor to Entity Framework, EF Core 8, in Preview 2 gets two notable features, according to Arthur Vickers:

  • Support for JSON columns in SQLite databases: Vickers explained that EF7 introduced support for mapping to JSON columns when using Azure SQL/SQL Server, with this support being extended in EF8 by embracing SQLite databases. As for the SQL Server support, it includes:
    • Mapping of aggregates built from .NET types to JSON documents stored in SQLite columns
    • Queries into JSON columns, such as filtering and sorting by the elements of the documents
    • Queries that project elements out of the JSON document into results
    • Updating and saving changes to JSON documents
  • HierarchyId in SQL Server/Azure SQL databases: "Azure SQL and SQL Server have a special data type called hierarchyid that is used to store hierarchical data," Vickers said. "In this case, 'hierarchical data' essentially means data that forms a tree structure, where each item can have a parent and/or children." Examples of such data include:
    • An organizational structure
    • A file system
    • A set of tasks in a project
    • A taxonomy of language terms
    • A graph of links between web pages

The above and other .NET 8 details can be tracked in Microsoft's "What's new in .NET 8" site.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Build Your First AI Applications with Local AI

    "AI right now feels like a vast space which can be hard to jump into," says Craig Loewen, a senior product manager at Microsoft who is helping devs unsure about making that first daunting leap.

  • On Blazor Component Reusability - From Day 0

    "We want to try to design from Day One, even Day Zero, with reusability in mind," says Blazor expert Allen Conway in imparting his expertise to an audience of hundreds in an online tech event on Tuesday.

  • Decision Tree Regression from Scratch Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of decision tree regression using the C# language. Unlike most implementations, this one does not use recursion or pointers, which makes the code easy to understand and modify.

  • Visual Studio's AI Future: Copilot .NET Upgrades and More

    At this week's Microsoft Ignite conference, the Visual Studio team showed off a future AI-powered IDE that will leverage GitHub Copilot for legacy app .NET upgrades, along with several more cutting-edge features.

  • PowerShell Gets AI-ified in 'AI Shell' Preview

    Eschewing the term "Copilot," Microsoft introduced a new AI-powered tool for PowerShell called "AI Shell," available in preview.

Subscribe on YouTube