Commit 778e779
committed
feat: add interface-based observation plugin system with affinity-based selection
Replace 7 static observation generator classes with an interface-based plugin
system where plugins compete by affinity to generate platform-specific,
reflection-free observation code. Affinity values now match ReactiveUI's exact
runtime values (KVO=15, ReactiveObject=10, WinForms=8, WinUI=6, INPC=5,
Android=5, WPF=4).
Each plugin generates code that mirrors the corresponding ReactiveUI runtime
implementation but without reflection:
- WPF: EventObservable with DependencyPropertyDescriptor.AddValueChanged
- WinUI: inline __WinUIDPObservable with RegisterPropertyChangedCallback
- WinForms: EventObservable with direct {Property}Changed event subscription
- KVO: inline __KVOObservable with NSObject.AddObserver and compile-time
resolved key paths (lowercase first char, boolean "is" prefix)
- INPC/ReactiveObject: PropertyObservable/PropertyChangingObservable
- Android: ReturnObservable fallback (no INPC on Android View)
Pipeline A simplified from 7 separate filter calls + Consolidate() to a single
plugin-based step via ObservationPluginRegistry.GetBestPlugin().
New runtime type EventObservable<T> provides platform-agnostic event-based
observation using pure BCL types (Action<EventHandler> add/remove pattern).
100% line and branch coverage maintained across the full solution (7236 tests).1 parent 4c5e858 commit 778e779
53 files changed
Lines changed: 3605 additions & 651 deletions
File tree
- src
- ReactiveUI.Binding.SourceGenerators
- CodeGeneration
- Generators
- Observation
- Plugins
- Observation
- ReactiveUI.Binding/Observables
- tests
- ReactiveUI.Binding.SourceGenerators.Tests
- CodeGeneration
- Plugins
- ReactiveUI.Binding.Tests/Observables
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
71 | 86 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 87 | + | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
Lines changed: 131 additions & 135 deletions
Large diffs are not rendered by default.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 0 additions & 42 deletions
This file was deleted.
0 commit comments