Skip to content

Referential stability for observer result objects#10265

Draft
zeorin wants to merge 2 commits intoTanStack:mainfrom
zeorin:feature/observer-result-object-referential-stability
Draft

Referential stability for observer result objects#10265
zeorin wants to merge 2 commits intoTanStack:mainfrom
zeorin:feature/observer-result-object-referential-stability

Conversation

@zeorin
Copy link

@zeorin zeorin commented Mar 13, 2026

🎯 Changes

  • Add result object property change notification to mutation observers. By default, property access is tracked and used to determine which properties to notify for.
  • Compare result objects to most recently returned results, if they are shallowly equal, return a reference to the previous object rather than a new object that is equal by value but not by reference.
  • When returning a proxy object for property access tracking, compare the previously tracked result and the new one only by the tracked properties, and if none of those have changed, return the previous reference.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr. (Didn't work for me, but npx nx run @tanstack/react-query:test:lib passes).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aea373c3-0e1f-4e8a-981a-da5ff37b906b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use oxc to improve the quality of JavaScript and TypeScript code reviews.

Add a configuration file to your project to customize how CodeRabbit runs oxc.

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: 0de67d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added documentation Improvements or additions to documentation package: react-query package: query-core labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package: query-core package: react-query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant