Ordering inside a flush
Ordering inside a flush in the Scheduler and timing guide.
A flush drains two queues. Render effects (DOM bindings) always run before user effects (useEffect, onMount). Inside a phase, effects run parents before children, and siblings in creation order.
A node never runs when an ancestor owner is about to re-run or dispose it in the same flush. That is what makes <Show when={user()}>{user().name}</Show>-style code safe: the child expression is not evaluated with a stale user().