Fix: Bind runtime effects to stable structural identity#52
Merged
Conversation
- derive modifier slots from structural paths - add position-independent keyed child identities - verify keyed state reorder and cleanup behavior
- derive lifecycle effects from structural modifier paths - retain tasks across unchanged renders and restart on ID changes - release callbacks and cancel tasks on true unmount - preserve inherited actor isolation for task operations
- hydrate dynamic properties immediately before body evaluation - persist State through a rebindable storage location - keep sibling state isolated from parent construction context - verify reconstruction, reorder, and unmount cleanup
- supersede stale callbacks by structural generation - invalidate only the observed subtree - remove registrations on unmount and runtime reset - verify repeated renders keep registry storage bounded
- verify task-driven State survives view reconstruction - assert mounted tasks do not restart unchanged - assert disappear callbacks run only on true unmount
- Replace production mutation of unsafe ambient render state - Preserve nested state, environment, and AppStorage binding scopes - Cover deterministic restoration across nested hydration
- Document final-identity state and observation binding - Describe stable lifecycle and mounted task slots - Align render-cycle examples with task-local hydration
- Include the owning StateStorage when deciding whether to rebind - Prevent identical structural paths from sharing boxes across runtimes - Add a focused cross-runtime regression test
- Carry active Observation registrations through skipped cached subtrees - Remove unrelated registrations at render-pass completion - Cover direct and descendant cache liveness
- Mark persisted State and onChange records below cache hits active - Keep descendant storage alive without evaluating cached bodies - Add a nested State cache regression test
This was referenced Jul 20, 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.
Summary
@Stateand Observation to committed view identities with task-local hydrationDynamic collection traversal and duplicate-ID diagnostics remain in #12, which consumes the keyed identity primitive added here. Exact public task API coverage remains in #21. Together with #51, this addresses #1.
Closes #10
Checklist
swift buildsucceeds on both)swift test)swiftlint)Test Plan