Skip to content

WUX/MUX prototype - #1421

Merged
Sergio Pedri (Sergio0694) merged 55 commits into
staging/AOTfrom
users/jkoritzinsky/wux-mux
Jun 25, 2024
Merged

Sergio Pedri (Sergio0694) merged 55 commits into
staging/AOTfrom
users/jkoritzinsky/wux-mux

Conversation

@jkoritzinsky

Copy link
Copy Markdown
Member

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 Jeremy Koritzinsky (jkoritzinsky) changed the title Start prototype with TODOs on supporting build-time/runtime-startup sโ€ฆ WUX/MUX prototype Dec 20, 2023
@jkoritzinsky

Copy link
Copy Markdown
Member Author

Follow-up notes from Sergio Pedri (@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.

@dongle-the-gadget

Copy link
Copy Markdown
Contributor

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

@Sergio0694

Copy link
Copy Markdown
Member

"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?

@jkoritzinsky

Copy link
Copy Markdown
Member Author

"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.

โ€ฆelected WUX vs MUX mode.

Implement the base TODO-WuxMux items that must be completed to support a runtime configuration WUX/MUX switch.

Add WUX test projection and fix bug with ICommand special-casing.

Inline MUX guids.

Add CsWinRT SDK support

Add tests for authoring components with WUX APIs (also validates some of the consumption logic in the process)

Remove Debug.Breaks

Change approach so WUX/MUX works for delegates

Use Xaml Islands and a custom main to enable writing GTest tests with INPC and types that need the XAML engine initialized on the thread.

Add AuthoringWuxComsumptionTest to the CI

Change IIDOptimizer to fall back to GuidGenerator for WUX/MUX types.

Fix IList ABI type to implement WUX and MUX

Add breaks

PR feedback and fix unit test failures.

Fix configurations for new projects.

Fix configuration for Windows.UI.Xaml projection
Comment thread src/WinRT.Runtime/Projections.cs Resolved
@asklar

Copy link
Copy Markdown
Member

related: #723

@Sergio0694

Copy link
Copy Markdown
Member

0 difference in size in our minimal sample ๐Ÿ˜„

image

@dongle-the-gadget

Copy link
Copy Markdown
Contributor

Does it affect size when you switch to WUX mode?

@Sergio0694

Copy link
Copy Markdown
Member

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

@driver1998

driver1998 (driver1998) commented Jun 11, 2024 •

Copy link
Copy Markdown

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

@dongle-the-gadget

Copy link
Copy Markdown
Contributor

@driver1998

Copy link
Copy Markdown

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.

@Sergio0694

Copy link
Copy Markdown
Member

But .NET Framework does support arm64 ๐Ÿ˜…

@dongle-the-gadget

Copy link
Copy Markdown
Contributor

It does - 4.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants