Skip to content
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

[vue-query] shallow: false can lead to identity hazards #8055

Open
JoaoPedroAS51 opened this issue Sep 13, 2024 · 0 comments
Open

[vue-query] shallow: false can lead to identity hazards #8055

JoaoPedroAS51 opened this issue Sep 13, 2024 · 0 comments

Comments

@JoaoPedroAS51
Copy link

Describe the bug

Hi!

The changes introduced by #7733 can lead to identity hazards in dev mode, when shallow option is set to false.
Since the state is now shallowReactive, only the root level object is proxied. Using readonly makes nested objects proxied as well.

Your minimal, reproducible example

https://play.vuejs.org/#eNp9Us1OwkAQfpXJXpCEUBFPTUuihoMe1IA3lsPaTqHY7m52t4ipfXd3WwrFkF6aznw/881kS/Ig5XhfIPFJoCOVSgMaTSFnlKe5FMpACXrLskx8L5BFJt3jCBSyWPDsZ9SBjg0jFphoqCBRIoeBdR5QTnkkuLbOhhmE8L/hTQkxM8yHVQmJED4MPpkaQLWGangWtyT3ndgB4XHWTe06BM8DqUQM1/h3F/zLzEd9bRDjHn7beD4YVeBVv2nXr71Gj1HCMo2UB15zYntcWxjMZWYVtgIIpMLZsuFDG82Hspk6Wd2uIQzDZhlXQFUFntOcxP2iqSvOmsDrTCcjYrRdMkk3450W3L6F0tlSEolcphmqN2lSewRKrLlDHFZHfal77k6jth9tMfq60t/pg+tR8q5Qo9ojJSfMMLVB08Dz5Sse7P8JzEVcZJbdAy5Qi6xwGRvaY8FjG7vDq9M+1y865ZsPPT8Y5LpdygV1zKrmU2Kf7VPP6ue40/F9raO8ItUfwoMcyA==

Steps to reproduce

Check the comparison in the playground

Expected behavior

Nested objects are proxied in dev mode when shallow option is set to false, but not proxied in prod mode.
I expect dev and prod to behave the same.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 128.0.6613.120

Tanstack Query adapter

vue-query

TanStack Query version

v5.56.2

TypeScript version

No response

Additional context

No response

@JoaoPedroAS51 JoaoPedroAS51 changed the title Using readonly with shallowReactive in dev mode can lead to identity hazards [vue-query] shallow: false can lead to identity hazards Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants