Skip to content

refactor!: Remove EventsBubblingInManagedCode DP (BC04) - #23597

Merged
Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260629/bc04-events-bubbling-managed-code
Jul 7, 2026
Merged

Xiaoy312 merged 1 commit into
feature/breakingchangesfrom
dev/xygu/20260629/bc04-events-bubbling-managed-code

Conversation

@Xiaoy312

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 BC04 from breaking-changes Phase 3 (#8339): removes the public Uno-only UIElement.EventsBubblingInManagedCode dependency property — a native-bubbling knob with no WinUI counterpart that let apps force specific routed events to bubble in managed code on the native targets.

  • Removes the static EventsBubblingInManagedCodeProperty, the instance EventsBubblingInManagedCode accessor, and the CoerceRoutedEventFlag coerce callback from UIElement.RoutedEvents.cs.
  • Simplifies the sole consumer to IsBubblingInManagedCode(args) => args is null || !args.CanBubbleNatively (the routedEvent parameter is no longer needed).
  • Keeps the native-bubbling plumbing (CanBubbleNatively) intact so the native heads keep behaving as-is.
  • Removes the one unit test that exercised the removed override, and trims the doc prose for the removed knob (the flowchart, the numbered flow steps, and the "Limitations of … bubbling" sections stay — they describe the still-present CanBubbleNatively mechanism).
  • Registers the public-API removal in build/PackageDiffIgnore.xml (6.6 set, matching the baseline already used for this branch's breaking-change entries).

On default settings runtime behavior is unchanged. The property defaulted to RoutedEventFlag.None, so None.HasFlag(realFlag) was already false and IsBubblingInManagedCode deferred to native bubbling whenever CanBubbleNatively. The simplified helper returns false in exactly that same case — only the app-settable override is gone.

PR Checklist ✅

  • 🧪 The affected unit test slice (Given_TappedRoutedEvent) passes — 10 passed / 0 failed, including the 3 surviving CanBubbleNatively=true scenarios that prove the default path is intact.
  • 📚 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

  • EventsBubblingInManagedCode (BC04): the public UIElement.EventsBubblingInManagedCode DP (and EventsBubblingInManagedCodeProperty) is removed. It only had an effect on the native targets (native Android Views, iOS/UIKit, WASM DOM) for forcing native-originated routed events to bubble in managed code; on Skia it was already a no-op. Migration: there is no replacement — the default behavior (native bubbling when the platform supports it, otherwise managed bubbling) is preserved automatically. Apps that set the property purely to influence native interop should remove the assignment.

Validation evidence

  • Compile: Uno.UI.UnitTests (Uno.UI Reference flavor) builds clean — 0 warnings, 0 errors.
  • Runtime (unit tests): Given_TappedRoutedEvent — 10 passed / 0 failed.
  • Not validated locally (CI-gated): native heads (iOS/Android) were not built locally. The change is in shared, unguarded code and a repo-wide grep found zero platform-specific references to the removed API, so native compilation is expected to be safe; the PackageDiff allow-list runs CI-only.

@github-actions github-actions Bot added 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
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 enabled auto-merge June 30, 2026 18:53
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/bc04-events-bubbling-managed-code branch from 83cb6d8 to 305c05b Compare July 6, 2026 15:46
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20260629/bc04-events-bubbling-managed-code branch from 305c05b to abad3ce Compare July 6, 2026 18:16
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

Remove the public Uno-only `UIElement.EventsBubblingInManagedCode`
dependency property (the static `EventsBubblingInManagedCodeProperty`,
the instance accessor, and the `CoerceRoutedEventFlag` callback). It is
a native-bubbling knob with no WinUI counterpart that let apps force
specific routed events to bubble in managed code on the native targets.

Behaviour is unchanged on every reachable default path: the property
defaulted to `RoutedEventFlag.None`, so `None.HasFlag(flag)` was already
false and `IsBubblingInManagedCode` deferred to native bubbling whenever
`CanBubbleNatively`. The simplified `IsBubblingInManagedCode(args) =>
args is null || !args.CanBubbleNatively` returns false in exactly that
same case; only the app-settable override is gone.

The native-bubbling plumbing (`CanBubbleNatively`) is kept intact so the
native heads keep behaving as-is. Drop the one unit test that exercised
the removed override, trim the doc prose for the removed knob, and
register the public API removal in build/PackageDiffIgnore.xml.

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

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@MartinZikmund
MartinZikmund force-pushed the dev/xygu/20260629/bc04-events-bubbling-managed-code branch from abad3ce to ea12840 Compare July 7, 2026 06:56
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

@Xiaoy312
Xiaoy312 merged commit 3a10c3e into feature/breakingchanges Jul 7, 2026
68 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20260629/bc04-events-bubbling-managed-code branch July 7, 2026 08:40
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 kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants