-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RTKQ: configurable structuralSharing
on endpoints/queries/createApi
#1954
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e7820d1:
|
size-limit report 📦
|
@phryneas Do you think it's a better idea to consider doing this at the endpoint level as well instead of an all or nothing approach? |
Wanted to comment on that one - yes, I'd prefer this as a non-global escape hatch. |
bf02e4b
to
42b115f
Compare
42b115f
to
e4c6be8
Compare
Alright, updated so that the order of precedence is |
structuralSharing
on endpoints/queries/createApi
Addresses #1896.
For the example in that issue, there isn't much that can be done outside of just disabling the structural sharing optimization. This PR enables that by adding a flag to
createApi
, accepting a flag on an individual query endpoint, and allowing a hook/initiate to specify the desired value.