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

Trimmable runtime xaml loader #12937

Merged
merged 9 commits into from
Sep 30, 2023
Merged

Trimmable runtime xaml loader #12937

merged 9 commits into from
Sep 30, 2023

Conversation

maxkatz6
Copy link
Member

What does the pull request do?

Makes trimmed application to not crash while using runtime XAML parser.

How was the solution implemented (if it's not obvious)?

One of the solutions was to use DynamicallyAccessedMembers attribute on TypeSystem.FindType(string) members, but it requires adding the assembly full name to each type, which is undesirable.

Instead, DynamicDependency attribute for each known runtime type dependency was added.

Fixed issues

Fixes #12419

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0039638-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 requested review from a team and removed request for kekekeks September 27, 2023 05:39
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0040105-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0040123-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0040199-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Sep 30, 2023
Merged via the queue into master with commit dcd1b59 Sep 30, 2023
5 checks passed
@maxkatz6 maxkatz6 deleted the trimmable-runtime-xaml-loader branch September 30, 2023 14:16
@danwalmsley danwalmsley added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Oct 6, 2023
danwalmsley pushed a commit that referenced this pull request Oct 6, 2023
* Add trimming attributes to the Runtime XAML Loader project

* Create CompilerDynamicDependenciesAttribute with all known dynamic types

* Use master XamlX

* Implement CompilerDynamicDependenciesGenerator to simplify CompilerDynamicDependencies attribute

* Better formatting of generated code

* Be safe about type converters as well

* Remove unnecessary warning

* Also include FindType just in case
@grokys grokys added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Oct 14, 2023
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.

Parsing/Loading xaml-code during runtime causes exception on physical iOS device
5 participants