Skip to content

refactor!: Remove the Fluent V1 public surface and packaging (BC71) - #24083

Draft
Xiaoy312 wants to merge 12 commits into
feature/breakingchangesfrom
dev/xygu/20260814/drop-fluent-v1
Draft

refactor!: Remove the Fluent V1 public surface and packaging (BC71)#24083
Xiaoy312 wants to merge 12 commits into
feature/breakingchangesfrom
dev/xygu/20260814/drop-fluent-v1

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

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.xaml was a 251-byte empty
<ResourceDictionary/>, FluentMerge.targets globbed a Resources\Version1\** directory that
does not exist, and XamlControlsResources already hard-forced version 2 regardless of what the
caller asked for. Meanwhile Uno.UI.FluentTheme.v1.dll was still listed as a nuget pack input.

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 the Uno.UI.FluentTheme.v1 assembly).
  • The ControlsResourcesVersion enum, and the ControlsResourcesVersion member on both
    XamlControlsResources (a DP) and XamlControlsResourcesV2 (an inert object property that
    was never read).

Verified against the WinUI source at winui3/release/1.8.2: controls/idl/Microsoft.UI.Xaml.Controls.idl
declares XamlControlsResources with only a constructor, EnsureRevealLights, UseCompactResources
and UseCompactResourcesProperty. ControlsResourcesVersion, XamlControlsResourcesV1 and
XamlControlsResourcesV2 appear nowhere upstream — the versioning concept was dropped wholesale at
the WinUI 2 → WinUI 3 fork, which deleted 99 *_v1.xaml files and removed the enum from the IDL in
one commit. After this PR our XamlControlsResources matches its WinUI IDL 1:1.

Plumbing collapsed

With one theme-resource version left, XamlFilePathHelper.GetWinUIThemeResourceUrl(int) becomes a
constant, XamlConstants.MaxFluentResourcesVersion and 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 its ProjectReference, its Uno.UI.slnx entry,
four .slnf filters, its _AdjustedOutputProjects lines, three InternalsVisibleTo grants, and
six build/nuget/Uno.WinUI.nuspec entries. build/PackageDiffIgnore.xml gains the matching
ignores under the baseVersion="6.6" set.

Notes for reviewers

  • The issue's stated facts were stale and are corrected here: the nuspec had 6 v1 references
    (not 38), src/Uno.Sdk/ has zero v1 entries so that bullet was a no-op, and the four
    per-platform csproj variants had already been collapsed into one. Recorded in specs/lessons.md.
  • generatepkgdiff / nuget pack cannot run locally (they need the CI environment and the 6.6.x
    base package), so the PackageDiffIgnore.xml entry 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.
  • Follow-ups deliberately left out of scope are recorded under BC71 in
    specs/050-breaking-changes-rollup/spec.md, the main one being that XamlControlsResources is a
    port of WinUI 2 rather than WinUI 3 and should be re-baselined rather than patched further.

PR Checklist ✅

Checklist notes: no new test was added — existing coverage already guards this. Given_Control.When_Non_BuiltIn_Control
asserts every control's DefaultStyleResourceUri and that Style.GetDefaultStyleForInstance
resolves, which is what proves the generator still registers the v2 dictionary under the same URI;
Given_AcrylicBrush.When_TintLuminosityOpacity_Is_Set_By_ThemeResources guards the one behavioural
change (inlining UpdateSource() into the constructor preserves Source =UpdateAcrylicBrushes()
ordering). Docs are the migration-guide entries in doc/articles/migrating-to-uno-7.md; the feature
template 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 the
ControlsResourcesVersion property on either XamlControlsResources or XamlControlsResourcesV2.
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
XamlControlsResources already loaded V2 regardless of this property. Migration is to delete the
assignment, in code or XAML, and to replace any direct XamlControlsResourcesV1 use with
XamlControlsResources:

- <XamlControlsResources ControlsResourcesVersion="Version2" />
+ <XamlControlsResources />

Documented in doc/articles/migrating-to-uno-7.md under both Packages and Public API removed.

Validation

  • Compile — clean: Uno.UI, Uno.UI.FluentTheme (+.v2), Uno.Foundation (+.Logging),
    Uno.UI.SourceGenerators, Uno.UI.UnitTests, Uno.UI.RuntimeTests.Skia, SamplesApp.Skia.Generic
    (Release). The .slnf filter builds and the ALC runtime tests could not run locally: NetCurrent
    is now net11.0 while global.json pins allowPrerelease: false, which is a pre-existing
    condition on feature/breakingchanges and fails identically there.
  • Unit tests — 13 failures out of 4052, failure-name set byte-identical to the base branch
    (machine-timezone calendar tests).
  • Runtime (Skia Desktop) — 26/26 passed across Given_Control, Given_AcrylicBrush and
    Given_CheckBox_ThemeResource_Regression. The generator's emitted GlobalStaticResources.cs for
    Uno.UI.FluentTheme.v2 was inspected directly and still registers
    ms-appx:///Microsoft.UI.Xaml/Themes/themeresources_v2.xaml.
  • Pack / package diff — not run locally; CI is the authority (see notes above).

Xiaoy312 and others added 9 commits August 14, 2026 13:05
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>
@github-actions github-actions Bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Aug 14, 2026
Comment thread build/filters/Uno.UI-packages-all.slnf Outdated
"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes!

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this can then become just themeresources.xaml

@unodevops

Copy link
Copy Markdown
Contributor

🤖 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

Xiaoy312 and others added 3 commits August 14, 2026 17:24
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>
@unodevops

Copy link
Copy Markdown
Contributor

🤖 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

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24083/docs/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 227860 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 120

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DynamicFont.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageBrush_Stretch.png
    • Attributed_text_FontSize_Changing.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
  • skia-windows-screenshots: 120 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DisplayInformation.png-dark
    • DynamicFont.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • Buttons.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ExpanderColorValidationPage.png-dark
    • EllipsemaskingEllipseGrid.png-dark
    • Examples.png
    • ImageBrushInList.png-dark
    • Battery.png-dark
    • ImageBrushInList.png
    • Dopes.png-dark
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • DataTransferManager.png-dark
    • DataTransferManager.png

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

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants