refactor!: Remove the Fluent V1 public surface and packaging (BC71) - #24083
refactor!: Remove the Fluent V1 public surface and packaging (BC71)#24083Xiaoy312 wants to merge 12 commits into
Conversation
XamlControlsResources already forced version 2 unconditionally, so the ControlsResourcesVersion enum and its dependency property selected nothing. Neither the enum nor XamlControlsResourcesV1 exists in the WinUI IDL (controls/idl/Microsoft.UI.Xaml.Controls.idl, winui3/release/1.8.2), which declares only the ctor, EnsureRevealLights and UseCompactResources. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The V1 theme content was already deleted, leaving an empty themeresources_v1.xaml and a merge target globbing a Resources\Version1 directory that does not exist. Remove the project along with its pack inputs, so nuget pack stops listing an assembly that is no longer built. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only version 2 remains, so the version-parameterized lookup and the generator loop over it resolve to a single constant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Hedge the package-diff ignores for the removed Fluent V1 surface with regex member entries and a field-shaped ControlsResourcesVersionProperty, since generatepkgdiff only runs on CI. Inline UpdateSource in XamlControlsResourcesV2 to match its sibling, and document the V2 stub removal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
WinUI 1.8 carries TintLuminosityOpacity inline in AcrylicBrush_themeresources.xaml and never assigns it programmatically; our ported v2 dictionaries drop the attribute, which is what this fix-up compensates for. Record the parity gaps found diffing XamlControlsResources against winui3/release/1.8.2. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
WinUI 3 dropped the v1/v2 resources-version concept wholesale at the repo fork, so the members we mirror only exist in the WinUI 2 lineage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| "Uno.UI.Dispatching\\Uno.UI.Dispatching.Skia.csproj", | ||
| "Uno.UI.Dispatching\\Uno.UI.Dispatching.Wasm.csproj", | ||
| "Uno.UI.FluentTheme.v1\\Uno.UI.FluentTheme.v1.csproj", | ||
| "Uno.UI.FluentTheme.v2\\Uno.UI.FluentTheme.v2.csproj", |
There was a problem hiding this comment.
Let's also change the FluentTheme.v2 to just FluentTheme now - it no longer is worth making it versioned as it versions with WinUI itself - we can just drop the .v2 everywhere
| private const string MsResourceFilesFolder = "Files/"; | ||
| public const string MsResourceFilesPrefix = MSResourceIdentifier + MsResourceFilesFolder; | ||
| public const string WinUICompactURL = "Microsoft.UI.Xaml/DensityStyles/Compact.xaml"; | ||
| public const string WinUIThemeResourceFileName = "themeresources_v2.xaml"; |
There was a problem hiding this comment.
And this can then become just themeresources.xaml
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24083/wasm-skia-net9/index.html |
With Fluent V1 removed, the "v2" suffix no longer distinguished anything: one assembly held XamlControlsResources and the Compact density styles, the other held every Fluent dictionary, and XamlControlsResources initialized both GlobalStaticResources in sequence. Collapsing them removes XamlControlsResourcesV2, which had no WinAppSDK counterpart and had become a duplicate of XamlControlsResources down to the acrylic TintLuminosityOpacity table. Resources/Version2/** flattens to Resources/**, and the merged dictionary takes the name WinUI uses -- themeresources.xaml; the _v2 suffix never existed upstream, where Version 2 was the unsuffixed file (dev/dll/XamlControlsResources.cpp, WinUI 2). The merge output is byte-identical after the flattening, and the built assembly registers both Microsoft.UI.Xaml/Themes/themeresources.xaml and Microsoft.UI.Xaml/DensityStyles/Compact.xaml, which previously came from two assemblies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the Uno.UI.FluentTheme.v2 assembly, XamlControlsResourcesV2 and the two generated types to the baseVersion="6.6" set, plus regex hedges in Fields, Properties and Methods for members the diff may report individually. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The theme-resources ms-appx: URI changes with the file rename, so a hand-merged ResourceDictionary.Source needs updating; merging XamlControlsResources is unaffected. Also repoints the winui-port skill, which sent new control styles to the removed Uno.UI.FluentTheme.v2 folder. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24083/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24083/docs/index.html |
|
The build 227860 found UI Test snapshots differences: Details
|
GitHub Issue: contributes to #8339
PR Type:
🔄 Refactoring (no functional changes, no api changes)
…with a public API removal — see the breaking-change note at the bottom.
What changed? 🚀
Fluent Design V1 has been dead weight for several releases: its theme content was already
deleted, but the scaffolding still shipped.
themeresources_v1.xamlwas a 251-byte empty<ResourceDictionary/>,FluentMerge.targetsglobbed aResources\Version1\**directory thatdoes not exist, and
XamlControlsResourcesalready hard-forced version 2 regardless of what thecaller asked for. Meanwhile
Uno.UI.FluentTheme.v1.dllwas still listed as anuget packinput.This removes the API surface and the packaging together — splitting them would leave the pack in a
broken intermediate state.
Public surface removed
Microsoft.UI.Xaml.Controls.XamlControlsResourcesV1(and theUno.UI.FluentTheme.v1assembly).ControlsResourcesVersionenum, and theControlsResourcesVersionmember on bothXamlControlsResources(a DP) andXamlControlsResourcesV2(an inertobjectproperty thatwas never read).
Verified against the WinUI source at
winui3/release/1.8.2:controls/idl/Microsoft.UI.Xaml.Controls.idldeclares
XamlControlsResourceswith only a constructor,EnsureRevealLights,UseCompactResourcesand
UseCompactResourcesProperty.ControlsResourcesVersion,XamlControlsResourcesV1andXamlControlsResourcesV2appear nowhere upstream — the versioning concept was dropped wholesale atthe WinUI 2 → WinUI 3 fork, which deleted 99
*_v1.xamlfiles and removed the enum from the IDL inone commit. After this PR our
XamlControlsResourcesmatches its WinUI IDL 1:1.Plumbing collapsed
With one theme-resource version left,
XamlFilePathHelper.GetWinUIThemeResourceUrl(int)becomes aconstant,
XamlConstants.MaxFluentResourcesVersionand the XAML generator's version loop go away,and the generator emits a single registration instead of iterating. Behaviourally identical — the
v1 iteration resolved to no file in any assembly once v1 was deleted.
Build & packaging
src/Uno.UI.FluentTheme.v1/deleted, along with itsProjectReference, itsUno.UI.slnxentry,four
.slnffilters, its_AdjustedOutputProjectslines, threeInternalsVisibleTogrants, andsix
build/nuget/Uno.WinUI.nuspecentries.build/PackageDiffIgnore.xmlgains the matchingignores under the
baseVersion="6.6"set.Notes for reviewers
(not 38),
src/Uno.Sdk/has zero v1 entries so that bullet was a no-op, and the fourper-platform csproj variants had already been collapsed into one. Recorded in
specs/lessons.md.generatepkgdiff/nuget packcannot run locally (they need the CI environment and the 6.6.xbase package), so the
PackageDiffIgnore.xmlentry set is belt-and-braces — assembly-level,type-level and regex member-level. CI is the authority; if it reports an entry in the wrong
section the fix is one line.
specs/050-breaking-changes-rollup/spec.md, the main one being thatXamlControlsResourcesis aport of WinUI 2 rather than WinUI 3 and should be re-baselined rather than patched further.
PR Checklist ✅
Screenshots Compare Test Runresults.Checklist notes: no new test was added — existing coverage already guards this.
Given_Control.When_Non_BuiltIn_Controlasserts every control's
DefaultStyleResourceUriand thatStyle.GetDefaultStyleForInstanceresolves, which is what proves the generator still registers the v2 dictionary under the same URI;
Given_AcrylicBrush.When_TintLuminosityOpacity_Is_Set_By_ThemeResourcesguards the one behaviouralchange (inlining
UpdateSource()into the constructor preservesSource =→UpdateAcrylicBrushes()ordering). Docs are the migration-guide entries in
doc/articles/migrating-to-uno-7.md; the featuretemplate does not apply to a removal. Screenshot comparison is left for CI.
Breaking change — impact and migration
Source-breaking for anyone referencing
XamlControlsResourcesV1,ControlsResourcesVersion, or theControlsResourcesVersionproperty on eitherXamlControlsResourcesorXamlControlsResourcesV2.This is intentional and part of the 7.0 breaking-changes rollup (#8339).
No visual behaviour changes: V1 styles have not existed for several releases and
XamlControlsResourcesalready loaded V2 regardless of this property. Migration is to delete theassignment, in code or XAML, and to replace any direct
XamlControlsResourcesV1use withXamlControlsResources:Documented in
doc/articles/migrating-to-uno-7.mdunder both Packages and Public API removed.Validation
Uno.UI,Uno.UI.FluentTheme(+.v2),Uno.Foundation(+.Logging),Uno.UI.SourceGenerators,Uno.UI.UnitTests,Uno.UI.RuntimeTests.Skia,SamplesApp.Skia.Generic(Release). The
.slnffilter builds and the ALC runtime tests could not run locally:NetCurrentis now
net11.0whileglobal.jsonpinsallowPrerelease: false, which is a pre-existingcondition on
feature/breakingchangesand fails identically there.(machine-timezone calendar tests).
Given_Control,Given_AcrylicBrushandGiven_CheckBox_ThemeResource_Regression. The generator's emittedGlobalStaticResources.csforUno.UI.FluentTheme.v2was inspected directly and still registersms-appx:///Microsoft.UI.Xaml/Themes/themeresources_v2.xaml.