Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/okikio/solid-motion-experiments.
Something went wrong. Try again.
Solid Reactivity Map #
Purpose #
Define the Solid reactive model contracts the Motion adapter can safely rely on.
Docs Contract #
createSignalprovides accessor/setter state. Accessor reads inside tracked scopes subscribe dependents.createEffecttracks reads and reruns on dependency changes.createRenderEffectruns in render timing and is earlier thancreateEffect.createRootcreates an owner boundary with explicit disposal.onCleanupteardown is owner-scoped and called on disposal or scope rerun.batchcoalesces update propagation.untrackreads without subscription.
Source Confirmation #
From Solid reactive internals (packages/solid/src/reactive/signal.ts):
- Signals store observers and observer slots.
- Computations store sources and source slots.
- Owners hold
ownedandcleanupstrees. onCleanuppushes cleanup callbacks to current owner.cleanNoderecursively disposes descendants and invokes cleanups.batchdelegates to update queue (runUpdates).untracktemporarily clears listener tracking.
Adapter Implications #
- Motion prop observation must happen in tracked effects, not in component setup.
- Never depend on private internals (owner tree shape, queue implementation).
- Use public primitives only:
- tracking:
createEffectandcreateRenderEffect - lifecycle:
onMount,onCleanup,createRoot - control:
batch,untrack
- tracking:
Safe To Rely On #
- Accessor tracking semantics.
- Owner-based cleanup cascade.
batchupdate coalescing behavior.untracksubscription suppression.
Must Stay Behind Adapter #
- Any assumptions about scheduler queue internals.
- Any assumptions about computation ordering beyond documented guarantees.
Open Risks #
- Solid 2 may adjust scheduling and owner internals.
- Adapter must isolate timing semantics from upstream internal churn.