[XAML Hot Reload] Reconcile complex property and collection updates
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 297
Description
### Description
The source-generator incremental XAML Hot Reload writer currently declines several element-valued, attached, and collection-shaped mutations instead of reconciling the existing live object graph. Generated `UpdateComponent` code emits explicit `skipped`/`untouched` markers, so the app remains running, but the requested edit is not applied.
The affected behavior families share one architectural requirement: rebuild or reconcile a complex subtree while preserving lifecycle semantics and current runtime state. The planned regression suite in #36730 covers:
- active `VisualStateManager.VisualStateGroups` setter edits and state add/remove/re-add fallback
- `Behaviors` remove/re-add with exactly-once detach/attach
- merged dictionary reorder/removal and winner recomputation
- `Style.BasedOn` and trigger removal/re-attachment
- `MultiBinding` child remove/re-add without duplicate expressions
- `BindableLayout.ItemTemplate` replacement without duplicate generated children
- non-root/nested resource dictionaries and custom converter resources
These are intentionally tracked together because fixing them independently with ad hoc assignments would risk stale state, duplicate subscriptions, orphaned children, or incorrect resource precedence.
### Steps to Reproduce
1. Enable source-generator incremental XAML Hot Reload on the `net11.0` branch.
2. Create a live page containing one of the structures above, for example a `Label` in an active visual state with a `BackgroundColor` setter.
3. Apply a XAML update that changes the active setter, removes and re-adds the state, reorders merged dictionaries, removes/re-adds a behavior, or changes another complex collection.
4. Inspect the generated `UpdateComponent` source and the retained live object.
Expected: the edit is applied to the retained object; removal restores the correct local/style/default fallback; re-add creates one current object/subscription; current state and unrelated object identity are preserved.
Actual: generated code emits an explicit complex-property/attached-property `skipped` or `untouched` marker and the live graph keeps the previous structure/state.
Draft PR #36730 adds green documentation guards plus skip-gated live probes for these scenarios so each can be enabled as reconciliation support lands.
### Link to public reproduction project repository
https://github.com/dotnet/maui/pull/36730
### Version with bug
Nightly / CI build (current `net11.0` source-generator incremental Hot Reload implementation)
### Is this a regression from previous behavior?
Not sure, did not test other versions
### Last version that worked well
Unknown/Other
### Affected platforms
iOS, Android, Windows, and macOS. The gap is in cross-platform generated update code; individual handler/host effects may vary.
### Affected platform versions
Not platform-version-specific.
### Did you find any workaround?
Use a full rebuild/restart for these structural edits. The generator intentionally declines unsupported mutations rather than emitting a potentially corrupt partial update.
### Relevant log output
Generated `UpdateComponent` output contains comments such as `Complex property '' ... skipped (not yet supported)`, `Complex attached property '' ... skipped`, or resource entries marked `untouched`.
Contributor guide
Research direction
Start with the generated UpdateComponent output and the source-generator incremental XAML Hot Reload implementation, then review the skip-gated probes and documentation guards in PR #36730. Done means the listed complex-property, attached-property, collection, and resource edits reconcile retained live objects with correct fallback, identity, and exactly-once subscriptions without skipped or untouched markers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100