[Proposal] Source generator for [QueryProperty]
#20466
Labels
area-controls-shell
Shell Navigation, Routes, Tabs, Flyout
legacy-area-perf
Startup / Runtime performance
proposal/open
t/perf
The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone
Motivation
ShellContent applies query properties via reflection. Since we can't fix this code just with
[DynamicallyAccesseMebers(...)]
attributes, we need a different solution.The idea is to source-generate code equivalent to the reflection-based code. This would make this functionality not only trimmable and AOT-compatible, but also a bit faster.
Source generator specification
[QueryProperty]
attribute applied to itIQueryAttributable
&
or?
)[QueryProperty]
IQueryAttributable.ApplyQueryAttributes
IQueryAttributable
implementation to the classApplyQueryAttributes
method[QueryProperty]
attributeConvert.ChangeType
?Example
Notes and questions
null
(no matter what the actual type of the property is).IQueryAttributable
interface:QueryAttributableHelpers
for the repeating code patterns.QueryAttributableHelpers
as a new public API and ship it with MAUI.dotnet new maui
#19397The text was updated successfully, but these errors were encountered: