Skip to content

refactor(query-core): Make MutationMeta and QueryMeta generic#5804

Closed
vojvodics wants to merge 2 commits intoTanStack:betafrom
vojvodics:refactor/query-mutation-meta-generic
Closed

refactor(query-core): Make MutationMeta and QueryMeta generic#5804
vojvodics wants to merge 2 commits intoTanStack:betafrom
vojvodics:refactor/query-mutation-meta-generic

Conversation

@vojvodics
Copy link

Reopening #5457 to the beta branch

@vercel
Copy link

vercel bot commented Jul 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Aug 15, 2023 1:54pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 29, 2023

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 484d0a4:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@nx-cloud
Copy link

nx-cloud bot commented Aug 15, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 484d0a4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@TkDodo
Copy link
Collaborator

TkDodo commented Aug 15, 2023

Hm, I would still advise to not put functions into meta. with v5, meta will be serialized across boundaries with our hydration utils when:

  • using a persister
  • using SSR

it would also be necessary that these functions are pure and do not reference anything from their closures...

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: +89.71% 🎉

Comparison is base (7f69223) 0.00% compared to head (484d0a4) 89.71%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff            @@
##           beta    #5804       +/-   ##
=========================================
+ Coverage      0   89.71%   +89.71%     
=========================================
  Files         0       66       +66     
  Lines         0     2138     +2138     
  Branches      0      529      +529     
=========================================
+ Hits          0     1918     +1918     
- Misses        0      190      +190     
- Partials      0       30       +30     

see 66 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vojvodics
Copy link
Author

Thanks for the explanation! I agree that it's easy to make a mistake if you're not careful and don't understand all the problems that come with it.
Using generics in meta doesn't restrict you to only functions, but can still provide type safety (e.g. using fields of the property as keys in meta).

Feel free to close the PR if you think this is not something you should support.

@TkDodo TkDodo closed this Sep 8, 2023
@vojvodics vojvodics deleted the refactor/query-mutation-meta-generic branch September 8, 2023 12:40
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.

3 participants