Commit 708d77a
authored
breaking: Remove .NET Standard 2.0, modernize AOT compatibility (#4257)
BREAKING CHANGES:
1. Removed .NET Standard 2.0 support - minimum target is now net8.0 or
net462
2. Removed RxApp.cs - replaced with RxAppBuilder pattern
3. Removed PlatformRegistrationManager.cs - replaced with modern builder
pattern
4. Solution file renamed: ReactiveUI.sln → reactiveui.slnx (SLNX format)
5. Removed polyfill attributes now built into modern .NET:
- CallerArgumentExpressionAttribute
- DoesNotReturnIfAttribute - NotNullAttribute - IsExternalInit
6. Removed platform-specific ComponentModelTypeConverter implementations
7. Removed legacy DefaultViewLocator.AOT.cs
## Migration Guide
### .NET Standard 2.0 Removal
Projects targeting .NET Standard 2.0 must upgrade to at least .NET 8.0.
ReactiveUI
now requires modern .NET with built-in nullable reference types, init
properties,
and AOT attributes.
**Before:**
- Supported: netstandard2.0, net462+, net8+
- Used polyfill attributes for modern C# features
**After:**
- Minimum: net8.0 for cross-platform, net462 for Windows-only legacy,
net9.0 for maui platforms
- Uses built-in .NET attributes for nullable/AOT support
### RxApp Removal
The static RxApp class has been removed in favor of the builder pattern.
**Before:**
```csharp
RxApp.MainThreadScheduler.Schedule(() => { });
RxApp.TaskpoolScheduler.Schedule(() => { });
After:
// Use RxSchedulers for AOT-safe scheduler access
RxSchedulers.MainThreadScheduler.Schedule(() => { });
RxSchedulers.TaskpoolScheduler.Schedule(() => { });
// Or use builder pattern for initialization
var builder = RxAppBuilder.CreateReactiveUIBuilder(resolver)
.WithCoreServices()
.BuildApp();
```
Solution File Renamed
Before: src/ReactiveUI.sln (legacy text format)
After: src/reactiveui.slnx (XML-based format)
Impact:
- Update CI/CD scripts referencing ReactiveUI.sln → reactiveui.slnx
- Requires Visual Studio 2022 17.10+ or JetBrains Rider 2024.1+ for IDE support
- All dotnet CLI commands work identically (no syntax changes)
Major Enhancements
Test Coverage (80%+ achieved)
- Reorganized test projects for better coverage analysis
- Removed duplicate/obsolete test projects:
- ReactiveUI.AOTTests (consolidated into main tests)
- ReactiveUI.Builder.Tests (consolidated)
- ReactiveUI.Splat.Tests (functionality moved to core)
- ReactiveUI.Testing.Tests (consolidated)
- Fixed intermittent test failures with proper Locator scoping
- Added comprehensive MAUI activation tests
- Enhanced builder API tests with WithInstance coverage
AOT Compatibility Improvements
This branch addresses numerous AOT warnings and improves trimming compatibility:
- Removed reflection-heavy PlatformRegistrationManager
- Removed ComponentModelTypeConverter (used reflection)
- Streamlined view locator implementation (removed AOT-specific version)
- All polyfill attributes removed (used UnconditionalSuppressMessage)
- Improved DynamicallyAccessedMembers usage throughout codebase
Bug Fixes
- Nested property binding: Fixed redundant setter calls that caused performance issues and unexpected behavior when binding to nested properties
- MAUI activation: Resolved activation lifecycle issues in MAUI controls
- Test flakiness: Fixed race conditions in Locator-dependent tests by introducing LocatorScope pattern
API Enhancements
- Builder API: Added BuilderMixins with WithInstance pattern for better testability
- XML Documentation: Comprehensive docs added to:
- All public interfaces (IActivatableView, IViewFor, etc.)
- Suspension APIs (ISuspensionHost, ISuspensionDriver)
- Interaction APIs (IInteraction, IInteractionContext)
- View locator and activation APIs
- Usage Examples: Added code examples to public API documentation
Documentation Improvements
Added comprehensive educational documentation (CLAUDE.md, copilot-instructions.md):
SLNX Format Documentation
- What SLNX is (XML-based solution format, VS 2022 17.10+)
- Key differences from .sln (structured XML vs proprietary text)
- IDE compatibility requirements
- CLI usage (identical to .sln files)
Microsoft Testing Platform (MTP) Documentation
- What MTP is and why ReactiveUI uses it (modern test platform replacing VSTest)
- How MTP differs from VSTest (argument syntax, configuration)
- Configuration files explained (global.json, testconfig.json, Directory.Build.props)
- Best practices:
- Never use --no-build flag (causes stale binary issues)
- Correct argument placement: dotnet test flags BEFORE --, TUnit flags AFTER --
- How to see Console.WriteLine output (--output Detailed)
- Non-parallel test execution rationale
Command Reference Improvements
- Fixed coverage argument placement (--coverage goes BEFORE --)
- Reorganized command-line flags by tool (dotnet test vs TUnit)
- Removed contradictory examples (--no-build)
- All solution references updated to reactiveui.slnx
Key Deletions
- src/ReactiveUI.sln → migrated to reactiveui.slnx
- src/ReactiveUI/RxApp.cs → replaced with RxAppBuilder pattern
- src/ReactiveUI/PlatformRegistrationManager.cs → replaced with builder pattern
- src/ReactiveUI/RegistrationNamespace.cs → obsolete with new registration approach
- src/ReactiveUI/Helpers/*.cs → polyfill attributes removed (4 files)
- src/ReactiveUI/IsExternalInit.cs → built into modern .NET
- src/ReactiveUI.*/GlobalUsings.cs → removed from Maui/WinUI (2 files)
- src/ReactiveUI/Platforms/*/ComponentModelTypeConverter.cs → reflection-based, removed (3 files)
- src/ReactiveUI/View/DefaultViewLocator.AOT.cs → consolidated with main implementation
- Multiple test projects consolidated (ReactiveUI.AOTTests, Builder.Tests, Splat.Tests, etc.)
Platform Support Matrix
Before:
- netstandard2.0 (cross-platform)
- net462, net472, net481 (Windows legacy)
- net8.0, net9.0, net10.0 (modern)
After:
- net462, net472, net481 (Windows legacy - minimum for Windows-only projects)
- net8.0, net9.0, net10.0 (cross-platform minimum)
- net8.0/9.0/10.0-windows10.0.19041.0 (Windows-specific features)
- iOS, tvOS, macOS, Android, MAUI targets unchanged
Co-authored-by: Christian Fischerauer [email protected]1 parent c53052f commit 708d77a
File tree
812 files changed
+49025
-35776
lines changed- .claude
- .github
- workflows
- src
- .claude
- ReactiveUI.AndroidX
- Builder
- ReactiveUI.Blazor
- Builder
- Internal
- ReactiveUI.Blend
- ReactiveUI.Drawing
- Builder
- ReactiveUI.Maui
- Builder
- Common
- Internal
- WinUI
- ReactiveUI.Testing.Reactive
- ReactiveUI.Testing
- ReactiveUI.WinUI
- Builder
- ReactiveUI.Winforms
- ReactiveUI.Wpf
- Binding
- Builder
- Common
- Rx/Linq
- ReactiveUI
- Activation
- Bindings
- Command
- Converters
- Converter
- Interaction
- Property
- Builder
- Expression
- Helpers
- Interfaces
- Legacy
- Mixins
- ObservableForProperty
- Platforms
- android
- apple-common
- Converters
- ios
- mac
- mobile-common
- netstandard2.0
- net
- tizen
- tvos
- uikit-common
- Polyfills
- ReactiveCommand
- ReactiveObject
- ReactiveProperty
- Registration
- Routing
- Suspension
- View
- examples/ReactiveUI.Builder.WpfApp
- Services
- ViewModels
- tests
- ReactiveUI.AOTTests
- ReactiveUI.Blazor.Tests
- ReactiveUI.Builder.Maui.Tests/Activation
- ReactiveUI.Builder.Tests
- Mixins
- ReactiveUI.Maui.Tests
- Builder
- ReactiveUI.NonParallel.Mobile.Tests
- ReactiveUI.NonParallel.Tests
- AutoPersist
- CommandBinding
- Commands
- Expression
- Locator
- Mocks
- Mixins
- Platforms
- windows-xaml
- winforms
- API
- Mocks
- wpf
- API
- Mocks
- Testing
- WhenAny
- ReactiveUI.Splat.Tests
- ReactiveUI.Test.Utilities
- AppBuilder
- Combined
- Logging
- MessageBus
- Schedulers
- Sequencing
- ReactiveUI.TestGuiMocks
- CommonGuiMocks
- Mocks
- ReactiveUI.Testing.Tests
- API
- ReactiveUI.Tests
- API
- Activation
- AutoPersist
- Bindings
- CommandBindings
- Converters
- PropertyBindings
- TypeConverters
- Binding
- CommandBinding
- Commands
- Mocks
- Comparers
- Core
- Expression
- Infrastructure
- StaticState
- InteractionBinding
- Locator
- MessageBus
- Mixins
- Mocks
- ObservableAsPropertyHelper
- Mocks
- ObservableForProperty
- ObservedChanged
- Mocks
- Properties
- ReactiveObjects
- Mocks
- ReactiveObject/Mocks
- ReactiveProperties
- Mocks
- Resolvers
- Suspension
- Utilities
- WhenAny
- Mockups
- ReactiveUI.WinForms.Tests
- API
- winforms
- Mocks
- ReactiveUI.Wpf.Tests
- API
- CommonGui
- ReactiveObjects/Mocks
- Utilities
- WhenAny/Mockups
- Wpf
- Mocks
- CanExecuteMock
- TransitionMock
- ViewModelViewHosts
- Xaml
- Api
- Mocks
- Utilities
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
812 files changed
+49025
-35776
lines changedThis file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
| |||
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
70 | | - | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
73 | | - | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
80 | 110 | | |
81 | 111 | | |
82 | 112 | | |
83 | 113 | | |
84 | | - | |
| 114 | + | |
85 | 115 | | |
86 | 116 | | |
87 | | - | |
| 117 | + | |
88 | 118 | | |
89 | 119 | | |
90 | 120 | | |
| |||
96 | 126 | | |
97 | 127 | | |
98 | 128 | | |
99 | | - | |
| 129 | + | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
103 | 133 | | |
104 | 134 | | |
105 | | - | |
| 135 | + | |
106 | 136 | | |
107 | 137 | | |
108 | | - | |
| 138 | + | |
109 | 139 | | |
110 | 140 | | |
111 | 141 | | |
| |||
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
121 | | - | |
122 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
123 | 154 | | |
124 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
125 | 159 | | |
126 | 160 | | |
127 | 161 | | |
| |||
528 | 562 | | |
529 | 563 | | |
530 | 564 | | |
531 | | - | |
| 565 | + | |
532 | 566 | | |
533 | 567 | | |
534 | 568 | | |
535 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
536 | 625 | | |
537 | 626 | | |
538 | 627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
0 commit comments