urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.54k stars 444 forks source link

Use shallowRef instead of ref for deep objects #3611

Closed negezor closed 2 weeks ago

negezor commented 2 weeks ago

Summary

Instead of using ref for deep objects, it is much more efficient from a performance point of view to look at reactivity only at the moment of setting the value, rather than changing its internal properties.

Set of changes

I don't consider this a breaking change since these properties should always be considered read-only. Since properties are always overwritten completely, and nested reactivity is not needed in them. Because changing them will not lead to the desired result in most cases.

changeset-bot[bot] commented 2 weeks ago

🦋 Changeset detected

Latest commit: f5136a4aa7553e089412ebcd3a7cade3d8f3b361

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------- | ----- | | @urql/vue | Minor |

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