.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


Google Adds Multiple Database Support To Firestore
04/03/2024

Google has announced the general availability of Firestore Multiple Databases, which can be used to manage multiple Firestore databases within a single Google Cloud project.



AWS Adds Support For Llama2 And Mistral To SageMaker Canvas
12/03/2024

As part of its effort to enable its customers to use generative AI for tasks such as content generation and summarization, Amazon has added these state of the art LLMs to SageMaker Canvas.


More News

raspberry pi books

 

Comments




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

Last Updated ( Monday, 15 May 2023 )