-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Obsolete TextType.Html for .NET 10
#29685
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
Conversation
|
🚨 API change(s) detected @davidbritch FYI |
|
🚨 API change(s) detected @davidortinau @rachelkang FYI |
There was a problem hiding this 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 marks the TextType.Html enum member as obsolete and suppresses the resulting compiler warnings across the codebase.
- Adds
[Obsolete]attribute toTextType.HtmlinTextType.cs - Wraps usages of
TextType.Htmlin#pragma warning disable/restoreto keep builds warning-free - Updates various test and platform extension files to suppress CS0612 warnings
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/tests/DeviceTests/Handlers/Label/LabelHandlerTests.cs | Suppress obsolete warning in handler test |
| src/Core/src/Primitives/TextType.cs | Mark TextType.Html as obsolete |
| src/Controls/tests/TestCases.HostApp/Issues/XFIssue/LabelTextType.cs | Suppress obsolete warning in HostApp test |
| src/Controls/tests/TestCases.HostApp/Issues/Issue8870.cs | Suppress obsolete warning in HostApp test |
| src/Controls/tests/TestCases.HostApp/Issues/Issue21711.cs | Suppress obsolete warning in HostApp test |
| src/Controls/tests/TestCases.HostApp/Issues/CarouselViewSetOrientation.cs | Suppress obsolete warning in HostApp test |
| src/Controls/tests/TestCases.HostApp/Elements/LabelCoreGalleryPage.cs | Suppress obsolete warning in gallery page |
| src/Controls/tests/DeviceTests/Elements/Label/LabelTests.iOS.cs | Suppress obsolete warning in iOS device test |
| src/Controls/tests/DeviceTests/Elements/Label/LabelTests.cs | Suppress obsolete warning in device test |
| src/Controls/tests/DeviceTests/Elements/Label/LabelTests.Android.cs | Suppress obsolete warning in Android device test |
| src/Controls/src/Core/Platform/iOS/Extensions/LabelExtensions.cs | Suppress obsolete warning in iOS extension |
| src/Controls/src/Core/Platform/iOS/Extensions/FormattedStringExtensions.cs | Suppress obsolete warning in formatted-string extension |
| src/Controls/src/Core/Platform/Android/Extensions/TextViewExtensions.cs | Suppress obsolete warning in Android extension |
| src/Controls/src/Core/Label/Label.iOS.cs | Suppress obsolete warning in iOS mapper |
| { | ||
| var label = new LabelStub() | ||
| { | ||
| #pragma warning disable CS0612 // Type or member is obsolete |
Copilot
AI
May 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The inline #pragma warning directives add clutter to test code; consider using a global suppression file (e.g., GlobalSuppressions.cs) to clean up repeated suppressions.
|
I would also obsolete the TextType. We probably can use some converter for the HTML to FormattedString or Markdown to FormattedString. This could live in the MCT. |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending changes in LabelExtensions:
C:\a\_work\1\s\src\Compatibility\Core\src\iOS\Extensions\LabelExtensions.cs(28,28): error CS0612: 'TextType.Html' is obsolete [C:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net10.0-maccatalyst18.4]
C:\a\_work\1\s\src\Controls\src\Core\Platform\Windows\Extensions\TextBlockExtensions.cs(29,10): error CS0612: 'TextType.Html' is obsolete [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Compatibility\Core\src\iOS\Extensions\LabelExtensions.cs(28,28): error CS0612: 'TextType.Html' is obsolete [C:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net10.0-ios18.4]
C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.7.250401001\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets(845,9): error MSB3073: The command ""C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.7.250401001\buildTransitive\..\tools\net6.0\..\net472\XamlCompiler.exe" "C:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net10.0-windows10.0.19041.0\\input.json" "C:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net10.0-windows10.0.19041.0\\output.json"" exited with code 1. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Controls\src\Core\Platform\Windows\Extensions\TextBlockExtensions.cs(29,10): error CS0612: 'TextType.Html' is obsolete [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-windows10.0.20348.0]
C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.7.250401001\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets(845,9): error MSB3073: The command ""C:\Users\cloudtest\.nuget\packages\microsoft.windowsappsdk\1.7.250401001\buildTransitive\..\tools\net6.0\..\net472\XamlCompiler.exe" "C:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net10.0-windows10.0.20348.0\\input.json" "C:\a\_work\1\s\artifacts\obj\Controls.Core\Release\net10.0-windows10.0.20348.0\\output.json"" exited with code 1. [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net10.0-windows10.0.20348.0]
6 Error(s)
c4825d7 to
0eda463
Compare
|
@jfversluis can you review through a set of open issues and determine out many of them can be solved by WebView and get a sense of how disruptive this might be. |
|
Lets do this at a later stage |
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
Obsoleteattribute to theTextType.Htmlproperty in theLabelclass to mark it as obsolete.The HTML text type is a headache. Different platforms support different things, and its not very stable across all platforms. If (note: if) we would want to keep this, I would want to move this into its own control and not combine it with the regular
Label. Or we might just get rid of this entirely.Q: Should we then also obsolete the
Label.TextTypeproperty? Since it has no use if we remove the HTML option.(Mostly a proposal at this point, but might become a real thing...)