Skip to content

Remove src/Compatibility folder and obsolete legacy code #30228

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 25, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

This PR removes the entire src/Compatibility folder containing obsolete legacy code that is no longer built or tested, as requested in the issue.

What was removed

The following obsolete projects and code were completely removed:

  • Android.AppLinks - Legacy Android app links implementation
  • Core - Legacy compatibility core with test projects
  • Core.LegacyRenderers - Legacy renderer implementations
  • Maps - Legacy maps compatibility layer for multiple platforms
  • Material - Legacy Material Design compatibility renderers

Essential files preserved

Before removal, essential resource files that were still being used by the main codebase were migrated to appropriate locations:

  • Android layout files: Moved flyoutcontent.axml and shellcontent.axml from src/Compatibility/Core/src/Android/Resources/layout/ to src/Controls/src/Core/Platforms/Android/Resources/layout/
  • iOS localization resources: Moved all StringResources.* files from src/Compatibility/Core/src/iOS/Resources/ to src/Controls/src/Core/Platforms/iOS/Resources/

Additional cleanup

  • Removed all Compatibility project references from solution files (.sln, .slnf)
  • Removed conditional Compatibility project references from sample and test projects
  • Removed Compatibility package references where they existed
  • Cleaned up InternalsVisibleTo attributes referencing removed Compatibility assemblies
  • Removed unused using statements for Compatibility namespaces

Verification

  • Verified that Controls.Core and Core.UnitTests projects build successfully after all changes
  • Confirmed that essential functionality is preserved through resource file migration
  • Ensured no breaking changes to the public API surface

This cleanup removes a significant amount of obsolete code (~2,700+ files) while preserving all essential functionality currently in use.

Fixes #30227.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Remove the src/Compatibility folder Remove src/Compatibility folder and obsolete legacy code Jun 25, 2025
@Copilot Copilot AI requested a review from mattleibow June 25, 2025 23:06
Copilot finished work on behalf of mattleibow June 25, 2025 23:06
@mattleibow
Copy link
Member

mattleibow commented Jun 26, 2025

There is a Microsoft.Maui.Controls.Hosting.CompatibilityCheck.UseCompatibility that will exist in the Controls code, but can never run since there is no way to enable it.

https://github.com/search?q=repo%3Adotnet%2Fmaui%20CompatibilityCheck&type=code

It was used here:

image

Copilot finished work on behalf of mattleibow June 26, 2025 00:21
@MartyIX
Copy link
Contributor

MartyIX commented Jun 26, 2025

Is this PR supposed to target main or net10.0? main is targeted now.

@mattleibow
Copy link
Member

net10.0 but ai only works on main. So hopefully I can just rebase or something.

@rmarinho
Copy link
Member

/azp run MAUI-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow
Copy link
Member

/azp run MAUI-DeviceTests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the src/Compatibility folder
4 participants