Skip to content

refactor(binding)!: Remove no-op Clear/RestoreBindings (BC49) - #23674

Merged
Xiaoy312 merged 2 commits into
feature/breakingchangesfrom
dev/xygu/20260707/bc49-remove-restore-clear-bindings
Jul 9, 2026
Merged

Xiaoy312 merged 2 commits into
feature/breakingchangesfrom
dev/xygu/20260707/bc49-remove-restore-clear-bindings

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

PR Type:

🔄 Refactoring (no functional changes, no api changes)

⚠️ Contains a breaking change (refactor!) — removes public API. See the breaking-changes section below.

What changed? 🚀

Implements BC49 from breaking-changes Phase 3 (#8339, tracked publicly as #13046): removes the empty no-op RestoreBindings() / ClearBindings() methods that were surfaced on every DependencyObject.

  • Deletes the empty DependencyObjectStore.ClearBindings() / RestoreBindings() methods from DependencyObjectStore.Binder.cs.
  • Stops DependencyObjectGenerator emitting the matching public [EditorBrowsable(Never)] wrappers on every DependencyObject. They existed only "for binary compatibility" and merely forwarded to the now-deleted store methods.
  • Updates the DependencyObjectGenerator golden test to match the regenerated output.
  • Registers the removal in build/PackageDiffIgnore.xml (6.5 set) with a regex over every declaring type, since the wrappers were generated per-type.

The native SyncBinder caller that once used ClearBindings() is already gone with the native-rendering drop, and a repo-wide search finds no other callers.

On default settings runtime behavior is unchanged — both methods had empty bodies, so nothing observable happened even when they were (rarely) called.

PR Checklist ✅

  • 🧪 Given_DependencyObjectGenerator generator tests pass (2/2) — the golden reflects the regenerated output exactly.
  • 📚 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

  • ClearBindings() / RestoreBindings() (BC49): the public no-op ClearBindings() / RestoreBindings() methods emitted on every DependencyObject are removed. Both were empty [EditorBrowsable(Never)] shims kept only for binary compatibility. This is a binary break, and a source break only for the rare consumer that explicitly called these do-nothing methods. Migration: remove the call — it never did anything.

Validation evidence

  • Runtime (unit tests): Given_DependencyObjectGenerator — 2 passed / 0 failed (validates the generator change and the golden byte-for-byte).
  • Compile: Uno.UI.Skia (net10.0) builds clean — 0 warnings, 0 errors — regenerating every DependencyObject mixin without the wrappers.
  • Not validated locally (CI-gated): native heads (iOS/Android) were not built locally; the change is in shared code and a repo-wide grep found zero remaining references to the removed identifiers. 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 labels Jul 7, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221141 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 79

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

  • skia-windows-screenshots: 79 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Focus_FocusVisual_Properties.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ColorPickerSample.png
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Image_UseTargetSize.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260707/bc49-remove-restore-clear-bindings branch from fb67d83 to 858ec26 Compare July 8, 2026 15:49
Xiaoy312 and others added 2 commits July 8, 2026 13:31
DependencyObjectStore.ClearBindings()/RestoreBindings() were empty
no-ops, and the DependencyObject class exposed matching public
[EditorBrowsable(Never)] wrappers purely "for binary compatibility".
Nothing in the framework calls them, and the native SyncBinder caller
that once used ClearBindings() is already gone with the native
rendering drop.

Delete the store methods and their public wrappers on DependencyObject.
The resulting binary break is already covered by the existing
"DependencyObject as class" regex entries in PackageDiffIgnore.xml,
which match ClearBindings()/RestoreBindings() on every declaring type,
so the package-diff gate still passes.

Part of #2125 (Phase 3 breaking changes). References #13046.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260707/bc49-remove-restore-clear-bindings branch from 858ec26 to 2dcd103 Compare July 8, 2026 17:31
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221348 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 76

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

  • skia-windows-screenshots: 76 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Gamepad_Enumeration.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Image_UseTargetSize.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Buttons.png-dark
    • Buttons.png

@mergify

mergify Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Xiaoy312
Xiaoy312 merged commit 5951077 into feature/breakingchanges Jul 9, 2026
50 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260707/bc49-remove-restore-clear-bindings branch July 9, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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