Skip to content

chore: Align UWPSyncGenerator library routing with WinUI structure #22927

Open

Description

@MartinZikmund

Summary

The Uno.UWPSyncGenerator has accumulated special-case routing overrides in GetNamespaceBasePath() (the HAS_UNO_WINUI path) to avoid breaking changes when types were previously introduced in different Uno libraries than where WinUI defines them. These workarounds should be resolved by properly aligning the library structure with WinUI.

Current workarounds

All located in src/Uno.UWPSyncGenerator/Generator.cs, method GetNamespaceBasePath().

Type-specific overrides

Type(s) Current target Correct target Reason
CreateFromStringAttribute Uno.UWP Assembly-based (would be Uno.UI from Microsoft.WinUI) Type-specific override before namespace routing
Microsoft.UI.Colors, Microsoft.UI.ColorHelper, Microsoft.UI.FontWeights Uno.UI Assembly-based (Uno.UI from Microsoft.WinUI) Happens to match correct target but uses name-matching instead of assembly routing
Microsoft.UI.IClosableNotifier, Microsoft.UI.ClosableNotifierHandler Uno.UI.Composition Uno.UWP Was previously introduced in Uno.UI.Composition
WinRT.Interop.* (WindowNative, InitializeWithWindow) Uno.UI Uno.Foundation (from WinRT.Runtime assembly) Hand-written implementations in Uno.UI depend on Microsoft.UI.Xaml.Window — can't move to lower-level assembly

Namespace-level backwards compatibility redirects

Namespace Current target Correct target Reason
Microsoft.UI.Content.* Uno.UI Uno.UWP (from Microsoft.WinUI assembly) Was previously generated in Uno.UI
Microsoft.UI.System.* Uno.UI Uno.UWP Kept in Uno.UI for consistency with other Microsoft.UI.* namespaces
Microsoft.Graphics.DirectX.*, Microsoft.Graphics.Display.* Uno.UI.Composition Uno.UWP (from Microsoft.Windows.SDK.NET) Was previously generated in Uno.UI.Composition
Microsoft.Windows.ApplicationModel.Resources.* Uno.UI Uno.UWP Was previously generated in Uno.UI
Microsoft.Web.WebView2.* Uno.UI Uno.UWP Was previously generated in Uno.UI

Foundation type routing (name-based, potentially fragile)

Several types are routed to Uno.Foundation by name rather than by assembly/namespace:

  • AsyncAction/AsyncOperation (name contains)
  • IAsyncInfo, AsyncStatus, Deferral, DeferralCompletedHandler, TypedEventHandler, FoundationContract, PropertyValue, IPropertyValue, PropertyType, IStringable, IReferenceArray

Goal

Remove all special-case type routing in the generator by migrating types to the correct libraries (matching WinUI's structure), with appropriate [TypeForwardedFrom] attributes or other binary-compatibility mechanisms as needed.

Activity

  1. github-actions commented on Jul 30, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  2. added
    stale
    on Jul 30, 2026
  3. removed
    stale
    on Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions