Skip to content
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

Old API used in Tanstack Query provider #5509

Open
Onxi95 opened this issue Jul 28, 2024 · 0 comments
Open

Old API used in Tanstack Query provider #5509

Onxi95 opened this issue Jul 28, 2024 · 0 comments

Comments

@Onxi95
Copy link

Onxi95 commented Jul 28, 2024

Describe the issue

  • Tanstack query changed its API in v5, renaming cacheTime to gcTime.
  • Since v4, query keys are always arrays

maas-ui version
maas-ui 3.6.0

Expected behavior

type QueryOptions = NonNullable<DefaultOptions>["queries"];

export const defaultQueryOptions: QueryOptions = {
  staleTime: 5 * 60 * 1000, // 5 minutes
  gcTime: 15 * 60 * 1000, // 15 minutes
  refetchOnWindowFocus: true,
};

export const realTimeQueryOptions: QueryOptions = {
  staleTime: 0,
  gcTime: 60 * 1000, // 1 minute
};
  • ternary from base.tsx might be removed
const queryModelKey = Array.isArray(queryKey) ? queryKey[0] : ""; // const queryModelKey = queryKey[0];

Additional context


Recently, I was experimenting with different cloud solutions, but then I found MAAS - looks quite interesting!

By statically reading the code, I found these small improvements. Unfortunately, I can't open a PR with my proposal as I have some issues with the local websocket proxy server - it seems like the MAAS local instance closes the connection immediately. "I'll try to prepare a reproduction demo on Ubuntu in the future. If the problem recurs, I'll open an issue on Launchpad. 🤞

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

No branches or pull requests

1 participant