Preact Signals just got a huge performance boost: Signals rendered as text/props & effects only "pull" as fast as needed for rendering. Since computeds run as-needed, they now only re-run as often as their downstream DOM output can be painted. H/t to @jovidecroock.com for making this happen.
Post
This is possible because Preact Signals uses a two-phase design: changing a signal _notifies_ its dependencies that they need to recompute (top-down), but recomputation is only performed when each dependency's value is accessed (bottom-up). All we have to do is intelligently schedule the leaf reads!
2 reposts25 likes
No replies yet.