fix(svelte-store): preserve selector object identity - #364
IdrisCelik wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesSvelte selector identity
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The selector now preserves object identity for unchanged selections, and the added regression test covers ignored state updates. The change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
Updated the Svelte adapter's
useSelectorto initialize selected state with$state.raw(...)instead of$state(...).This preserves raw object identity for the default strict equality comparator, preventing
state_proxy_equality_mismatchwarnings and unnecessary invalidations when object-valued selections have not changed.Added regression coverage for unchanged object selections and added a patch Changeset.
Fixes #363
✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
useSelectorso unchanged selected values preserve their identity.Tests
Chores