Open simonrozsival opened 1 week ago
In a migration guide or release notes, we should tell customers how to address warnings they might see, such as in the case of https://github.com/dotnet/maui/issues/24736:
@simonrozsival That should be handled in the breaking changes docs, which are an engineering responsibility to provide.
Help make content visible
In .NET MAUI 9, we now require all classes implementing
IMarkupExtension
,IMarkupExtension<T>
,IValueProvider
, andIExtendedTypeConverter
to be annotated with either[RequireService(typeof(T))]
or[AcceptEmptyServiceProvider]
attributes. This was introduced in https://github.com/dotnet/maui/pull/19945.IValueProvider
should goIn a migration guide or release notes, we should tell customers how to address warnings they might see, such as in the case of https://github.com/dotnet/maui/issues/24736:
Describe the change
We introduced a new optimization to XamlC which allows us to generate more efficient code when compiling XAML. This optimization helps reduce the final app size and also improve runtime performance.
Create XAML markup extensions
The example should be updated:
The "Service providers" section
We should add a new paragraph describing the change:
for each use of
serviceProvider.GetService(typeof(T))
in theProvideValue
method, the class should be annotated with[RequireService(typeof(T))]
(Microsoft.Maui.Controls.Xaml.RequireServiceAttribute
) such as for example here: https://github.com/dotnet/maui/blob/68b953b2ba020766ce8403455da209a12cf43564/src/Controls/src/Xaml/MarkupExtensions/ReferenceExtension.cs#L8-L40. It might be a good idea to show a more complete example of the usage ofIProvideValueTarget
with the attribute applied to the class.if the markup extension doesn't use any service from the service provider, the class should be attributed with
[AcceptEmptyServiceProvider]
(Microsoft.Maui.Controls.Xaml.AcceptEmptyServiceProviderAttribute
)/cc @StephaneDelcroix @davidbritch
Associated WorkItem - 314394