Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/okikio/solid-motion-experiments.
Something went wrong. Try again.
Solid Control Flow Presence Map #
Purpose #
Define how Solid control-flow disposal interacts with Motion exit retention.
Core Problem #
When <Show> or <For> removes a child, logical removal can dispose owner state immediately. Exit animations require physical DOM retention beyond logical removal.
Required Distinction #
- Logical presence: key still included by parent control-flow conditions/data.
- Physical presence: node/owner kept alive long enough to finish exit.
Minimal Retention Algorithm #
- Render keyed present set.
- Diff previous keys to current keys.
- Move missing keys to exiting registry.
- Keep exiting nodes physically present.
- Mark exiting context as not-present.
- Remove only on exit-complete signal.
- Ensure dispose runs exactly once.
Adapter Implications #
- The current prototype keeps retention local to
AnimatePresencerather than treatingcreateRootby itself as the presence strategy. - Presence implementation must explicitly retain and release the disappearing direct child record.
- Nested exits still require completion aggregation before parent removal, which is why
PresenceChildsits betweenAnimatePresenceand motion descendants.
Required Prototype Checks #
<Show>close keeps child alive until fake exit complete.- Single-slot
AnimatePresencekeeps one disappearing direct child alive until exit completes. <For>keyed removal remains later work beyond the current prototype scope.- Rapid remove/readd does not duplicate nodes.
- Cleanup and deregistration each occur once.
Safe To Rely On #
- Owner cleanup cascade exists.
- Control-flow removes logical children when conditions/data change.
Must Stay Experimental In Milestone 0 #
- Keyed-list presence orchestration.
- Full AnimatePresence parity semantics beyond the current single-slot
syncandwaitmodes.