Kudzu 0.8.5 - Owned timer actions
Kudzu 0.8.5 compiles one proven private timeout ref pattern from a returned relative custom-hook action into existing state and effect ownership.
What landed
- Allow one returned relative custom-hook callback to replace one private
useRef<number | null>(null)timeout with a numeric literal delay. - Clear the latest timer through one empty-dependency effect during conditional unmount; remount creates fresh ownership.
- Lower the private ref to a collision-free hidden state slot shared by existing native-handler and effect contexts.
- Support named, default-arrow, and relative re-export hook forms with independent timer identities.
- Verify replacement, latest-only firing, unmount cancellation, fresh remount, and dynamic-delay diagnostics in Chrome.
- Add no timer scheduler or runtime; static siblings remain JavaScript-free.
- Pass the complete 134/134 test suite.
Boundary
The hook may own one private timeout ref with one direct returned callback, one literal delay, and one direct cleanup effect. Multiple refs, aliases, dynamic delays, intervals, keyed ownership, indirect callbacks, and arbitrary timed graphs remain unsupported.
Upgrade
npm install @kudzujs/core@^0.8.5