Skip to content

refactor!: Remove residual dead native-renderer feature flags - #23949

Merged
MartinZikmund merged 9 commits into
feature/breakingchangesfrom
dev/xygu/20260803/drop-feature-flags-2
Aug 4, 2026
Merged

MartinZikmund merged 9 commits into
feature/breakingchangesfrom
dev/xygu/20260803/drop-feature-flags-2

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: Part of #8339

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What changed? 🚀

Removes nine FeatureConfiguration flags that became dead code when the native UI
renderers (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:

Flag Gated path
UIElement.AssignDOMXamlName WASM DOM element naming
UIElement.FailOnNSObjectExtensionsValidateDispose deprecated UIKit disposal helper
UIElement.AssignDOMXamlProperties WASM DOM attribute mirroring
Interop.ForceJavascriptInterop legacy WASM eval interop
UIElement.RenderToStringWithId WASM DOM outerHTML dumps
TextBlock.IsMeasureCacheEnabled native text measure cache
TextBlock.IsJavaStringCachedEnabled / JavaStringCachedCapacity Android Java string cache
Image.LegacyIosAlignment UIKit ContentMode alignment
Shape.WasmDelayUpdateUntilFirstArrange / WasmCacheBBoxCalculationResult / WasmBBoxCacheSize WASM svg attribute deferral + getBBox cache

Four holder classes (Interop, UIElement, Shape, and the TextBlock members above)
empty out and go with their flags. build/PackageDiffIgnore.xml records every removed
member in the 6.6 ignore set, and migrating-to-uno-7.md lists the flags under the
existing "FeatureConfiguration flags removed" section.

Validation

Per debugging-discipline.md, labelled by evidence type. All local evidence is
Skia 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).

  • Code review: every flag was grepped for readers across src/ before deletion; each
    had zero remaining consumers.
  • Compile: Uno.UI.UnitTests, SamplesApp.Skia.Generic, and SamplesApp.UITests all
    build with 0 errors using -p:UnoTargetFrameworkOverride=net10.0 -p:UnoFastDevBuild=true
    (the first two also 0 warnings; SamplesApp.UITests emits 3 pre-existing MSB3277
    nunit.engine version-unification warnings). Note UnoFastDevBuild skips analyzers
    locally, so CI is the authority on code-style enforcement.
  • Runtime: dotnet test Uno.UI.UnitTests → 3981 passed, 13 failed, 23 skipped. The 13
    failures are all Windows_Globalization.When_Calendar and are pre-existing — they
    assert Calendar.Hour/Day from UTC DateTimeOffsets and shift by the machine's
    timezone offset. Verified against the base commit.
  • Runtime-test suites for the touched controls were run on the follow-up branch (see the
    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.
  • This branch has been rebased onto feature/breakingchanges at d16dc1200f; the only
    conflict was two independent additions to the same <Types> list in
    build/PackageDiffIgnore.xml (ours plus BC45's FeatureConfiguration/Control entry),
    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 ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — N/A, dead-code removal; existing suites re-run as regression coverage
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features) — migration guide updated
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

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 in
migrating-to-uno-7.md.

@github-actions github-actions Bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Aug 3, 2026
Xiaoy312 and others added 9 commits August 3, 2026 17:04
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]>
Copilot AI review requested due to automatic review settings August 3, 2026 21:10
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260803/drop-feature-flags-2 branch from 47f1da2 to b42923e Compare August 3, 2026 21:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 FeatureConfiguration members (and emptied holder types) tied to the former native-renderer paths.
  • Deleted the orphaned TextBlockMeasureCache implementation and its unit tests, plus related SamplesApp UI toggles.
  • Updated migration/docs and PackageDiffIgnore.xml to 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.

Comment thread src/Uno.UI/FeatureConfiguration.cs Resolved
@MartinZikmund
MartinZikmund enabled auto-merge August 4, 2026 12:05
@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 225659 found UI Test snapshots differences: skia-linux-screenshots: 74, skia-windows-screenshots: 294

Details
  • skia-linux-screenshots: 74 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • ImageBrushWithRotateTransform.png
    • Buttons.png
    • DoubleImageBrushInList.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Image_UseTargetSizeLate.png-dark
    • Image_UseTargetSizeLate.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • DropDownButtonPage.png-dark
    • DisplayInformation.png-dark
  • skia-windows-screenshots: 294 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AutoSuggestBox_BitmapIcon.png-dark
    • Basics.png-dark
    • BitmapIcon_Foreground.png-dark
    • BitmapIcon_Foreground.png
    • ButtonClippingTestsControl.png-dark
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • DisplayInformation.png-dark
    • DamageRegion_ShadowChildShape.png-dark
    • DamageRegion_ShadowChildShape.png
    • ElevatedView_Tester.png-dark
    • DropDownButtonPage.png-dark
    • EmailManagerTests.png-dark
    • ElevatedView_Dimensions.png-dark
    • ElevatedView_Tester.png
    • DropDownButtonPage.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 225659 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund merged commit 3297bbc into feature/breakingchanges Aug 4, 2026
66 checks passed
@MartinZikmund
MartinZikmund deleted the dev/xygu/20260803/drop-feature-flags-2 branch August 4, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants