Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WUX/MUX prototype #1421

Merged
merged 55 commits into from
Jun 25, 2024
Merged

WUX/MUX prototype #1421

merged 55 commits into from
Jun 25, 2024

Conversation

jkoritzinsky
Copy link
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 jkoritzinsky changed the title Start prototype with TODOs on supporting build-time/runtime-startup s… WUX/MUX prototype Dec 20, 2023
@jkoritzinsky jkoritzinsky mentioned this pull request Dec 20, 2023
@jkoritzinsky
Copy link
Member Author

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.

@dongle-the-gadget
Copy link
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
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
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
@jkoritzinsky jkoritzinsky force-pushed the users/jkoritzinsky/wux-mux branch from c873dd7 to 21b99e5 Compare January 18, 2024 16:46
@asklar
Copy link
Member

asklar commented Jun 7, 2024

related: #723

@Sergio0694
Copy link
Member

0 difference in size in our minimal sample 😄

image

@dongle-the-gadget
Copy link
Contributor

Does it affect size when you switch to WUX mode?

@Sergio0694
Copy link
Member

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

@driver1998
Copy link

driver1998 commented Jun 11, 2024

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
Contributor

dongle-the-gadget commented Jun 11, 2024 via email

@driver1998
Copy link

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
Member

But .NET Framework does support arm64 😅

@dongle-the-gadget
Copy link
Contributor

It does - 4.8.1

@Sergio0694 Sergio0694 merged commit 6bd62de into staging/AOT Jun 25, 2024
10 checks passed
@jkoritzinsky jkoritzinsky deleted the users/jkoritzinsky/wux-mux branch June 25, 2024 18:12
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