Skip to content

refactor(machine): drop the write-only version counter - #65

Open
ivanbanov wants to merge 4 commits into
mainfrom
refactor/drop-dead-version-counter
Open

refactor(machine): drop the write-only version counter#65
ivanbanov wants to merge 4 commits into
mainfrom
refactor/drop-dead-version-counter

Conversation

@ivanbanov

Copy link
Copy Markdown
Member

What

Removes MachineClass.version — a field bumped on every bump() but never read anywhere in the repo (packages, targets, tests, benchmark, sandboxes).

Why

Its comment claimed:

Monotonic counter bumped on every notify — lets computed memoize without per-field tracking.

But computed.ts doesn't use it: computed getters memoize via tracking proxies that record exactly which context/computed keys each def read, then compare per-key value snapshots in stale(). The counter is a leftover from the pre-proxy memoization design — write-only state with a comment describing a mechanism that no longer exists.

Checks

  • pnpm test:ci — 2292/2292 tests pass (the 2 failing suites are in the local .worktrees/solid/ checkout, pre-existing and unrelated)
  • pnpm typecheck, pnpm lint, pnpm format:check — clean
  • version is not on the public Machine type in types.ts, so no consumer-facing change → no changeset

🤖 Generated with Claude Code

The version field was bumped on every notify but never read anywhere —
its comment claimed computed memoizes through it, while computed.ts
actually tracks per-field deps via proxies and value snapshots. Leftover
from the pre-proxy memoization design.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dunky-state-machine Ready Ready Preview Aug 19, 2026 2:57pm

A nested bump() rebuilds busSnapshot and clears busDirty, so the outer
pass lost its mid-pass-churn signal and could call a listener that was
unsubscribed during the pass. Detect the swap by snapshot identity too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stopEffects() bailed on the first throwing cleanup: the remaining
cleanups leaked (timers, subscriptions) and the list stayed populated,
so the next stop re-ran the whole pass. Run every cleanup, clear the
list, rethrow the first error after the pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
get select() rebuilt the facade (function + 3 method closures) on every
access. Build once, reuse — the facade is stateless, and the stable
identity is now guaranteed (safe for dependency arrays).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant