Skip to content

Conversation

@Mini-ghost
Copy link
Contributor

@Mini-ghost Mini-ghost commented Sep 10, 2023

In the current version (both v5 and v4), vue-query allows users to pass queryClientConfig in the options of VueQueryPlugin, which is of type MaybeRefDeep<QueryClientConfig>.

const app = createApp(App)

app.use(VueQueryPlugin, {
  // The current version of vue-query, here can be an object 
  // of type `QueryClientConfig`  or `MaybeRefDeep<QueryClientConfig>`
  queryClientConfig: {
  
  }
})

However, in the extended QueryClient, the queryClientConfig will be deep cloned and deep unwrapped, even though there is no need to track reactive data here.

Perhaps in the next version (v5), we can consider eliminating the flexible typing of queryClientConfig and exclusively use the QueryClientConfig type. This adjustment could reduce the unnecessary overhead of deep cloning and deep unwrapping ref objects.

@vercel
Copy link

vercel bot commented Sep 10, 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 Sep 10, 2023 7:10am

@nx-cloud
Copy link

nx-cloud bot commented Sep 10, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 7870c96. 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.

@codesandbox-ci
Copy link

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 7870c96:

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

@DamianOsipiuk DamianOsipiuk merged commit 6d159a7 into TanStack:beta Sep 10, 2023
@Mini-ghost Mini-ghost deleted the refactor/reduce-unnecessaary-clone branch September 28, 2023 20:03
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.

2 participants