CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

WUX/MUX prototype

Open jkoritzinsky opened this issue 1 year ago • 4 comments

Implement prototype WUX/MUX support for both consumption and authoring. The remaining TODO-WuxMux items will provide a better UX or perf but are not required for basic functionality.

Replacement for #1418 that will get CI.

jkoritzinsky avatar Dec 20 '23 00:12 jkoritzinsky

Follow-up notes from @Sergio0694 in the other PR:

We'll need to react to #1395 and have a separate manifest for AOT that only specifies the "latest tested OS version" to allow the Xaml Islands APIs.

Also, we should hook up a linker substitution file to hard-code the UiXamlMode switch when trimming or AOT compiling.

jkoritzinsky avatar Dec 20 '23 00:12 jkoritzinsky

Wanted to clarify the comment I made in #1418. The Windows.UI.Colors class isn’t available in the SDK projection, as it is a WUX type. However, the issue is due to CsWinRT’s behaviors regarding additions, you can’t project Windows.UI.Colors without also projecting Windows.UI.Color, which would conflict with the SDK projection and generate a warning

dongle-the-gadget avatar Dec 20 '23 10:12 dongle-the-gadget

"The Windows.UI.Colors class isn’t available in the SDK projection, as it is a WUX type. However, the issue is due to CsWinRT’s behaviors regarding additions, you can’t project Windows.UI.Colors without also projecting Windows.UI.Color, which would conflict with the SDK projection and generate a warning"

Given this is a single, well known case, perhaps we can special case it so that when Windows.UI.Colors is projected, we skip also projecting Windows.UI.Color, as we can rely on it already being present in the Windows SDK projections assembly? Or, alternatively, at the very least, perhaps we could generate some type-identity nonsense or whatever to avoid the warning?

Sergio0694 avatar Dec 22 '23 16:12 Sergio0694

"The Windows.UI.Colors class isn’t available in the SDK projection, as it is a WUX type. However, the issue is due to CsWinRT’s behaviors regarding additions, you can’t project Windows.UI.Colors without also projecting Windows.UI.Color, which would conflict with the SDK projection and generate a warning"

Given this is a single, well known case, perhaps we can special case it so that when Windows.UI.Colors is projected, we skip also projecting Windows.UI.Color, as we can rely on it already being present in the Windows SDK projections assembly? Or, alternatively, at the very least, perhaps we could generate some type-identity nonsense or whatever to avoid the warning?

Honestly, some manual type identity nonsense isn't the worst idea. I'll try that out in this PR and see what I can do.

jkoritzinsky avatar Dec 27 '23 20:12 jkoritzinsky

What does WUX/MUX stand for please?

MartyIX avatar May 22 '24 06:05 MartyIX

Windows.UI.Xaml (System XAML) + Microsoft.UI.Xaml (WinUI 3)

dongle-the-gadget avatar May 22 '24 06:05 dongle-the-gadget

related: #723

asklar avatar Jun 07 '24 15:06 asklar

0 difference in size in our minimal sample 😄

image

Sergio0694 avatar Jun 10 '24 23:06 Sergio0694

Does it affect size when you switch to WUX mode?

dongle-the-gadget avatar Jun 11 '24 03:06 dongle-the-gadget

Possibly, but that's not really a concern. I can test that too though.

Sergio0694 avatar Jun 11 '24 04:06 Sergio0694

Confirmed that data binding and INotifyPropertyChanged works on WUX.

But without XAML codegen it'll still be PITA to use...

I have a try at writing a IXamlMetadataProvider implementation by hand and that is certainly not fun. image

image

driver1998 avatar Jun 11 '24 07:06 driver1998

The XAML codegen is the work of another team.


From: driver1998 @.> Sent: Tuesday, June 11, 2024 14:44 To: microsoft/CsWinRT @.> Cc: Dongle @.>; Comment @.> Subject: Re: [microsoft/CsWinRT] WUX/MUX prototype (PR #1421)

Confirmed that data binding and INotifyPropertyChanged works on WUX.

But without XAML codegen it'll still be PITA to use...

image.png (view on web)https://github.com/microsoft/CsWinRT/assets/22699485/219d097f-03dc-4a16-8641-0fb49c2bd687

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/CsWinRT/pull/1421#issuecomment-2160021228, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHBRRWS4I35DJ4FOWPFDKITZG2TERAVCNFSM6AAAAABA4AM53WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRQGAZDCMRSHA. You are receiving this because you commented.Message ID: @.***>

dongle-the-gadget avatar Jun 11 '24 08:06 dongle-the-gadget

The XAML codegen is the work of another team.

That's the issue I am concerned about right now, that other team might see System XAML as deprecated technology and refuse to update. Just like what happened to ARM64 .NET Framework.

driver1998 avatar Jun 11 '24 08:06 driver1998

But .NET Framework does support arm64 😅

Sergio0694 avatar Jun 11 '24 15:06 Sergio0694

It does - 4.8.1

dongle-the-gadget avatar Jun 11 '24 15:06 dongle-the-gadget