Repository navigation
Conversation
🦋 Changeset detectedLatest commit: e167e9b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
hostUpdate returned early while the store stayed the same, so a selector that reads host properties kept its old value. After the host was moved in the DOM, nothing subscribed again, so later store updates were ignored. The selector now runs again on each host update, and the subscription follows the host: it is set up again on reconnect, and an update that runs after the host is removed no longer subscribes. The selected value is kept across a move, so compare still decides when it changes.
10d5c85 to
e167e9b
Compare
🎯 Changes
TanStackStoreSelector, andTanStackStoreAtomwhich wraps it, could get out of sync with its host:hostUpdate()returned early while the store stayed the same. A selector that reads host properties, like(state) => state[this.animal]in the Lit quick start, kept showing the old selection after the property changed.hostDisconnected()unsubscribes, but nothing subscribed again on reconnect. After the element was moved in the DOM (for example by a keyedrepeatreorder), store updates were ignored.This change:
comparesays it is equal;hostConnected(), so the subscription is set up again after a move;.valuewhen nothing changed.The select-and-compare step moved into a
#select()method thathostUpdate()and the subscription share. With the default===compare, a selector that builds a new object or array now returns a new.valueon each host update, asuseSelectordoes in React;compare: shallowkeeps it stable.✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit