Skip to content

feat(core): add support for comparing getter-only properties in shallow #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jiji-hoon96
Copy link
Contributor

  • Fix shallow comparison for objects with only getter properties
  • Add conditional logic to check getter properties when Object.keys() returns empty array
  • Use Object.getOwnPropertyDescriptors() to detect and compare getter values
  • Apply fix consistently across all framework packages (React, Vue, Svelte, Solid, Angular)
  • Add test case for getter-only objects to ensure proper functionality
  • Maintain backward compatibility and performance for regular objects

Fixes #218

…ow comparison

- Fix shallow comparison for objects with only getter properties (e.g., Temporal.Duration)
- Add conditional logic to check getter properties when Object.keys() returns empty array
- Use Object.getOwnPropertyDescriptors() to detect and compare getter values
- Apply fix consistently across all framework packages (React, Vue, Svelte, Solid, Angular)
- Add test case for getter-only objects to ensure proper functionality
- Maintain backward compatibility and performance for regular objects

Fixes TanStack#218
Copy link

nx-cloud bot commented Aug 13, 2025

View your CI Pipeline Execution ↗ for commit 2cfc458

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 55s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 11s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-13 04:44:26 UTC

Copy link

pkg-pr-new bot commented Aug 13, 2025

@tanstack/angular-store

npm i https://pkg.pr.new/@tanstack/angular-store@222

@tanstack/react-store

npm i https://pkg.pr.new/@tanstack/react-store@222

@tanstack/solid-store

npm i https://pkg.pr.new/@tanstack/solid-store@222

@tanstack/store

npm i https://pkg.pr.new/@tanstack/store@222

@tanstack/svelte-store

npm i https://pkg.pr.new/@tanstack/svelte-store@222

@tanstack/vue-store

npm i https://pkg.pr.new/@tanstack/vue-store@222

commit: 2cfc458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shallow doesn't correctly compare different object instances if they only have property getters
1 participant