Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: upgrade tanstack/react-query to 5.77.0#18039

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 6 commits intomainfrombq/migrate-to-tanstack-query-5
May 26, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletionssite/.storybook/preview.jsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,7 @@ import { DecoratorHelpers } from "@storybook/addon-themes";
import isChromatic from "chromatic/isChromatic";
import { StrictMode } from "react";
import { HelmetProvider } from "react-helmet-async";
import { QueryClient, QueryClientProvider, parseQueryArgs } from "react-query";
import { QueryClient, QueryClientProvider } from "react-query";
import { withRouter } from "storybook-addon-remix-react-router";
import "theme/globalFonts";
import themes from "../src/theme";
Expand DownExpand Up@@ -114,20 +114,7 @@ function withQuery(Story, { parameters }) {

if (parameters.queries) {
for (const query of parameters.queries) {
if (query.isError) {
// Based on `setQueryData`, but modified to set the result as an error.
const cache = queryClient.getQueryCache();
const parsedOptions = parseQueryArgs(query.key);
const defaultedOptions = queryClient.defaultQueryOptions(parsedOptions);
// Adds an uninitialized response to the cache, which we can now mutate.
const cachedQuery = cache.build(queryClient, defaultedOptions);
// Setting `manual` prevents retries.
cachedQuery.setData(undefined, { manual: true });
// Set the `error` value and the appropriate status.
cachedQuery.setState({ error: query.data, status: "error" });
} else {
queryClient.setQueryData(query.key, query.data);
}
queryClient.setQueryData(query.key, query.data);
}
}

Expand Down
4 changes: 2 additions & 2 deletionssite/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,7 @@
"@radix-ui/react-slot": "1.1.1",
"@radix-ui/react-switch": "1.1.1",
"@radix-ui/react-tooltip": "1.1.7",
"@tanstack/react-query-devtools": "4.35.3",
"@tanstack/react-query-devtools": "5.77.0",
"@xterm/addon-canvas": "0.7.0",
"@xterm/addon-fit": "0.10.0",
"@xterm/addon-unicode11": "0.8.0",
Expand DownExpand Up@@ -103,7 +103,7 @@
"react-dom": "18.3.1",
"react-helmet-async": "2.0.5",
"react-markdown": "9.0.3",
"react-query": "npm:@tanstack/react-query@4.35.3",
"react-query": "npm:@tanstack/react-query@5.77.0",
"react-router-dom": "6.26.2",
"react-syntax-highlighter": "15.6.1",
"react-virtualized-auto-sizer": "1.0.24",
Expand Down
98 changes: 23 additions & 75 deletionssite/pnpm-lock.yaml
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 1 addition & 1 deletionsite/src/api/queries/chats.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ export const createChat = (queryClient: QueryClient) => {
return {
mutationFn: API.createChat,
onSuccess: async () => {
await queryClient.invalidateQueries(["chats"]);
await queryClient.invalidateQueries({ queryKey:["chats"] });
},
};
};
Expand Down
4 changes: 2 additions & 2 deletionssite/src/api/queries/debug.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ export const health = () => ({
export const refreshHealth = (queryClient: QueryClient) => {
return {
mutationFn: async () => {
await queryClient.cancelQueries(HEALTH_QUERY_KEY);
await queryClient.cancelQueries({ queryKey:HEALTH_QUERY_KEY });
const newHealthData = await API.getHealth(true);
queryClient.setQueryData(HEALTH_QUERY_KEY, newHealthData);
},
Expand All@@ -38,7 +38,7 @@ export const updateHealthSettings = (
return {
mutationFn: API.updateHealthSettings,
onSuccess: async (_, newSettings) => {
await queryClient.invalidateQueries(HEALTH_QUERY_KEY);
await queryClient.invalidateQueries({ queryKey:HEALTH_QUERY_KEY });
queryClient.setQueryData(HEALTH_QUERY_SETTINGS_KEY, newSettings);
},
};
Expand Down
8 changes: 6 additions & 2 deletionssite/src/api/queries/externalAuth.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,9 @@ export const exchangeExternalAuthDevice = (
queryKey: ["external-auth", providerId, "device", deviceCode],
onSuccess: async () => {
// Force a refresh of the Git auth status.
await queryClient.invalidateQueries(["external-auth", providerId]);
await queryClient.invalidateQueries({
queryKey: ["external-auth", providerId],
});
},
};
};
Expand All@@ -57,7 +59,9 @@ export const unlinkExternalAuths = (queryClient: QueryClient) => {
return {
mutationFn: API.unlinkExternalAuthProvider,
onSuccess: async () => {
await queryClient.invalidateQueries(["external-auth"]);
await queryClient.invalidateQueries({
queryKey: ["external-auth"],
});
},
};
};
22 changes: 13 additions & 9 deletionssite/src/api/queries/groups.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -117,10 +117,12 @@ export const createGroup = (queryClient: QueryClient, organization: string) => {
mutationFn: (request: CreateGroupRequest) =>
API.createGroup(organization, request),
onSuccess: async () => {
await queryClient.invalidateQueries(groupsQueryKey);
await queryClient.invalidateQueries(
getGroupsByOrganizationQueryKey(organization),
);
await queryClient.invalidateQueries({
queryKey: groupsQueryKey,
});
await queryClient.invalidateQueries({
queryKey: getGroupsByOrganizationQueryKey(organization),
});
},
};
};
Expand DownExpand Up@@ -169,11 +171,13 @@ const invalidateGroup = (
groupId: string,
) =>
Promise.all([
queryClient.invalidateQueries(groupsQueryKey),
queryClient.invalidateQueries(
getGroupsByOrganizationQueryKey(organization),
),
queryClient.invalidateQueries(getGroupQueryKey(organization, groupId)),
queryClient.invalidateQueries({ queryKey: groupsQueryKey }),
queryClient.invalidateQueries({
queryKey: getGroupsByOrganizationQueryKey(organization),
}),
queryClient.invalidateQueries({
queryKey: getGroupQueryKey(organization, groupId),
}),
]);

function sortGroupsByName<T extends Group>(
Expand Down
4 changes: 3 additions & 1 deletionsite/src/api/queries/idpsync.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,9 @@ export const patchOrganizationSyncSettings = (queryClient: QueryClient) => {
mutationFn: (request: OrganizationSyncSettings) =>
API.patchOrganizationIdpSyncSettings(request),
onSuccess: async () =>
await queryClient.invalidateQueries(getOrganizationIdpSyncSettingsKey()),
await queryClient.invalidateQueries({
queryKey: getOrganizationIdpSyncSettingsKey(),
}),
};
};

Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp