refactor(machine): drop the write-only version counter - #65
Open
ivanbanov wants to merge 4 commits into
Open
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes
MachineClass.version— a field bumped on everybump()but never read anywhere in the repo (packages, targets, tests, benchmark, sandboxes).Why
Its comment claimed:
But
computed.tsdoesn't use it: computed getters memoize via tracking proxies that record exactly whichcontext/computedkeys each def read, then compare per-key value snapshots instale(). 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— cleanversionis not on the publicMachinetype intypes.ts, so no consumer-facing change → no changeset🤖 Generated with Claude Code