.NET Community Toolkit 8.2 Adds Faster Generators
Written by Kay Ewbank   
Monday, 15 May 2023

Microsoft has announced version 8.2 of the .NET Community Toolkit, a collection of helpers and APIs that work for all .NET developers. The developers say this new version includes performance improvements both at runtime and in the MVVM Toolkit source generators, and new code fixers to enhance your productivity.

The Community Toolkit is UI platform agnostic. While it is maintained and published by Microsoft, and is part of the .NET Foundation, it can be used by application developers regardless of the specific UI framework in use.

net2

The toolkit is made up of libraries that were originally part of the Windows Community Toolkit that Microsoft released to simplify building UWP and .NET apps for Windows 10 and Windows 11.

The performance improvements in the toolkit's source generators come from optimizations to the incremental pipelines to minimize memory use and ensure no unnecessary objects are kept alive across concurrent executions. To achieve this, two more diagnostics in the MVVM Toolkit have been moved to a diagnostic analyzer, which can run concurrently and out of process. This removes some Roslyn symbols from the incremental pipeline and improves the overall generator performance.

This release includes support for custom attributes when using [RelayCommand]. The team says this is particularly useful when using a viewmodel that needs to support JSON serialization, and you need to explicitly ignore the generated property. 

Another improvement is the ability to change hooks for an observable property. This improves the situation when you have a selected item" observable property, such as the currently selected user, or nested viewmodel. When the value of this property changes, it was until now difficult to make adjustments to the old and new instances as [ObservableProperty] didn't have the necessary infrastructure. It now does.

The other change of note isthe addition of MVVM Toolkit code fixers. These extend the diagnostic observable property analyzers added in the previous release to go beyond producing a warning to suggesting built-in code fixes. Hovering on the IntelliSense light bulb now shows a suggested code fix that can be automatically applied, including bulk fixes, so you can fix all of your errors with a single click.

.NET Community Toolkit is available now on GitHub. 

net2

More Information

.NET Community Toolkit On GitHub

Related Articles

.NET Community Toolkit Updated

MAUI Framework And Community Toolkit Released

Microsoft Launches .NET Community Toolkit  

MAUI Compatibility For Xamarin Community Toolkit

.NET Celebrates 20th Anniversary of Launch

Microsoft Releases .NET 6 And Visual Studio 2022

Developer Preview Of .NET 6 Released

Windows UWP Community Toolkit

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Apache Arrow 16 Adds Azure Blob Support
21/05/2024

Apache Arrow 16 has been released with improvements to the C data interface and to Arrow Flight RPC, and the addition of support for Azure Blob data format.



Celebrate eLearning With edX
10/05/2024

Until May 20th, edX is offering up to US$1,000 off some of its boot camp programs and 30% off other selected programs. This discount is to celebrate its Birthday - which is why the relevant code is ED [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 15 May 2023 )