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

[BUG] Microsoft.Maui.Controls.Compatibility dependency #2005

Closed
2 tasks done
filipnavara opened this issue Jul 8, 2024 · 3 comments
Closed
2 tasks done

[BUG] Microsoft.Maui.Controls.Compatibility dependency #2005

filipnavara opened this issue Jul 8, 2024 · 3 comments
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit bug Something isn't working

Comments

@filipnavara
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

CommunityToolkit.Maui has a transitive dependency to Microsoft.Maui.Controls.Compatibility NuGet package. It means that consumers of CommunityToolkit.Maui now get the reference whether they want it or not.

Cursory test seems to show that there's very little code depending on the compatibility package (IVisualNativeElementRenderer usage in TouchBehavior.macios.cs) and Color.ToAndroid() extension method. The ToAndroid method usage can be replaced with ToPlatform extension method in the base MAUI package. Usage of IVisualNativeElementRenderer may be a bit more difficult to get rid of but probably solvable by getting rid of that compatibility kludge, using reflection, or rewriting it to detect the situation from the view hierarchy.

Expected Behavior

No dependency on Microsoft.Maui.Controls.Compatibility.

Steps To Reproduce

  1. Add CommunityToolkit.Maui NuGet dependency.
  2. Observe that Microsoft.Maui.Controls.Compatibility gets transitively included.

Link to public reproduction project repository

Environment

- .NET MAUI CommunityToolkit: 9.0.0
- OS: Android, iOS
- .NET MAUI: 8.0.61

Anything else?

No response

@BaY1251
Copy link
Contributor

BaY1251 commented Jul 11, 2024

Great

@vhugogarcia vhugogarcia added the area/core Issue/Discussion/PR that has to do with the core of the toolkit label Jul 21, 2024
@GeorgeLeithead
Copy link
Contributor

@vhugogarcia @brminnick I believe that this has already been merged into main and released, and as such i think this can be closed?

@brminnick
Copy link
Collaborator

Thanks George! Yup - this is completed via #2006

@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/core Issue/Discussion/PR that has to do with the core of the toolkit bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants