Replies: 1 comment 6 replies
-
Very cool. I can see some of the language here is already a departure from what v3 beta is today, right? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The bundle size of React Query has been increasing lately as more features are being added.
While the size increase is inevitable, it would be nice to only "pay" for what you use.
In the current V3 API, most functionality is tied together with
QueryClient
.This allows for easy discoverability and adds some convenience because everything is in one place.
The downside of this approach is that it cannot be tree-shaked.
This proposal explores how a different API with better tree shaking support would look like.
With the current set of features it reduces the bundle size from 36kB to 24kB (8.58 kB vs 6.67 kB gzipped) when only importing
useQuery
.As some might notice, the design is inspired by https://relay.dev/docs/en/relay-environment.
Beta Was this translation helpful? Give feedback.
All reactions