Skip to content

feat(samples): host theme apps in a Toolkit wrapper (backport #1654) - #1657

Closed
mergify[bot] wants to merge 1 commit into
servicing/10.0from
mergify/bp/servicing/10.0/pr-1654
Closed

mergify[bot] wants to merge 1 commit into
servicing/10.0from
mergify/bp/servicing/10.0/pr-1654

Conversation

@mergify

@mergify mergify Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

PR previews and main deployments currently publish only the Simple sample. This change deploys a Toolkit wrapper that hosts Material, Cupertino, and Simple using the same secondary-AssemblyLoadContext pattern as Uno Themes.

PR Type

  • Feature
  • Build or CI related changes
  • Documentation content changes

What is the new behavior?

  • Add a theme picker with reload/unload and ?app=material|cupertino|simple deep links.
  • Give each guest its own application instance and isolate Toolkit/theme assemblies while sharing the Uno runtime.
  • Clear framework caches that retain guest types and finish Release desktop collection before loading another theme, preventing stale binding resolution (related to XAML attached-property binding paths read null once a second ALC has loaded the owner assembly uno#24581).
  • Build all WASM guest heads and package their assemblies, fonts, and images in the wrapper deployment. Missing guest payloads fail packaging.
  • Preserve standalone sample artifacts for existing runtime tests, add the wrapper to both solutions, and add a strict desktop hosting smoke job.

The wrapper remains untrimmed because its guest assemblies load dynamically. No new package dependencies or framework/version changes are introduced.

Validation

  • Release desktop build: passed; final incremental build had 0 warnings/errors. Full sample compilation emitted warnings.
  • Release WASM guest builds and wrapper publish: passed. Guests emitted 103/102/102 warnings; wrapper publish emitted none.
  • Strict Release desktop hosting smoke: passed twice locally and in Linux CI build 236394, with normal runtime settings and unchanged reclamation assertions.
  • Final published browser hosting smoke: passed for all themes, reload/unload, missing guest, and cancellation. Material deep-link rendering was also checked.
  • Material runtime suite: 361 passed, 11 skipped, 0 failed locally; Linux CI validated 372 runtime cases and the separate hot-reload job validated 48 cases.
  • Workflow actionlint, Azure YAML parsing, shell syntax, and diff checks: passed. Missing guest packaging failed as expected.

CI and limitations

  • The desktop reclamation failure is fixed in c3e2179c and verified on macOS and Linux CI. The full CI run on final commit d7932b7e (236398), CodeQL, and preview deployment passed. The deployed browser smoke also passed after the functional fix. The strict assertions remain enabled.
  • WASM collection remains diagnostic, matching the reference host; a browser pass does not prove memory reclamation.
  • A warning-free full Release build remains outstanding.

Details and reproduction commands: validation notes.

PR Checklist


This is an automatic backport of pull request #1654 done by [Mergify](https://mergify.com).

(cherry picked from commit dfa8b63)

# Conflicts:
#	samples/Uno.Toolkit.Samples.Cupertino/App.xaml.cs
#	samples/Uno.Toolkit.Samples.Material/App.xaml.cs
#	samples/Uno.Toolkit.Samples.Simple/App.xaml.cs
#	specs/lessons.md
@mergify

mergify Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of dfa8b63 has failed:

On branch mergify/bp/servicing/10.0/pr-1654
Your branch is up to date with 'origin/servicing/10.0'.

You are currently cherry-picking commit dfa8b63.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .github/workflows/azure-static-webapp.yml
	modified:   README.md
	new file:   build/workflow/scripts/build-wasm-guest-heads.sh
	modified:   build/workflow/stage-build-desktop.yml
	modified:   build/workflow/stage-build-wasm.yml
	modified:   samples/Uno.Toolkit.Samples.Cupertino/CupertinoSampleApp.csproj
	modified:   samples/Uno.Toolkit.Samples.Material/MaterialSampleApp.csproj
	modified:   samples/Uno.Toolkit.Samples.Simple/SimpleSampleApp.csproj
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/App.xaml
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/App.xaml.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppCatalog.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppDeepLink.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppLoader.Desktop.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppLoader.Sweeps.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppLoader.Wasm.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAppLoader.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestAssemblyLoadContext.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestHostingSmoke.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/GuestHosting/GuestSharedAssemblies.txt
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/MainPage.xaml
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/MainPage.xaml.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/Desktop/Program.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/WebAssembly/LinkerConfig.xml
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/WebAssembly/Program.cs
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/WebAssembly/WasmScripts/AppManifest.js
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/WebAssembly/manifest.webmanifest
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Platforms/WebAssembly/wwwroot/staticwebapp.config.json
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/Properties/launchSettings.json
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/ToolkitSampleApp.csproj
	new file:   samples/Uno.Toolkit.Samples.ThemeWrapper/app.manifest
	modified:   samples/Uno.Toolkit.Samples.sln
	modified:   samples/Uno.Toolkit.Samples/Content/Controls/SeedColorSamplePage.xaml.cs
	modified:   samples/Uno.Toolkit.Samples/Controls/OverviewSampleView.cs
	modified:   samples/Uno.Toolkit.Samples/Shell.xaml.cs
	new file:   specs/toolkit-wrapper/progress.md
	modified:   src/Uno.Toolkit.sln

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   samples/Uno.Toolkit.Samples.Cupertino/App.xaml.cs
	both modified:   samples/Uno.Toolkit.Samples.Material/App.xaml.cs
	both modified:   samples/Uno.Toolkit.Samples.Simple/App.xaml.cs
	both modified:   specs/lessons.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 236407 has failed on Uno Toolkit - CI.

@kazo0

kazo0 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Closing without backporting. #1654's wrapper depends on Uno's secondary-ALC hosting API (AlcContentHost, WindowHelper.ContentHostOverride, ExitAlcApplication), which first ships in Uno.WinUI 6.7. servicing/10.0 is pinned to 6.6.166, so after resolving the cherry-pick conflicts the wrapper fails to compile (CS0246: 'AlcContentHost' could not be found). This is a samples/CI feature, so it isn't worth bumping the servicing branch's Uno version to take it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants