Skip to content

[Trimming] Disable query property assignment via reflection on NativeAOT#20731

Merged
rmarinho merged 5 commits intodotnet:net9.0from
simonrozsival:disable-query-property-assignment-via-reflection
Feb 22, 2024
Merged

[Trimming] Disable query property assignment via reflection on NativeAOT#20731
rmarinho merged 5 commits intodotnet:net9.0from
simonrozsival:disable-query-property-assignment-via-reflection

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Description of Change

This PR fixes 2 trimming warnings in dotnet new maui app.

This PR introduces a feature switch that will disable the part of shell navigation that propagates the query parameters to properties based on [QueryProperty("PropertyName", "queryId")] attributes. The developer can still consume query parameters by implementing the IQueryAttributable interface manually. The feature will enabled by default for all Mono apps and it will be disabled by default only when building with NativeAOT.

Issues Fixed

Contributes to #19397
We could reintroduce this feature for NativeAOT apps if #20466 is approved and implemented.

/cc @PureWeen @mattleibow @jonathanpeppers

@simonrozsival simonrozsival requested a review from a team as a code owner February 20, 2024 17:51
Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After toggling whitespace:

image

This one looks very straightforward, as it just wraps a single chunk of code with if (RuntimeFeature.IsQueryPropertyAttributeSupported).

Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants