Upgrade react-query

This commit is contained in:
Alex Gleason 2024-10-13 18:28:26 -05:00
parent ad0046c4f4
commit ad6e1bc099
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
6 changed files with 25 additions and 17 deletions

View File

@ -71,7 +71,7 @@
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/react-query": "^5.0.0",
"@tanstack/react-query": "^5.59.13",
"@types/escape-html": "^1.0.1",
"@types/http-link-header": "^1.0.3",
"@types/leaflet": "^1.8.0",

View File

@ -1,11 +1,14 @@
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { useApi } from 'soapbox/hooks';
import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance';
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
interface Opts {
/** The base URL of the instance. */
baseUrl?: string;
enabled?: boolean;
retryOnMount?: boolean;
staleTime?: number;
}
/** Get the Instance for the current backend. */

View File

@ -1,11 +1,14 @@
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { useApi } from 'soapbox/hooks';
import { InstanceV2, instanceV2Schema } from 'soapbox/schemas/instance';
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
interface Opts {
/** The base URL of the instance. */
baseUrl?: string;
enabled?: boolean;
retryOnMount?: boolean;
staleTime?: number;
}
/** Get the Instance for the current backend. */

View File

@ -115,7 +115,7 @@ const Announcements: React.FC = () => {
emptyMessage={emptyMessage}
itemClassName='py-3 first:pt-0 last:pb-0'
isLoading={isLoading}
showLoading={isLoading && !announcements?.length}
showLoading={isLoading}
>
{announcements!.map((announcement) => (
<Announcement key={announcement.id} announcement={announcement} />

View File

@ -1,4 +1,3 @@
import { UseQueryOptions } from '@tanstack/react-query';
import { useEffect, useMemo } from 'react';
import { HTTPError } from 'soapbox/api/HTTPError';
@ -8,9 +7,12 @@ import { instanceV2Schema, upgradeInstance } from 'soapbox/schemas/instance';
import { useAppDispatch } from './useAppDispatch';
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
interface Opts {
/** The base URL of the instance. */
baseUrl?: string;
enabled?: boolean;
retryOnMount?: boolean;
staleTime?: number;
}
/** Get the Instance for the current backend. */

View File

@ -2398,17 +2398,17 @@
lodash.merge "^4.6.2"
postcss-selector-parser "6.0.10"
"@tanstack/query-core@5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.0.0.tgz#b37a50bb3a4f54336b6131db00b72cd29e79b480"
integrity sha512-Y1BpiA6BblJd/UlVqxEVeAG7IACn568YJuTTItAiecBI7En+33g780kg+/8lhgl+BzcUPN7o+NjBrSRGJoemyQ==
"@tanstack/query-core@5.59.13":
version "5.59.13"
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.59.13.tgz#8c962980af174bbd446b7e9b9999f7432897df80"
integrity sha512-Oou0bBu/P8+oYjXsJQ11j+gcpLAMpqW42UlokQYEz4dE7+hOtVO9rVuolJKgEccqzvyFzqX4/zZWY+R/v1wVsQ==
"@tanstack/react-query@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.0.0.tgz#707fecb71cf53ae098f682f45520d7b1640bcaa9"
integrity sha512-diQoC8FNBcO5Uf5yuaJlXthTtbO1xM8kzOX+pSBUMT9n/cqQ/u1wJGCtukvhDWA+6j07WmIj4bfqNbd2KOB6jQ==
"@tanstack/react-query@^5.59.13":
version "5.59.13"
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.59.13.tgz#decac9c15ddc29a54dc3520a41a1dcedb1a9596a"
integrity sha512-GB2ELtiH8tL0rcFiM4sWvnXhazt1xRXX/LolMEV12kfEKu58aNA4lQoieslP61PO4vZO9JJMwm+6lqyS0E1HOA==
dependencies:
"@tanstack/query-core" "5.0.0"
"@tanstack/query-core" "5.59.13"
"@testing-library/dom@^9.0.0":
version "9.0.1"