Version 0.18.4
Pre-release
Pre-release
What's Changed
Fixed
- Watched
invalidate()now respectsequalsat every graph level: Previously, callinginvalidate()from a Memo or Taskwatchedcallback propagatedFLAG_DIRTYdirectly to effect sinks, causing unconditional re-runs even when the recomputed value was unchanged. Nowinvalidate()delegates topropagate(node), which marks the node itselfFLAG_DIRTYand propagatesFLAG_CHECKto downstream sinks. During flush, effects verify their sources viarefresh()— if the memo'sequalsfunction determines the value is unchanged, the effect is cleaned without running. This eliminates unnecessary effect executions for watched memos with custom equality or stable return values.
Changed
propagate()supportsFLAG_CHECKfor effect nodes: The effect branch ofpropagate()now respects thenewFlagparameter instead of unconditionally settingFLAG_DIRTY. Effects are enqueued only on first notification; subsequent propagations escalate the flag (e.g.,CHECK→DIRTY) without re-enqueuing.flush()processesFLAG_CHECKeffects: The flush loop now callsrefresh()on effects with eitherFLAG_DIRTYorFLAG_CHECK, enabling the check-sources-first path for effects.- Task
invalidate()aborts eagerly: Task watched callbacks now abort in-flight computations immediately duringpropagate()rather than deferring torecomputeTask(), consistent with the normal dependency-change path.
Full Changelog: v0.18.3...v0.18.4