Repository navigation
refactor!: Remove residual dead native-renderer feature flags - #23949
MartinZikmund merged 9 commits into
Conversation
The WASM DOM "xamlname"/"xuid"/"xamlautomationid" annotation this flag gated was removed with the DOM renderer; the flag had zero references. Co-Authored-By: Claude Opus 5 <[email protected]>
The NSObjectExtensions.ValidateDispose method this flag gated was already removed (BC47), leaving the flag and its doc section orphaned. Co-Authored-By: Claude Opus 5 <[email protected]>
The WASM DOM attribute annotation this flag gated was removed with the DOM renderer; the flag had zero references. Co-Authored-By: Claude Opus 5 <[email protected]>
The WASM eval-mode interop switch this flag selected no longer exists. The FeatureConfiguration.Interop holder is empty as a result and goes with it. Co-Authored-By: Claude Opus 5 <[email protected]>
The WASM UIElement.ToString() override this flag gated is gone, leaving the XAML generator as its only writer. The FeatureConfiguration.UIElement holder is empty as a result and goes with it. Co-Authored-By: Claude Opus 5 <[email protected]>
TextBlockMeasureCache was the sole reader of IsMeasureCacheEnabled and was itself referenced by nothing but its own unit tests, so the flag, the cache and those tests go together. Co-Authored-By: Claude Opus 5 <[email protected]>
The Android Java string-cache that IsJavaStringCachedEnabled toggled and JavaStringCachedCapacity sized was removed with the native renderer. Co-Authored-By: Claude Opus 5 <[email protected]>
The UIKit ContentMode-based image alignment path this flag selected was removed with the native renderer. Co-Authored-By: Claude Opus 5 <[email protected]>
The WASM svg-attribute deferral and getBBox cache these flags tuned were removed with the DOM renderer. The FeatureConfiguration.Shape holder is empty as a result and goes with it. Co-Authored-By: Claude Opus 5 <[email protected]>
47f1da2 to
b42923e
Compare
There was a problem hiding this comment.
Pull request overview
This PR continues the Uno Platform 7.0 cleanup by removing residual, now-dead FeatureConfiguration flags (and associated implementation/test code) that only applied to the retired native renderers (Android Views, UIKit, WASM DOM). It also updates migration/docs and package diff ignore lists to account for the removed public APIs.
Changes:
- Removed multiple public
FeatureConfigurationmembers (and emptied holder types) tied to the former native-renderer paths. - Deleted the orphaned
TextBlockMeasureCacheimplementation and its unit tests, plus related SamplesApp UI toggles. - Updated migration/docs and
PackageDiffIgnore.xmlto reflect the breaking API removals.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlockMeasureCache.MeasureSizeEntry.cs | Deleted orphaned TextBlock measure-cache helper type. |
| src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlockMeasureCache.MeasureKey.cs | Deleted orphaned TextBlock measure-cache key/comparer logic. |
| src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlockMeasureCache.MeasureEntry.cs | Deleted orphaned TextBlock measure-cache entry logic. |
| src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlockMeasureCache.cs | Deleted orphaned TextBlock measure-cache implementation and flag gate. |
| src/Uno.UI/FeatureConfiguration.cs | Removed dead native-renderer feature flags and emptied related holder classes. |
| src/Uno.UI.UnitTests/Windows_UI_XAML_Controls/TextBlockTests/Given_TextBlockMeasureCache.cs | Removed unit tests targeting the deleted measure-cache. |
| src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs | Removed WASM-only flag assignment for UIElement.RenderToStringWithId during generator init. |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/TextBlockControl/TextBlock_MeasurePeformance.xaml.cs | Removed WASM-only measure-cache toggle assignment. |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/TextBlockControl/TextBlock_MeasurePeformance.xaml | Removed UI for toggling the deleted measure-cache flag. |
| doc/articles/uno-development/debugging-inspect-visual-tree.md | Removed WASM DOM-annotation flag guidance (but still needs Web section alignment with Skia/canvas). |
| doc/articles/migrating-to-uno-7.md | Added/extended migration notes for removed flags/APIs. |
| doc/articles/feature-flags.md | Removed documentation for the deleted FailOnNSObjectExtensionsValidateDispose feature flag. |
| build/PackageDiffIgnore.xml | Recorded removed members/types/accessors for package diff baselining. |
Suppressed comments (1)
src/Uno.UI/FeatureConfiguration.cs:398
- The PR description references the issue as "Part of #8339", but the repo contribution guidelines require PRs to include a fully qualified issue link (e.g.
Related to https://github.com/unoplatform/uno/issues/8339) rather than a bare#reference. Please update the PR description footer accordingly.
public static class TextBlock
{
/// <summary>
/// On Skia targets, determines if the TextBlock should render whitespace characters.
/// There's usually no effect between toggling this flag on and off, but it can have
/// an effect when the font used to draw the TextBlock doesn't have a glyph for the
/// whitespace characters, in which case disabling this flag will prevent the TextBlock
/// from rendering the font's "replacement character" symbol (e.g. �) instead of just a white space.
/// </summary>
public static bool RenderWhiteSpace { get; set; }
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23949/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23949/docs/index.html |
|
The build 225659 found UI Test snapshots differences: Details
|
|
|
GitHub Issue: Part of #8339
PR Type:
🔄 Refactoring (no functional changes, no api changes)
What changed? 🚀
Removes nine
FeatureConfigurationflags that became dead code when the native UIrenderers (native Android Views, native iOS/UIKit, WASM DOM) were removed for 7.0. Each
flag gated a code path that no longer exists, so every one of these is a pure deletion —
no behavior is reachable from either setting.
One
refactor!:commit per flag, following the pattern established by #23600:UIElement.AssignDOMXamlNameUIElement.FailOnNSObjectExtensionsValidateDisposeUIElement.AssignDOMXamlPropertiesInterop.ForceJavascriptInteropevalinteropUIElement.RenderToStringWithIdouterHTMLdumpsTextBlock.IsMeasureCacheEnabledTextBlock.IsJavaStringCachedEnabled/JavaStringCachedCapacityImage.LegacyIosAlignmentContentModealignmentShape.WasmDelayUpdateUntilFirstArrange/WasmCacheBBoxCalculationResult/WasmBBoxCacheSizegetBBoxcacheFour holder classes (
Interop,UIElement,Shape, and theTextBlockmembers above)empty out and go with their flags.
build/PackageDiffIgnore.xmlrecords every removedmember in the
6.6ignore set, andmigrating-to-uno-7.mdlists the flags under theexisting "
FeatureConfigurationflags removed" section.Validation
Per
debugging-discipline.md, labelled by evidence type. All local evidence isSkia desktop, net10.0 — the Android/iOS/WASM TFMs are left to CI (no local Mac, and
the Android workload restore is broken on this machine).
src/before deletion; eachhad zero remaining consumers.
Uno.UI.UnitTests,SamplesApp.Skia.Generic, andSamplesApp.UITestsallbuild with 0 errors using
-p:UnoTargetFrameworkOverride=net10.0 -p:UnoFastDevBuild=true(the first two also 0 warnings;
SamplesApp.UITestsemits 3 pre-existingMSB3277nunit.engineversion-unification warnings). NoteUnoFastDevBuildskips analyzerslocally, so CI is the authority on code-style enforcement.
dotnet test Uno.UI.UnitTests→ 3981 passed, 13 failed, 23 skipped. The 13failures are all
Windows_Globalization.When_Calendarand are pre-existing — theyassert
Calendar.Hour/Dayfrom UTCDateTimeOffsets and shift by the machine'stimezone offset. Verified against the base commit.
stacked PR below), which contains these commits as its ancestry: 177 passed, 5 skipped,
1 failed, the failure being a pre-existing pixel-tolerance test verified to fail
identically on the base commit.
feature/breakingchangesatd16dc1200f; the onlyconflict was two independent additions to the same
<Types>list inbuild/PackageDiffIgnore.xml(ours plus BC45'sFeatureConfiguration/Controlentry),resolved by keeping both. All builds and tests above were re-run after the rebase.
Note
This is the first of two stacked PRs. The follow-up removes the native default-styles
system (
Style.UseUWPDefaultStyles,Generic.Native.xaml) and is based on this branch.PR Checklist ✅
Screenshots Compare Test Runresults.Breaking change impact and migration path
Every removed member is public API, so this is a breaking change — intentional, and
scoped to the 7.0 major. Impact is limited to code that sets one of these flags; because
each gated a native-renderer path that no longer exists, no runtime behavior changes for
either previous value.
Migration: delete the assignment. If a single codebase must target both pre-7.0 and
7.0, guard it with
#if. All nine are listed inmigrating-to-uno-7.md.