Skip to content

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

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

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

Conversation

@vojvodics

Copy link
Copy Markdown

Reopening #5457 to the beta branch

@vercel

vercelBot commented Jul 29, 2023

Copy link
Copy Markdown

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

1 Ignored Deployment
NameStatusPreviewCommentsUpdated (UTC)
query⬜️ Ignored (Inspect)Visit PreviewAug 15, 2023 1:54pm

@codesandbox-ci

codesandbox-ciBot commented Jul 29, 2023

Copy link
Copy Markdown

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:

SandboxSource
@tanstack/query-example-react-basic-typescriptConfiguration
@tanstack/query-example-solid-basic-typescriptConfiguration
@tanstack/query-example-svelte-basicConfiguration
@tanstack/query-example-vue-basicConfiguration

@nx-cloud

nx-cloudBot commented Aug 15, 2023

Copy link
Copy Markdown

☁️ 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
Copy Markdown
Collaborator

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
Copy Markdown

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
Copy Markdown
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.

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

@vojvodics@TkDodo@codecov-commenter