|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
How to map concepts you already know — Qt Signals/Slots, RxCpp, and WPF / .NET MVVM — onto Aria. This is a cheat-sheet, not a tutorial; see docs/guide/ for the full walkthroughs.
| Qt | Aria | Notes |
|---|---|---|
| QObject property + NOTIFY signal | Property<T> | set() auto-notifies; equality-gated. |
| connect(obj, &Cls::sig, ...) | prop.on_changed(fn) / prop.bind(fn) | Returns a RAII Subscription; drop it to disconnect. |
| Q_PROPERTY computed getter | Computed<T>([&]{ ... }) | Auto-tracks reads; no explicit dependency list. |
| QObject::deleteLater lifetime juggling | Subscription / SubscriptionBag | Weak-guarded disconnect; no use-after-free. |
| QAbstractListModel | ObservableList<T> + qt_list_model_adapter | Fine-grained Insert/Remove/Move/Replace diff stream. |
| QAction::setEnabled wiring | Command<> + bind_command | enabled auto-tracks the predicate. |
| Manual QObject thread affinity | reactive graph is single-thread; marshal via runtime::Dispatcher | See docs/reference/lifecycle.md. |
| Rx | Aria | Notes |
|---|---|---|
| BehaviorSubject<T> | Property<T> | Holds a current value, multicasts changes. |
| observable::combine_latest | combine_latest(a, b, fn) (property_ops.hpp) | Or Computed for the glitch-free graph path. |
| map | Computed / scan's projection | Computed is the idiomatic map. |
| scan / reduce | scan(source, seed, reducer) | In property_ops.hpp. |
| distinctUntilChanged | built-in (Property equality gate) or distinct_until_changed(p) | Property already drops equal-value writes. |
| debounceTime | debounce(p, 300ms, scheduler) | Needs an IDelayedScheduler. |
| throttleFirst | throttle(p, cooldown, scheduler) | Leading-edge. |
| Subscription / CompositeDisposable | Subscription / SubscriptionBag | Same RAII model. |
| ObserveOn(scheduler) | EventBus::subscribe_on(dispatcher, ...) / co_await schedule_on(exec) | |
| cold observable / Task | aria::async::Task<T> | Lazy, single-shot, exception-safe. |
| WPF / .NET | Aria | Notes |
|---|---|---|
| INotifyPropertyChanged + backing field | Property<T> | No boilerplate OnPropertyChanged. |
| ICommand / RelayCommand | Command<Args...> | CanExecute predicate auto-tracks reactive reads. |
| CommandManager.RequerySuggested | automatic for Command<> | The built-in Effect re-evaluates can_execute. |
| ObservableCollection<T> | ObservableList<T> | + CollectionView ≈ FilteredList/SortedList/MappedList. |
| CollectionView filter/sort/group | FilteredList / SortedList / GroupedList (aria/derived/) | Reactive, incremental. |
| IValueConverter | Converter<T, std::string> + bind_text_converted | Two-way with try_to_model. |
| {Binding Mode=TwoWay} | bind_text / bind_int / ... | One-way variants are bind_*_oneway. |
| SelectedItem / SelectedItems | Selection<T> / MultiSelection<T> (aria/selection.hpp) | Reactive; bind_to(list) follows source mutations. |
| Dispatcher.Invoke | runtime::IDispatcher::post / BindingEngine SmartMarshal policy | |
| async/await + CancellationToken | Task<T> + co_await + CancellationToken | View-destroy cancel via bind_view_lifetime. |
Upgrade the bundled web SDK with the HTTP adapter. Safe 64-bit integers remain Numbers; values beyond ±9007199254740991 are decimal strings on the wire and BigInt in the SDK. Use bigint or decimal-string setter input for exact values; unsafe Number input is rejected. Convert BigInt explicitly when serializing with JSON.stringify. New SDKs reject unsafe numeric protocol 1 events rather than accepting rounded data.
HTTP worker counts now take effect: use 0 for automatic sizing or an explicit count of at least 2. SSE admission is capped at workers minus one even when max_sse_clients is 0. Invalid field types/ranges return 400; unknown views return