refactor: keep one ComponentModelFallbackConverter for all platforms - #4435
Open
glennawatson wants to merge 3 commits into
Open
refactor: keep one ComponentModelFallbackConverter for all platforms#4435glennawatson wants to merge 3 commits into
glennawatson wants to merge 3 commits into
Conversation
glennawatson
force-pushed
the
refactor/share-component-model-fallback-converter
branch
from
August 13, 2026 01:54
fbfd27f to
496efcb
Compare
- The desktop and mobile platform groups each carried an identical copy, differing only in the mobile copy's Preserve attribute. - The survivor moves into ReactiveUI.Shared, which ReactiveUI and ReactiveUI.Reactive both already compile wholesale, so neither project file needs an entry for it. - Preserve(AllMembers) is ReactiveUI's own attribute and is inert off mobile, so one file serves every platform.
glennawatson
force-pushed
the
refactor/share-component-model-fallback-converter
branch
from
August 13, 2026 01:56
496efcb to
e8c76d3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4435 +/- ##
=======================================
Coverage 93.89% 93.89%
=======================================
Files 359 359
Lines 15104 15104
Branches 1568 1568
=======================================
Hits 14182 14182
Misses 679 679
Partials 243 243 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sharing one file across every platform gives the desktop targets the [Preserve(AllMembers = true)] the mobile copy already carried, which is a public API change the baselines have to state. - Regenerate the 22 affected baselines: ReactiveUI and ReactiveUI.Reactive across net8/9/10/11, net462/472/481 and the four -windows targets. - The Apple and Android baselines already record the attribute and are unchanged.
ChrisPulman
approved these changes
Aug 13, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What kind of change does this PR introduce?
Refactor. Deletes a duplicated file. No build configuration change.
What is the new behavior?
ComponentModelFallbackConverterhas one definition instead of two identical ones.ReactiveUI.Shared/Bindings/Converter/, beside theComponentModelConversionhelper both copies already delegated to.ReactiveUIandReactiveUI.Reactivealready compileReactiveUI.Shared/**/*.cswholesale, so an existing glob picks it up. Both.csprojfiles are byte-identical tomain.[Preserve(AllMembers = true)]is what allows one file to serve every platform. It is ReactiveUI's own attribute and is inert off mobile, so the mobile linker still sees the converter and the desktop targets are unaffected at runtime. That attribute was the only meaningful difference between the two copies.What is the current behavior?
Platforms/net/ComponentModelFallbackConverter.csandPlatforms/mobile-common/ComponentModelFallbackConverter.csare byte-equivalent apart from that[Preserve]attribute and an unusedusing System.Diagnostics;on the desktop copy. The duplication scanner reports the pair at 66.7 percent and 25 percent.What might this PR break?
The declared public API of the desktop targets changes, in one way: the type now carries
[Preserve(AllMembers = true)]where it previously did not. Keeping the attribute is what lets a single file serve mobile, so the desktop targets inherit it.Preserveis ReactiveUI's own attribute and is inert away from the mobile linker, so nothing changes at runtime - but it is part of the surface and the baselines now record it.ReactiveUIandReactiveUI.Reactiveacross net8/9/10/11, net462/472/481 and the four-windowstargets.Checklist
mainbranchAdditional information
The diff is one file moving, one being deleted, and the
[Preserve]line appearing in the 22 baselines that did not already have it.Verified with a clean
reactiveui.slnxRelease build on a real Windows host: 0 errors, withReactiveUIbuilding 22 target frameworks andReactiveUI.Reactive21 - ios, tvos, maccatalyst, macos, android, Windows desktop, WinUI and .NET Framework included. Re-verified after #4428 landed withdotnet build reactiveui.slnx -c Release -t:Rebuild -warnaserroron Linux: 0 warnings, 0 errors.