Repository navigation
Conversation
Replacing x-data reads each property's old value through the reactive proxy, so old getters ran without access to the parent scope. Swap old accessors for plain values on the raw object before reconciling, and detect accessors consistently with isAccessor(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #4933
Since #4868, changing an element's x-data expression reuses its reactive object via reconcileData(). Getter keys were removed with delete target[key] through the reactive proxy, and the proxy's deleteProperty trap reads the old value first. That invokes the old getter with this bound to the raw data object instead of the merged scope, so parent-scope properties are undefined. If the getter throws, reconciliation aborts partway: remaining keys aren't updated and the element never gets its scope back, so new x-for clones fail with "X is not defined".
This swaps old accessors for plain undefined values on the raw object before reconciling. The proxy traps then never call an old getter or setter, but they still fire, so effects that depended on a replaced getter re-run with the new one. Plain data keys behave exactly as they did after #4868.
Tests cover the reproduction from the issue, that old getters are never invoked during reconciliation (replaced or removed), and that effects depending on a replaced getter re-run.
🤖 Generated with Claude Code