Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants