Add AOT Compatibility#1820
Merged
TheCodeTraveler merged 24 commits intoSep 7, 2024
Merged
Conversation
simonrozsival
commented
Apr 16, 2024
0eab567 to
857ba9a
Compare
simonrozsival
commented
Apr 16, 2024
TheCodeTraveler
approved these changes
Sep 7, 2024
Collaborator
TheCodeTraveler
left a comment
There was a problem hiding this comment.
Thanks for getting this started @simonrozsival!
I confirmed our Sample App runs on iOS when <PublishAOT>enabled</PublishAOT> with no problems.
Contributor
Author
|
@brminnick thanks a lot for finishing the PR! |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR marks all product assemblies as AOT-compatible and fixes all warnings produced by trim and AOT analyzers. The list of warnings was surprisingly short:
BaseBehavior.IsBoundis inherently trim-unsafe, but since it's already[Obsolete], I think it is OK to just mark it as[RequiresUnreferencedCode](any app or library which would call this method will get a trimming warning and will have to deal with it)ServiceCollectionExtensionsmethods need[DynamicallyAccessedMembers]attributes matchingIServiceCollectionPopupService.AddTransientPopupneeds[DynamicallyAccessedMembers]attributes matchingIServiceCollectionValueConverterExtension.IsValidTargetTypeis the most complicated case I think. It is not possible to fix this case with[DAM]attributes because as I propagated the attribute to all callsites, I reached a point where I would need to add the attribute toMicrosoft.Maui.Controls.IValueConverterwhich wasn't possible. I tried to simplify the method, because it seemed too complicated. I'll leave some comments in the code to explain my reasoning.TODO (incomplete list)
new Binding(...)in favor of expression-based bindings (not available yet, still WIP in MAUI)Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information