v0.6.73: zustand v5 migration fix #4540
Conversation
* fix(zustand): v5 selector stability issues * address comments
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Adds a Reviewed by Cursor Bugbot for commit 13666b1. Configure here. |
Greptile SummaryThis PR fixes Zustand v5 selector stability issues across multiple components and hooks, replacing whole-store subscriptions and
Confidence Score: 3/5Safe to merge for all React component changes; the script inconsistency in sync-tool-catalog.ts will break the mship-tools:check CI step on the next contract regeneration. The component-level Zustand fixes are correct and well-structured. In sync-tool-catalog.ts, formatGeneratedSource is applied to the main catalog output but not to runtimeSchemaRendered, while tool-schemas-v1.ts was committed with biome-formatted single-quote bracket notation. The generator emits double-quote bracket notation via JSON.stringify, so the check-mode string comparison will mismatch on the next run. scripts/sync-tool-catalog.ts needs formatGeneratedSource applied to runtimeSchemaRendered, matching the pattern already used in sync-mothership-stream-contract.ts. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Component renders] --> B{Selector type}
B -->|Primitive value| C["useStore(s => s.field)"]
B -->|Object or multiple fields| D["useStore(useShallow(s => object))"]
B -->|Derived array or collection| E["useStoreWithEqualityFn(store, selector, isEqual)"]
B -->|Store action only| F["getState at module scope"]
C --> G["Object.is equality"]
D --> H["shallow equality"]
E --> I["deep equality"]
F --> J["No subscription"]
G --> K[Re-render only on value change]
H --> K
I --> K
J --> L[Zero re-renders for actions]
Reviews (1): Last reviewed commit: "fix(zustand): v5 selector stability issu..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 13666b1. Configure here.

fix(zustand): v5 selector stability issues (#4539)
fix(script): biome format wrap (#4541)
improvement(deps): remove unused remark deps (#4542)