Microsoft has improved functionality, performance, and diagnostics in the MVVM toolkit portion of the .NET Community Toolkit.
Unveiled 18 January, .NET Community Toolkit 8.1 adds dedicated analysers to the MVVM (model-view-view-model) toolkit. Previously, the MVVM toolkit emitted diagnostics for features used incorrectly.
Now, it can offer recommendations for improving code. Another analyser has also been added to help reduce binary size in applications.
Performance optimisations are intended to improve the developer user experience, particularly when working on large solutions. The architecture of generators was improved with capabilities such as multi-targeting for the Roslyn 4.3 compiler platform.
Diagnostics were moved to diagnostics analysers to reduce overhead when typing. Incremental providers were also updated to no longer propagate symbols, thus reducing memory use.
To improve performance and reduce memory allocations, incremental models and pipelines were overhauled. The updated MVVM toolkit also features new IObservableT
extensions for the IMessenger
interface bridges functionality exposed by messenger APIs.
.NET Community Toolkit 8.1 also adds the .NET 7 target framework monitor to the high-performance package and includes changes to benefit C# 11 ref fields. Version 8.1 also takes some types out of preview, including RefT
, ReadOnlyRefT
, NullableRefT
, and ReadOnlyNullableRefT
. New ref
safety rules are in place for these types.
In addition to the updated MVVM toolkit, .NET Community Toolkit includes the following libraries:
CommunityToolkit.Common
CommunityToolkit.Diagnostics
CommunityToolkit.HighPerformance
Source code for NET Community Toolkit, which offers APIs and helpers for .NET developers regardless of the UI framework, can be found on GitHub.