Skip to content

Internalize/remove MessagingCenter#27842

Merged
jfversluis merged 2 commits intonet10.0from
net10-internalize-messagingcenter
Feb 18, 2025
Merged

Internalize/remove MessagingCenter#27842
jfversluis merged 2 commits intonet10.0from
net10-internalize-messagingcenter

Conversation

@jfversluis
Copy link
Member

@jfversluis jfversluis commented Feb 17, 2025

Description of Change

Our MessagingCenter API has been obsoleted since .NET 7 and should be (removed for the outside world). This PR makes the APIs internal so that our code can still use it, but for the outside world it seems like it has been removed.

We recommend using the WeakReferenceMessenger from the MVVM Toolkit for better performance. For more information, see: https://www.nuget.org/packages/CommunityToolkit.Mvvm

Alternatively, there is this project which might serve as inspiration on how to make the transition in your code easier: https://github.com/jfversluis/Plugin.Maui.MessagingCenter

Also see: #16798

Public API Changes

  • public interface IMessagingCenter -> internal interface IMessagingCenter
  • public class MessagingCenter : IMessagingCenter -> internal class MessagingCenter : IMessagingCenter

Issues Fixed

Fixes #16813

@jfversluis jfversluis added t/breaking 💥 area-architecture Issues with code structure, SDK structure, implementation details labels Feb 17, 2025
@jfversluis jfversluis added this to the .NET 10.0-preview2 milestone Feb 17, 2025
Copilot AI review requested due to automatic review settings February 17, 2025 12:44
@jfversluis jfversluis requested a review from a team as a code owner February 17, 2025 12:44
@jfversluis jfversluis requested review from PureWeen and tj-devel709 and removed request for a team February 17, 2025 12:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt: Language not supported
Comments suppressed due to low confidence (1)

src/Controls/src/Core/Properties/AssemblyInfo.cs:7

  • Removing InternalsVisibleTo for Microsoft.Maui.Controls.Compatibility.* assemblies might impact other assemblies that depend on these internals. Ensure that this change is intentional and documented.
[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Compatibility.ControlGallery")]

@dotnet-policy-service
Copy link
Contributor

🚨 API change(s) detected @davidbritch FYI

@jfversluis
Copy link
Member Author

jfversluis commented Feb 17, 2025

/azp run

@azure-pipelines

This comment was marked as off-topic.

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@jfversluis
Copy link
Member Author

jfversluis commented Feb 18, 2025

@jfversluis jfversluis merged commit 7256a77 into net10.0 Feb 18, 2025
6 checks passed
@jfversluis jfversluis deleted the net10-internalize-messagingcenter branch February 18, 2025 18:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-architecture Issues with code structure, SDK structure, implementation details t/breaking 💥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants