Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Adjust/avoid AOT compatibility warnings/errors #181

Open
wants to merge 72 commits into
base: master
Choose a base branch
from

Conversation

maxkatz6
Copy link
Member

Note: this PR doesn't fix most of real AOT compatibility issues. But it removes some low-hanging fruits (like FromEventPattern usage).

PR can be reviewer commit-by-commit. No behavioral changes should have been introduced.

The biggest difference that needs to be highlighted is removal of RequiresUnreferencedCode from Behavior.OnAttached and Trigger.OnAttached, which was producing AOT warnings/errors always for any behaviors SDK usage.

After this PR, RequiresUnreferencedCode is used only on types that actually require unreferenced code. For example, DraggableDemo and DragAndDropDemo now compliable with zero relevant AOT warnings/errors.

BehaviorsTestApplication understandably heavily relies on reflection (as it needs to show-case all behavior features), so it requires TrimmerRootAssembly hints.

Some of classes, like ChangeAvaloniaPropertyAction could get some help from XAML compiler, which could inject DynamicDependency trimmer attributes (which wouldn't resolve warnings). Or these could be made generic classes with less reflection (XAML compiler works well with generics in recent releases).

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.

2 participants