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 |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
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.
oyobbeb
force-pushed
the
fix/lit-selector-host-sync
branch
from
November 23, 2026 05:50
10d5c85 to
e167e9b
Compare
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.
🎯 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