Skip to content

refactor!: Remove Setter pipeline legacy/shim code (BC37, BC44, BC63) - #23595

Merged
Xiaoy312 merged 4 commits into
feature/breakingchangesfrom
dev/xygu/20260629/setter-cleanup
Jul 7, 2026
Merged

Xiaoy312 merged 4 commits into
feature/breakingchangesfrom
dev/xygu/20260629/setter-cleanup

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: https://github.com/unoplatform/uno-private/issues/2125

PR Type:

✨ Feature

⚠️ Contains breaking changes (feat!) — see the breaking-changes section below.

What changed? 🚀

Implements the Setter-pipeline trio from breaking-changes Phase 3 (#8339), landed adjacently in the required order BC37 → BC44 → BC63. On default settings runtime behavior is unchanged — these remove Uno-only scaffolding (a legacy codegen fallback, a non-WinUI generic type, and the binary-compat shim it forced) with no WinUI counterpart.

  • BC37 — Remove non-DP Setter codegen fallback. Drops the XAML source-generator branch that emitted a Setter<T> for Style <Setter Property="X"> entries targeting a plain CLR (non-DependencyProperty) property. Such setters now flow through the normal path and fail generation with a clear "X is not a DependencyProperty" error, matching WinUI which never allowed non-DP setter targets. The one in-repo consumer — ComboBox.IsPopupFullscreen (used by an iOS sample style) — is converted to a generated DependencyProperty so the setter stays valid on every target.
  • BC44 — Remove Setter<T>. Deletes the public Uno-only generic Microsoft.UI.Xaml.Setter<T> and its ICSharpPropertySetter marker interface (neither exist in WinUI). Cascade enabled by the removal: drops the ICSharpPropertySetter branch in Style.EnumerateSetters and the now-pointless DependencyObject parameter from SetterBase.TryGetSetterValue / Setter.TryGetSetterValue / Style.TryGetPropertyValue (+ its two .mux.cs callers). C# callers (unit tests, Pivot docs) migrate to new Setter(DP, value).
  • BC63 — Remove SetterBase.set_Property shim. Removes the [EditorBrowsable(Never)] binary-compat shim and the now-orphaned OnStringPropertyChanged virtual it delegated to — both existed solely for Setter<T>.

Public-API removals (the Setter<T> type and SetterBase.set_Property) are registered in build/PackageDiffIgnore.xml (6.6 set, matching the baseline already used for this branch's breaking-change entries).

PR Checklist ✅

  • 🧪 Migrated the affected unit tests (Given_ItemsControl, Given_ComboBox) to the non-generic Setter; full Setter/Style/VisualState unit-test slice passes (65 passed / 1 skipped / 0 failed).
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

Breaking changes & migration

  • Non-DP Style setter (BC37): a Style <Setter Property="X"> whose X is a plain CLR property (not a DependencyProperty) no longer compiles — it now produces a XAML generation error. Migration: make X a DependencyProperty.
  • Setter<T> (BC44): the Uno-only new Setter<TTarget>("Prop", t => t.Prop = value) code-styling API is removed. Migration: use new Setter(TTarget.PropProperty, value).
  • SetterBase.set_Property (BC63): removal of an EditorBrowsable(Never) binary-compat shim; no source callers exist (binary-compat break only).

Validation evidence

  • Compile (Skia): Uno.UI.Skia builds clean (0 warnings) after each commit; SamplesApp.Skia.Generic builds clean after BC37.
  • Runtime (unit tests): Setter/Style/VisualState/ItemsControl/ComboBox slice — 65 passed / 1 skipped / 0 failed (via Uno.UI-UnitTests-only.slnf).
  • Not validated locally (CI-gated): native heads (iOS/Android) were not built locally — BC37's only known native consumer is de-risked by the DP conversion, but other non-DP setters in native-only XAML can only surface in CI; the PackageDiff allow-list runs CI-only.

@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 Jun 29, 2026
@Xiaoy312 Xiaoy312 changed the title feat!: Remove Setter pipeline legacy/shim code (BC37, BC44, BC63) refactor!: Remove Setter pipeline legacy/shim code (BC37, BC44, BC63) Jun 29, 2026
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from 917ebd9 to 338184a Compare June 29, 2026 16:35
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220145 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220180 did not find any UI Test snapshots differences.

@unodevops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from f61fa77 to a49b332 Compare July 6, 2026 15:34
@Xiaoy312 Xiaoy312 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2026
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from a49b332 to 7044519 Compare July 6, 2026 15:43
@Xiaoy312 Xiaoy312 removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2026
@Xiaoy312
Xiaoy312 enabled auto-merge July 6, 2026 15:43
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220868 did not find any UI Test snapshots differences.

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from 7044519 to 45e128e Compare July 6, 2026 21:32
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 220956 did not find any UI Test snapshots differences.

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from 45e128e to 54b12a5 Compare July 7, 2026 16:14
Xiaoy312 and others added 4 commits July 7, 2026 14:43
Drop the XAML source-generator fallback that emitted a `Setter<T>` for
Style `<Setter Property="X">` entries targeting a plain CLR (non-DP)
property. Such setters now resolve through the normal path and fail
generation with a clear "X is not a DependencyProperty" error, matching
WinUI which never allowed non-DP setter targets.

Convert ComboBox.IsPopupFullscreen (the one in-repo consumer of the
fallback, via an iOS sample style) to a generated DependencyProperty so
the setter remains valid on every target.

Part of breaking-changes Phase 3 (#8339).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Remove the public Uno-only generic `Microsoft.UI.Xaml.Setter<T>` and its
`ICSharpPropertySetter` marker interface, neither of which exist in WinUI.
With its only XAML producer gone (BC37), the type has no remaining users.

Cascade enabled by the removal:
- drop the `ICSharpPropertySetter` branch in `Style.EnumerateSetters`;
- drop the now-pointless `DependencyObject` parameter from
  `SetterBase.TryGetSetterValue` / `Setter.TryGetSetterValue` /
  `Style.TryGetPropertyValue` and its two `.mux.cs` callers.

Migrate the C# callers (unit tests, Pivot docs) to `new Setter(DP, value)`.
The ItemsControl container-style tests previously relied on `Setter<T>`'s
type-guarded no-op behaviour on their ContentPresenter containers; their
`BuildBasicContainerStyle` is now an empty style (a real `Control.Template`
setter is invalid there), preserving the asserted behaviour.

Register the public type removal in build/PackageDiffIgnore.xml.

Part of breaking-changes Phase 3 (#8339).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Remove the `[EditorBrowsable(Never)]` `SetterBase.set_Property(string)`
binary-compat shim and the now-orphaned `OnStringPropertyChanged` virtual
it delegated to. Both existed solely for the removed `Setter<T>` (BC44),
so with that type gone they have no remaining purpose or source callers.

Register the public method removal in build/PackageDiffIgnore.xml.

Part of breaking-changes Phase 3 (#8339).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/setter-cleanup branch from 1b19308 to 8143a8e Compare July 7, 2026 19:05
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221155 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 83

Details
  • skia-linux-screenshots: 0 changed over 2366

  • skia-windows-screenshots: 83 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png
    • Accessibility_ScreenReader.png-dark
    • ColorPickerSample.png
    • CompositionPath.png
    • EllipseAlignment2542_2547.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Image_UseTargetSize.png
    • Image_AnimatedWebP.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • ClipboardTests.png-dark
    • ElementLevelTheme.png-dark
    • ContextRequested.png-dark

@Xiaoy312
Xiaoy312 merged commit 483fb6d into feature/breakingchanges Jul 7, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260629/setter-cleanup branch July 7, 2026 22:30
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.

4 participants