Skip to content

refactor!: Remove redundant Vector2Extensions (BC72) - #23686

Merged
Xiaoy312 merged 2 commits into
feature/breakingchangesfrom
dev/xygu/20260708/bc72-remove-vector2extensions
Jul 9, 2026
Merged

Xiaoy312 merged 2 commits into
feature/breakingchangesfrom
dev/xygu/20260708/bc72-remove-vector2extensions

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Jul 8, 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 BC72 from breaking-changes Phase 3 (#8339): deletes the redundant public class Uno.Extensions.Vector2Extensions (in Uno.UWP), leaving the functionally identical System.Numerics.VectorExtensions (in Uno.Foundation) as the single Vector2↔Point/Size conversion helper.

  • Removes src/Uno.UWP/Extensions/Vector2Extensions.cs in full. It was a public static class in namespace Uno.Extensions exposing ToPoint/ToVector2/ToSize extension methods. The surviving System.Numerics.VectorExtensions — the WinAppSDK-ref counterpart, carrying the header comment "Please do not remove it as third-parties may depend on it" — declares the same signatures, so extension-method callers (v.ToPoint(), p.ToVector2(), …) keep resolving transparently. Only code referencing the type by name (Uno.Extensions.Vector2Extensions.ToPoint(v)) breaks, which a typical app essentially never does.
  • Adds the missing using System.Numerics; to InputPane.skia.cs, which imported Uno.Extensions (but not System.Numerics) and was silently binding ActualSize.ToSize() — a call on a Vector2 — to the removed class. This was the only in-repo consumer that resolved through Vector2Extensions; a repo-wide build/sweep confirms it is the sole break.
  • build/PackageDiffIgnore.xml: registers the public-type removal under the 6.5 baseVersion set (matching the BC44/BC32 removals on this branch) so CI's PackageDiff does not flag it, and drops the two stale 4.10-baseline method entries that referenced an outdated ToVector/ToPoint(v) signature no longer matching the file.
  • Checks the BC72 box in specs/050-breaking-changes-rollup/spec.md.

No runtime behavior changes. The removed methods have byte-for-byte-identical implementations in the surviving VectorExtensions, so every reachable call site computes the same result; only the duplicate type name disappears from the public API.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — N/A: pure dead-code deletion with an identical surviving replacement; there is no behavior to exercise.
  • 📚 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

  • Uno.Extensions.Vector2Extensions (BC72): the public type is removed. Migration: none needed for the common case — the identical ToPoint/ToVector2/ToSize extension methods survive on System.Numerics.VectorExtensions, so any call using extension-method syntax keeps compiling as long as System.Numerics is in scope (which it already is wherever Vector2 is named). The only affected code is anything that references the named type directly (e.g. Uno.Extensions.Vector2Extensions.ToPoint(v)); replace such references with System.Numerics.VectorExtensions or plain extension-method syntax.

Validation evidence

  • Code review: repo-wide grep for the type name Vector2Extensions returns only the deleted file, the (now-updated) build/PackageDiffIgnore.xml entries, and the spec — zero fully-qualified consumers. All 9 .ToVector2( callers import System.Numerics. A sweep for .ToPoint(/.ToSize(/.ToVector2( in files lacking using System.Numerics; surfaced exactly one real binder — InputPane.skia.cs (fixed here) — plus one false positive (LottieVisualSource.Skottie.cs, whose .ToSize() is on SKSize via SkiaExtensions). No native-suffixed (.Android/.iOS/.UIKit/.wasm.cs) file consumes these methods.
  • Compile: src/Uno.UI/Uno.UI.Skia.csproj (net10.0) — the assembly holding the consumers (GestureRecognizer, SwipeControl, the gradient/geometry .skia.cs files) plus its Uno.UI.Composition dependency (CompositionPathGeometry) — builds clean after the fix: 0 warnings, 0 errors.
  • Not validated locally (CI-gated): the PackageDiff allow-list check runs CI-only; the new 6.5-set ignore entry is what keeps the removed-type check green. The full Uno.UI-Skia-only.slnf build is currently blocked by a pre-existing NU1015 restore error (missing Xamarin.AndroidX.AppCompat version) in Uno.UI.Runtime.Skia.Android, unrelated to this change; native heads were not built locally.

@github-actions github-actions Bot added area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Jul 8, 2026
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221343 found UI Test snapshots differences: skia-linux-screenshots: 0, skia-windows-screenshots: 86

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

  • skia-windows-screenshots: 86 changed over 2366

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

Xiaoy312 and others added 2 commits July 9, 2026 10:50
Delete the duplicate public Uno.Extensions.Vector2Extensions from Uno.UWP.
The identical System.Numerics.VectorExtensions (Uno.Foundation, the
WinAppSDK-ref counterpart marked "do not remove") remains the single
Vector2<->Point/Size conversion helper, so extension-method callers are
unaffected; only direct references to the named type break.

Add the missing System.Numerics import to InputPane.skia.cs, which was
silently binding .ToSize() to the removed class.

PackageDiffIgnore: register the public-type removal under the 6.5
baseVersion set (matching the BC44/BC32 removals) so CI's PackageDiff
does not flag it, and drop the two stale 4.10-baseline method entries
(outdated ToVector/ToPoint(v) signatures that no longer match the file).

Part of breaking-changes epic #8339.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Xiaoy312
Xiaoy312 enabled auto-merge July 9, 2026 14:57
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260708/bc72-remove-vector2extensions branch from 840fc4c to 8137248 Compare July 9, 2026 14:57
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221521 found UI Test snapshots differences: skia-linux-screenshots: 72, skia-windows-screenshots: 77

Details
  • skia-linux-screenshots: 72 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png
    • ContextRequested.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • DropDownButtonPage.png-dark
    • DoubleImageBrushInList.png-dark
    • ElementLevelTheme.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png
    • EllipsemaskingEllipseGrid.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Image_AnimatedWebP.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • Image_Margin_Large.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ContentControl_Inheritance.png
    • DisplayInformation.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 77 changed over 2368

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

@Xiaoy312
Xiaoy312 merged commit 8e78650 into feature/breakingchanges Jul 9, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260708/bc72-remove-vector2extensions branch July 9, 2026 18:12
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/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants