Skip to content

Make internal types used by MAUI Toolkit public #29443

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

jfversluis
Copy link
Member

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!

Description of Change

Earlier attempt: #28994 then reverted in: #29321

We still want this change, but we need to take into account the timing. After the first merge, our tests would break and people were not able to use .NET 10 previews with the .NET MAUI Community Toolkit as there is no compatible Toolkit version yet.

Now I'm breaking up this change:

  1. Make the types we need for the Toolkit public, which is this PR
  2. Then remove InternalsVisibleTo after we have released .NET 10 and there is a compatible Toolkit version, this can be done in a service release since removing InternalsVisibleTo is not a breaking change.

Issues Fixed

Fixes #28981

@jfversluis jfversluis added this to the .NET 10.0-preview5 milestone May 12, 2025
@Copilot Copilot AI review requested due to automatic review settings May 12, 2025 11:48
@jfversluis jfversluis added t/breaking 💥 area-architecture Issues with code structure, SDK structure, implementation details labels May 12, 2025
@jfversluis jfversluis requested a review from a team as a code owner May 12, 2025 11:48
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR exposes several interfaces previously marked as internal (ICornerElement, ILineHeightElement, ITextAlignmentElement, and ITextElement) so that they can be publicly used by the MAUI Toolkit. The changes include adding new public API declarations across multiple platform-specific PublicAPI.Unshipped.txt files and updating corresponding source files with XML documentation.

Reviewed Changes

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

Show a summary per file
File Description
src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt Added public declarations for new interface members.
src/Controls/src/Core/ITextElement.cs Changed ITextElement to public and added detailed XML documentation.
src/Controls/src/Core/ITextAlignmentElement.cs Changed ITextAlignmentElement to public with extended XML documentation.
src/Controls/src/Core/ILineHeightElementInternal.cs Retained obsolete internal interface for backward compatibility.
src/Controls/src/Core/ILineHeightElement.cs Changed ILineHeightElement to public and improved XML documentation.
src/Controls/src/Core/ICornerElement.cs Changed ICornerElement to public with added XML documentation.
Comments suppressed due to low confidence (3)

src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt:49

  • [nitpick] The use of the '~' prefix for ITextElement methods may be confusing since it is not a common convention for public API members. Consider clarifying the intention or renaming these members to align with other public APIs.
+~Microsoft.Maui.Controls.ITextElement.OnTextColorPropertyChanged(Microsoft.Maui.Graphics.Color oldValue, Microsoft.Maui.Graphics.Color newValue) -> void

src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt:26

  • Verify that tests in TestCases.HostApp and TestCases.Shared.Tests are updated to cover the new public API members (e.g., ICornerElement, ILineHeightElement, ITextAlignmentElement, and ITextElement) to ensure proper integration and behavior.
+Microsoft.Maui.Controls.ICornerElement

src/Controls/src/Core/ITextElement.cs:13

  • Ensure that the public XML documentation in the /docs/ folder is updated to include the newly public ITextElement interface and its members, reflecting the intended behavior and usage.
public interface ITextElement

using System;
using System.ComponentModel;

namespace Microsoft.Maui.Controls.Internals
Copy link
Member Author

Choose a reason for hiding this comment

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

I have duplicated this one. I wanted to get rid of the "Internals" in the namespace, but since we need to provide a transition path, we want to keep the one that is available right now, and provide the new public one in the new namespace.

Once we remove InternalsVisibleTo we can remove this one as well. I will make sure to note that in the issue to track this.

@github-project-automation github-project-automation bot moved this from Todo to Approved in MAUI SDK Ongoing May 12, 2025
@PureWeen PureWeen merged commit 18ef903 into net10.0 May 13, 2025
126 of 128 checks passed
@PureWeen PureWeen deleted the net10-toolkit-types-public branch May 13, 2025 14:23
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-architecture Issues with code structure, SDK structure, implementation details t/breaking 💥
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants