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

Make MAUI Trimming Safe #1962

Closed
2 of 6 tasks
Redth opened this issue Aug 5, 2021 · 5 comments
Closed
2 of 6 tasks

Make MAUI Trimming Safe #1962

Redth opened this issue Aug 5, 2021 · 5 comments
Assignees
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with t/app-size Application Size / Trimming Task neither bug nor feature but something that needs to be done in support of either
Milestone

Comments

@Redth
Copy link
Member

Redth commented Aug 5, 2021

We should be able to build the library with Trimming enabled and have MAUI work in applications.

@Redth Redth added the t/app-size Application Size / Trimming label Aug 5, 2021
@jonathanpeppers
Copy link
Member

Essentials is already done for Android, but maybe not other platforms?

[assembly: AssemblyMetadata("IsTrimmable", "True")]

@eerhardt
Copy link
Member

I've noticed that Microsoft.Maui.Controls.dll is the largest managed assembly in a dotnet new maui android app:

image

We should consider adding IsTrimmable=true to that assembly (and fix any trimming issues associated with doing that).

@eerhardt
Copy link
Member

Another assembly that looks like it isn't marked for trimming is Microsoft.Maui.Graphics.dll.

eerhardt added a commit to eerhardt/maui that referenced this issue Mar 3, 2022
This behavior is not trim-compatible, since it just a random string "route name" and calls Type.GetType with it, and then Activator.CreateInstance. The trimmer might have removed the whole type, or even the constructor on the Type. This would cause a trimmed application to behave differently than an untrimmed application.

I do not know of anyone who relies on this behavior, and there are no tests for it. So removing it seems like the best path forward.

Contributes to dotnet#1962
Redth pushed a commit that referenced this issue Mar 4, 2022
This behavior is not trim-compatible, since it just a random string "route name" and calls Type.GetType with it, and then Activator.CreateInstance. The trimmer might have removed the whole type, or even the constructor on the Type. This would cause a trimmed application to behave differently than an untrimmed application.

I do not know of anyone who relies on this behavior, and there are no tests for it. So removing it seems like the best path forward.

Contributes to #1962
@jonathanpeppers jonathanpeppers added this to the .NET 7 milestone Apr 21, 2022
@Redth Redth modified the milestones: .NET 7 + Servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Apr 12, 2023
@samhouts samhouts added the Task neither bug nor feature but something that needs to be done in support of either label Jul 31, 2023
@jonathanpeppers
Copy link
Member

Closing in favor of: #18658

@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2023
@Eilon Eilon added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with t/app-size Application Size / Trimming Task neither bug nor feature but something that needs to be done in support of either
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants