diff --git a/apps/wallet-mobile/.storybook/decorators/query.tsx b/apps/wallet-mobile/.storybook/decorators/query.tsx index e5016f1dd1..20a66d6cc9 100644 --- a/apps/wallet-mobile/.storybook/decorators/query.tsx +++ b/apps/wallet-mobile/.storybook/decorators/query.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {Boundary} from '../../src/components/Boundary/Boundary' diff --git a/apps/wallet-mobile/_package.json b/apps/wallet-mobile/_package.json index 7d6eb7eaf6..cc4a7390ae 100644 --- a/apps/wallet-mobile/_package.json +++ b/apps/wallet-mobile/_package.json @@ -198,7 +198,7 @@ "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.8.0", "react-native-webview": "^13.8.1", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "reselect": "^4.0.0", "rxjs": "7.8.1", "sentry-expo": "^7.0.1", diff --git a/apps/wallet-mobile/src/YoroiApp.tsx b/apps/wallet-mobile/src/YoroiApp.tsx index 97c06b05aa..6f7b34cb5c 100644 --- a/apps/wallet-mobile/src/YoroiApp.tsx +++ b/apps/wallet-mobile/src/YoroiApp.tsx @@ -7,7 +7,7 @@ import {LogBox, StyleSheet} from 'react-native' import * as RNP from 'react-native-paper' import {initialWindowMetrics, SafeAreaProvider} from 'react-native-safe-area-context' import {enableFreeze, enableScreens} from 'react-native-screens' -import {QueryClientProvider} from 'react-query' +import {QueryClientProvider} from '@tanstack/react-query' import {LoadingBoundary} from './components/Boundary/Boundary' import {ErrorBoundary} from './components/ErrorBoundary/ErrorBoundary' diff --git a/apps/wallet-mobile/src/components/Boundary/Boundary.stories.tsx b/apps/wallet-mobile/src/components/Boundary/Boundary.stories.tsx index f48e1f3b0a..99132a74a0 100644 --- a/apps/wallet-mobile/src/components/Boundary/Boundary.stories.tsx +++ b/apps/wallet-mobile/src/components/Boundary/Boundary.stories.tsx @@ -1,7 +1,7 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' import {ActivityIndicator, Button, StyleSheet, Text, View} from 'react-native' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {QueryProvider} from '../../../.storybook/decorators' import {errorMessages} from '../../kernel/i18n/global-messages' diff --git a/apps/wallet-mobile/src/components/Boundary/Boundary.tsx b/apps/wallet-mobile/src/components/Boundary/Boundary.tsx index b7add7b217..09f648b0bf 100644 --- a/apps/wallet-mobile/src/components/Boundary/Boundary.tsx +++ b/apps/wallet-mobile/src/components/Boundary/Boundary.tsx @@ -7,7 +7,7 @@ import { } from 'react-error-boundary' import {useIntl} from 'react-intl' import {ActivityIndicator, Image, LayoutAnimation, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' -import {useQueryErrorResetBoundary} from 'react-query' +import {useQueryErrorResetBoundary} from '@tanstack/react-query' import image from '../../assets/img/error.png' import {LocalizableError} from '../../kernel/i18n/LocalizableError' diff --git a/apps/wallet-mobile/src/features/Auth/common/hooks.ts b/apps/wallet-mobile/src/features/Auth/common/hooks.ts index c110cc4afc..522c0f3b69 100644 --- a/apps/wallet-mobile/src/features/Auth/common/hooks.ts +++ b/apps/wallet-mobile/src/features/Auth/common/hooks.ts @@ -4,7 +4,7 @@ import * as React from 'react' import {defineMessages, useIntl} from 'react-intl' import {Alert, AppState, Platform} from 'react-native' import RNKeychain from 'react-native-keychain' -import {useMutation, UseMutationOptions, useQuery, useQueryClient, UseQueryOptions} from 'react-query' +import {useMutation, UseMutationOptions, useQuery, useQueryClient, UseQueryOptions} from '@tanstack/react-query' import {decryptData, encryptData} from '../../../kernel/encryption/encryption' import globalMessages from '../../../kernel/i18n/global-messages' diff --git a/apps/wallet-mobile/src/features/Auth/common/useDisableAllEasyConfirmation.tsx b/apps/wallet-mobile/src/features/Auth/common/useDisableAllEasyConfirmation.tsx index 82c95f7c58..2f899df7e2 100644 --- a/apps/wallet-mobile/src/features/Auth/common/useDisableAllEasyConfirmation.tsx +++ b/apps/wallet-mobile/src/features/Auth/common/useDisableAllEasyConfirmation.tsx @@ -1,4 +1,4 @@ -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {useWalletManager} from '../../WalletManager/context/WalletManagerProvider' diff --git a/apps/wallet-mobile/src/features/Auth/common/useEnableEasyConfirmation.tsx b/apps/wallet-mobile/src/features/Auth/common/useEnableEasyConfirmation.tsx index 716753c94b..8ae8ed3ef6 100644 --- a/apps/wallet-mobile/src/features/Auth/common/useEnableEasyConfirmation.tsx +++ b/apps/wallet-mobile/src/features/Auth/common/useEnableEasyConfirmation.tsx @@ -1,5 +1,5 @@ import {useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {YoroiWallet} from '../../../yoroi-wallets/cardano/types' import {useWalletManager} from '../../WalletManager/context/WalletManagerProvider' diff --git a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx index f9de220027..8ec6e7aab5 100644 --- a/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx +++ b/apps/wallet-mobile/src/features/Claim/useCases/ShowSuccessScreen.stories.tsx @@ -2,7 +2,7 @@ import {DecoratorFunction} from '@storybook/addons' import {storiesOf} from '@storybook/react-native' import {claimManagerMockInstances, ClaimProvider, mocksState} from '@yoroi/claim' import * as React from 'react' -import {QueryClientProvider} from 'react-query' +import {QueryClientProvider} from '@tanstack/react-query' import {queryClientFixture} from '../../../kernel/fixtures/fixtures' import {mocks as walletMocks} from '../../../yoroi-wallets/mocks/wallet' diff --git a/apps/wallet-mobile/src/features/Discover/common/ChainDAppsWarning.tsx b/apps/wallet-mobile/src/features/Discover/common/ChainDAppsWarning.tsx index d944d6bd4d..1b5091623a 100644 --- a/apps/wallet-mobile/src/features/Discover/common/ChainDAppsWarning.tsx +++ b/apps/wallet-mobile/src/features/Discover/common/ChainDAppsWarning.tsx @@ -1,7 +1,7 @@ import {useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common' import {Chain} from '@yoroi/types' import * as React from 'react' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {GradientWarning} from '../../../components/ChainWarning/GradientWarning' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/features/Discover/common/useDAppsConnected.tsx b/apps/wallet-mobile/src/features/Discover/common/useDAppsConnected.tsx index 75c9773483..299eb19454 100644 --- a/apps/wallet-mobile/src/features/Discover/common/useDAppsConnected.tsx +++ b/apps/wallet-mobile/src/features/Discover/common/useDAppsConnected.tsx @@ -1,6 +1,6 @@ import {DappConnection, useDappConnector} from '@yoroi/dapp-connector' import {Chain} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/features/Discover/common/useShowWelcomeDApp.tsx b/apps/wallet-mobile/src/features/Discover/common/useShowWelcomeDApp.tsx index 24a209a26e..766c78e3d5 100644 --- a/apps/wallet-mobile/src/features/Discover/common/useShowWelcomeDApp.tsx +++ b/apps/wallet-mobile/src/features/Discover/common/useShowWelcomeDApp.tsx @@ -1,6 +1,6 @@ import {isBoolean, useAsyncStorage} from '@yoroi/common' import * as React from 'react' -import {useMutation, UseMutationOptions, useQuery, UseQueryOptions} from 'react-query' +import {useMutation, UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx b/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx index bfbf280cd5..c1571c8d2a 100644 --- a/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx +++ b/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx @@ -8,7 +8,7 @@ import {useEffect} from 'react' import {StyleSheet, View} from 'react-native' import {TouchableOpacity} from 'react-native-gesture-handler' import {SafeAreaView} from 'react-native-safe-area-context' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {z} from 'zod' import {Button} from '../../../../components/Button/Button' diff --git a/apps/wallet-mobile/src/features/Exchange/common/useResetShowBuyBannerSmall.tsx b/apps/wallet-mobile/src/features/Exchange/common/useResetShowBuyBannerSmall.tsx index b37a5cc6a1..b7e9713221 100644 --- a/apps/wallet-mobile/src/features/Exchange/common/useResetShowBuyBannerSmall.tsx +++ b/apps/wallet-mobile/src/features/Exchange/common/useResetShowBuyBannerSmall.tsx @@ -1,5 +1,5 @@ import {useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' import {storageKeyShowBuyBannerSmall, storageRootExchange} from './constants' diff --git a/apps/wallet-mobile/src/features/Exchange/common/useShowBuyBannerSmall.tsx b/apps/wallet-mobile/src/features/Exchange/common/useShowBuyBannerSmall.tsx index e45d01e884..a8464e12dc 100644 --- a/apps/wallet-mobile/src/features/Exchange/common/useShowBuyBannerSmall.tsx +++ b/apps/wallet-mobile/src/features/Exchange/common/useShowBuyBannerSmall.tsx @@ -1,5 +1,5 @@ import {isNumber, parseNumber, useAsyncStorage} from '@yoroi/common' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {useBalances} from '../../../yoroi-wallets/hooks' import {Amounts, asQuantity, Quantities} from '../../../yoroi-wallets/utils/utils' diff --git a/apps/wallet-mobile/src/features/Initialization/ChooseBiometricLogin/ChooseBiometricLoginScreen.tsx b/apps/wallet-mobile/src/features/Initialization/ChooseBiometricLogin/ChooseBiometricLoginScreen.tsx index 24ef2d1ed6..df03ad31a9 100644 --- a/apps/wallet-mobile/src/features/Initialization/ChooseBiometricLogin/ChooseBiometricLoginScreen.tsx +++ b/apps/wallet-mobile/src/features/Initialization/ChooseBiometricLogin/ChooseBiometricLoginScreen.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import {Alert, StyleSheet, Text, View} from 'react-native' import DeviceInfo from 'react-native-device-info' import {SafeAreaView} from 'react-native-safe-area-context' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {Button} from '../../../components/Button/Button' import {Space} from '../../../components/Space/Space' diff --git a/apps/wallet-mobile/src/features/Initialization/DarkThemeAnnouncement/DarkThemeAnnouncement.tsx b/apps/wallet-mobile/src/features/Initialization/DarkThemeAnnouncement/DarkThemeAnnouncement.tsx index 0ca4646f44..b5b688cd40 100644 --- a/apps/wallet-mobile/src/features/Initialization/DarkThemeAnnouncement/DarkThemeAnnouncement.tsx +++ b/apps/wallet-mobile/src/features/Initialization/DarkThemeAnnouncement/DarkThemeAnnouncement.tsx @@ -5,7 +5,7 @@ import {defineMessages, useIntl} from 'react-intl' import {Platform, Pressable, StyleSheet, Switch, View} from 'react-native' import {ScrollView} from 'react-native-gesture-handler' import {SafeAreaView} from 'react-native-safe-area-context' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {Button} from '../../../components/Button/Button' import {Space} from '../../../components/Space/Space' diff --git a/apps/wallet-mobile/src/features/Initialization/common/terms.ts b/apps/wallet-mobile/src/features/Initialization/common/terms.ts index 8037c9cabd..b60f5696a7 100644 --- a/apps/wallet-mobile/src/features/Initialization/common/terms.ts +++ b/apps/wallet-mobile/src/features/Initialization/common/terms.ts @@ -1,6 +1,6 @@ import {useAsyncStorage} from '@yoroi/common' import {useCallback} from 'react' -import {useMutation, useQuery, useQueryClient} from 'react-query' +import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query' import {agreementDate} from '../../../kernel/config' diff --git a/apps/wallet-mobile/src/features/Legal/PrivacyPolicy/PrivacyPolicy.tsx b/apps/wallet-mobile/src/features/Legal/PrivacyPolicy/PrivacyPolicy.tsx index c1cd65017e..c97178e787 100644 --- a/apps/wallet-mobile/src/features/Legal/PrivacyPolicy/PrivacyPolicy.tsx +++ b/apps/wallet-mobile/src/features/Legal/PrivacyPolicy/PrivacyPolicy.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {ActivityIndicator, StyleSheet, View} from 'react-native' import Markdown from 'react-native-markdown-display' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {Spacer} from '../../../components/Spacer/Spacer' import {LanguageCode} from '../../../kernel/i18n/languages' diff --git a/apps/wallet-mobile/src/features/Legal/TermsOfService/TermsOfService.tsx b/apps/wallet-mobile/src/features/Legal/TermsOfService/TermsOfService.tsx index 4f2dc644b7..52f86ed1ab 100644 --- a/apps/wallet-mobile/src/features/Legal/TermsOfService/TermsOfService.tsx +++ b/apps/wallet-mobile/src/features/Legal/TermsOfService/TermsOfService.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {ActivityIndicator, StyleSheet, View} from 'react-native' import Markdown from 'react-native-markdown-display' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {Spacer} from '../../../components/Spacer/Spacer' import {LanguageCode} from '../../../kernel/i18n/languages' diff --git a/apps/wallet-mobile/src/features/Menu/Menu.stories.tsx b/apps/wallet-mobile/src/features/Menu/Menu.stories.tsx index 4c0a313b44..29a45c2508 100644 --- a/apps/wallet-mobile/src/features/Menu/Menu.stories.tsx +++ b/apps/wallet-mobile/src/features/Menu/Menu.stories.tsx @@ -1,6 +1,6 @@ import {storiesOf} from '@storybook/react-native' import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {mocks} from '../../yoroi-wallets/mocks/wallet' import {WalletManagerProviderMock} from '../../yoroi-wallets/mocks/WalletManagerProviderMock' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/PortfolioTokenActivityProvider.tsx b/apps/wallet-mobile/src/features/Portfolio/common/PortfolioTokenActivityProvider.tsx index 74c28dc824..75e3f3c9db 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/PortfolioTokenActivityProvider.tsx +++ b/apps/wallet-mobile/src/features/Portfolio/common/PortfolioTokenActivityProvider.tsx @@ -3,7 +3,7 @@ import {isPrimaryToken} from '@yoroi/portfolio' import {Portfolio} from '@yoroi/types' import {freeze, produce} from 'immer' import React from 'react' -import {useQuery, useQueryClient} from 'react-query' +import {useQuery, useQueryClient} from '@tanstack/react-query' import {merge, switchMap} from 'rxjs' import {time} from '../../../kernel/constants' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetDAppsPortfolioBalance.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetDAppsPortfolioBalance.ts index eb0b7c1d57..2b1a683830 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetDAppsPortfolioBalance.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetDAppsPortfolioBalance.ts @@ -1,4 +1,4 @@ -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' interface IDAppPortfolioBalance { quantity: bigint diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetLiquidityPool.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetLiquidityPool.ts index fc1e21da97..0f6a5c8eea 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetLiquidityPool.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetLiquidityPool.ts @@ -1,6 +1,6 @@ import {Portfolio} from '@yoroi/types' import {ImageSourcePropType} from 'react-native' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {getDappFallbackLogo} from '../../../Discover/common/helpers' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetOpenOrders.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetOpenOrders.ts index 80c1f445b8..ce47f1b994 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetOpenOrders.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetOpenOrders.ts @@ -1,5 +1,5 @@ import {ImageSourcePropType} from 'react-native' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {getDappFallbackLogo} from '../../../Discover/common/helpers' import {IAsset, mockAmount} from './useGetLiquidityPool' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts index 431878febf..37b48bffcf 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenChart.ts @@ -1,7 +1,7 @@ import {isRight} from '@yoroi/common' import {isPrimaryToken} from '@yoroi/portfolio' import {Chain, Portfolio} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {supportedCurrencies, time} from '../../../../kernel/constants' import {useLanguage} from '../../../../kernel/i18n' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenInfo.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenInfo.ts index 941a4bf9ac..ef7b9f74b6 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenInfo.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetPortfolioTokenInfo.ts @@ -1,6 +1,6 @@ import {type Portfolio} from '@yoroi/types' import {ImageSourcePropType} from 'react-native' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import AdaLogo from '../../../../assets/img/ada.png' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetTokensWithBalance.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetTokensWithBalance.ts index b339b8fe50..b679733b80 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetTokensWithBalance.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/useGetTokensWithBalance.ts @@ -1,5 +1,5 @@ import {ImageSourcePropType} from 'react-native' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import AdaLogo from '../../../../assets/img/ada.png' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioImage.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioImage.ts index 7676b9becd..fbf97f31b7 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioImage.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioImage.ts @@ -1,6 +1,6 @@ import {Portfolio} from '@yoroi/types' import {Image} from 'expo-image' -import {useMutation} from 'react-query' +import {useMutation} from '@tanstack/react-query' import {useSelectedNetwork} from '../../../WalletManager/common/hooks/useSelectedNetwork' diff --git a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenInfos.ts b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenInfos.ts index 7df8022b71..c51ee60e34 100644 --- a/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenInfos.ts +++ b/apps/wallet-mobile/src/features/Portfolio/common/hooks/usePortfolioTokenInfos.ts @@ -1,6 +1,6 @@ import {createUnknownTokenInfo, isPrimaryToken} from '@yoroi/portfolio' import {Portfolio} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' diff --git a/apps/wallet-mobile/src/features/Receive/common/useMultipleAddressesInfo.tsx b/apps/wallet-mobile/src/features/Receive/common/useMultipleAddressesInfo.tsx index aebd62d00f..b48674a6ff 100644 --- a/apps/wallet-mobile/src/features/Receive/common/useMultipleAddressesInfo.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/useMultipleAddressesInfo.tsx @@ -1,5 +1,5 @@ import {isBoolean, parseSafe, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions, useQuery, UseQueryOptions} from 'react-query' +import {UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/features/RegisterCatalyst/common/hooks.ts b/apps/wallet-mobile/src/features/RegisterCatalyst/common/hooks.ts index 38c9650131..50be679a92 100644 --- a/apps/wallet-mobile/src/features/RegisterCatalyst/common/hooks.ts +++ b/apps/wallet-mobile/src/features/RegisterCatalyst/common/hooks.ts @@ -1,6 +1,6 @@ import {Catalyst, useCatalyst} from '@yoroi/staking' import {App} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {time} from '../../../kernel/constants' import {throwLoggedError} from '../../../kernel/logger/helpers/throw-logged-error' diff --git a/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ConfirmPin/ConfirmPin.tsx b/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ConfirmPin/ConfirmPin.tsx index f7cec3c29f..c97f7dff1a 100644 --- a/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ConfirmPin/ConfirmPin.tsx +++ b/apps/wallet-mobile/src/features/RegisterCatalyst/useCases/ConfirmPin/ConfirmPin.tsx @@ -3,7 +3,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {ActivityIndicator, ScrollView, StyleSheet, View, ViewProps} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {Button} from '../../../../components/Button/Button' import {BACKSPACE, NumericKeyboard} from '../../../../components/NumericKeyboard' diff --git a/apps/wallet-mobile/src/features/Send/common/useSendAddress.tsx b/apps/wallet-mobile/src/features/Send/common/useSendAddress.tsx index 603e0cdc3f..bc67f30b47 100644 --- a/apps/wallet-mobile/src/features/Send/common/useSendAddress.tsx +++ b/apps/wallet-mobile/src/features/Send/common/useSendAddress.tsx @@ -1,7 +1,7 @@ import {normalizeToAddress} from '@emurgo/yoroi-lib/dist/internals/utils/addresses' import {useTransfer} from '@yoroi/transfer' import * as React from 'react' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {CardanoMobile} from '../../../yoroi-wallets/wallets' import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx b/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx index 00f0c3b8ab..3e5d9587b7 100644 --- a/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx +++ b/apps/wallet-mobile/src/features/Send/common/useSendReceiver.tsx @@ -2,7 +2,7 @@ import {isDomain, isNameServer, isResolvableDomain, useResolverCryptoAddresses} import {useTransfer} from '@yoroi/transfer' import {Resolver} from '@yoroi/types' import * as React from 'react' -import {useQueryClient} from 'react-query' +import {useQueryClient} from '@tanstack/react-query' export const useSendReceiver = () => { const queryClient = useQueryClient() diff --git a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx index aebcf4ff06..364132bea7 100644 --- a/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx +++ b/apps/wallet-mobile/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx @@ -9,7 +9,7 @@ import {defineMessages, useIntl} from 'react-intl' import {StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native' import {FlatList} from 'react-native-gesture-handler' import {SafeAreaView} from 'react-native-safe-area-context' -import {useMutation} from 'react-query' +import {useMutation} from '@tanstack/react-query' import {Boundary} from '../../../../components/Boundary/Boundary' import {Button} from '../../../../components/Button/Button' diff --git a/apps/wallet-mobile/src/features/Settings/ChangeNetwork/ChangeNetworkScreen.tsx b/apps/wallet-mobile/src/features/Settings/ChangeNetwork/ChangeNetworkScreen.tsx index 68afc106d7..34f1dbd8f8 100644 --- a/apps/wallet-mobile/src/features/Settings/ChangeNetwork/ChangeNetworkScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/ChangeNetwork/ChangeNetworkScreen.tsx @@ -3,7 +3,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {Platform, StyleSheet, Text, View} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {UseMutationOptions, useQuery, UseQueryOptions} from 'react-query' +import {UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query' import {Boundary} from '../../../components/Boundary/Boundary' import {Button} from '../../../components/Button/Button' diff --git a/apps/wallet-mobile/src/features/Settings/ChangePassword/ChangePasswordScreen.tsx b/apps/wallet-mobile/src/features/Settings/ChangePassword/ChangePasswordScreen.tsx index b3e87d7a45..b768ab36fc 100644 --- a/apps/wallet-mobile/src/features/Settings/ChangePassword/ChangePasswordScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/ChangePassword/ChangePasswordScreen.tsx @@ -4,7 +4,7 @@ import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {ScrollView, StyleSheet, TextInput as RNTextInput, View, ViewProps} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {MutationOptions, useMutation} from 'react-query' +import {MutationOptions, useMutation} from '@tanstack/react-query' import {Button} from '../../../components/Button/Button' import {KeyboardAvoidingView} from '../../../components/KeyboardAvoidingView/KeyboardAvoidingView' diff --git a/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx b/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx index 2f86e763fc..768b45a870 100644 --- a/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx +++ b/apps/wallet-mobile/src/features/Settings/Currency/CurrencyContext.tsx @@ -1,6 +1,6 @@ import {parseSafe, useAsyncStorage} from '@yoroi/common' import React from 'react' -import {useMutation, UseMutationOptions, useQuery, useQueryClient} from 'react-query' +import {useMutation, UseMutationOptions, useQuery, useQueryClient} from '@tanstack/react-query' import {configCurrencies, supportedCurrencies} from '../../../kernel/constants' import {usePrimaryTokenActivity} from '../../../yoroi-wallets/cardano/usePrimaryTokenActivity' diff --git a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ManageCollateralScreen.tsx b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ManageCollateralScreen.tsx index 7f8d2d6c53..24deb6ff74 100644 --- a/apps/wallet-mobile/src/features/Settings/ManageCollateral/ManageCollateralScreen.tsx +++ b/apps/wallet-mobile/src/features/Settings/ManageCollateral/ManageCollateralScreen.tsx @@ -15,7 +15,7 @@ import { ViewProps, } from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' -import {useMutation} from 'react-query' +import {useMutation} from '@tanstack/react-query' import {Button} from '../../../components/Button/Button' import {CopyButton} from '../../../components/CopyButton' diff --git a/apps/wallet-mobile/src/features/Settings/PrivacyMode/PrivacyMode.tsx b/apps/wallet-mobile/src/features/Settings/PrivacyMode/PrivacyMode.tsx index 793876cc65..174235a1a0 100644 --- a/apps/wallet-mobile/src/features/Settings/PrivacyMode/PrivacyMode.tsx +++ b/apps/wallet-mobile/src/features/Settings/PrivacyMode/PrivacyMode.tsx @@ -1,5 +1,5 @@ import {parseSafe, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions, useQuery} from 'react-query' +import {UseMutationOptions, useQuery} from '@tanstack/react-query' const useReadPrivacyMode = () => { const storage = useAsyncStorage() diff --git a/apps/wallet-mobile/src/features/Settings/ScreenShare/ScreenShare.ts b/apps/wallet-mobile/src/features/Settings/ScreenShare/ScreenShare.ts index 940285066d..6ea7933915 100644 --- a/apps/wallet-mobile/src/features/Settings/ScreenShare/ScreenShare.ts +++ b/apps/wallet-mobile/src/features/Settings/ScreenShare/ScreenShare.ts @@ -1,7 +1,7 @@ import {isBoolean, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common' import {useEffect, useState} from 'react' import {NativeModules, Platform} from 'react-native' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' const {FlagSecure} = NativeModules diff --git a/apps/wallet-mobile/src/features/Swap/common/helpers.ts b/apps/wallet-mobile/src/features/Swap/common/helpers.ts index d37ff7a964..a470e1ab05 100644 --- a/apps/wallet-mobile/src/features/Swap/common/helpers.ts +++ b/apps/wallet-mobile/src/features/Swap/common/helpers.ts @@ -2,7 +2,7 @@ import {createTypeGuardFromSchema, parseSafe} from '@yoroi/common' import {useTheme} from '@yoroi/theme' import {HW} from '@yoroi/types' import {SwapApi} from '@yoroi/types/src/swap/api' -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {z} from 'zod' import {normalisePtId} from '../../../kernel/helpers/normalisePtId' diff --git a/apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts b/apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts index 2d79dbbc2e..d594ec3232 100644 --- a/apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts +++ b/apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts @@ -1,6 +1,6 @@ import {useMutationWithInvalidations} from '@yoroi/common' import {useSwap} from '@yoroi/swap' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {YoroiEntry, YoroiUnsignedTx} from '../../../yoroi-wallets/types/yoroi' import {splitStringInto64CharArray} from '../../../yoroi-wallets/utils/utils' diff --git a/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/AssetList.stories.tsx b/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/AssetList.stories.tsx index 240d5209e9..89ad35c7d5 100644 --- a/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/AssetList.stories.tsx +++ b/apps/wallet-mobile/src/features/Transactions/useCases/TxDetails/AssetList.stories.tsx @@ -1,7 +1,7 @@ import {action} from '@storybook/addon-actions' import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {mocks} from '../../../../yoroi-wallets/mocks/wallet' import {WalletManagerProviderMock} from '../../../../yoroi-wallets/mocks/WalletManagerProviderMock' diff --git a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useBestBlock.tsx b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useBestBlock.tsx index ca667fc087..bddc9a8775 100644 --- a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useBestBlock.tsx +++ b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useBestBlock.tsx @@ -1,5 +1,5 @@ import {Chain} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {useSelectedNetwork} from './useSelectedNetwork' diff --git a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletMnemonic.tsx b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletMnemonic.tsx index f039c219e5..ad7d90f753 100644 --- a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletMnemonic.tsx +++ b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletMnemonic.tsx @@ -1,5 +1,5 @@ import {Wallet} from '@yoroi/types' -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {useWalletManager} from '../../context/WalletManagerProvider' diff --git a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletXPub.tsx b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletXPub.tsx index 9811eba528..b57cda9f55 100644 --- a/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletXPub.tsx +++ b/apps/wallet-mobile/src/features/WalletManager/common/hooks/useCreateWalletXPub.tsx @@ -1,5 +1,5 @@ import {HW, Wallet} from '@yoroi/types' -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {useWalletManager} from '../../context/WalletManagerProvider' diff --git a/apps/wallet-mobile/src/kernel/fixtures/fixtures.ts b/apps/wallet-mobile/src/kernel/fixtures/fixtures.ts index d3cb0695fb..de329b2e9f 100644 --- a/apps/wallet-mobile/src/kernel/fixtures/fixtures.ts +++ b/apps/wallet-mobile/src/kernel/fixtures/fixtures.ts @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' export const queryClientFixture = () => new QueryClient({ diff --git a/apps/wallet-mobile/src/kernel/i18n/LanguageProvider.tsx b/apps/wallet-mobile/src/kernel/i18n/LanguageProvider.tsx index b47890f72b..ecc5a063cf 100644 --- a/apps/wallet-mobile/src/kernel/i18n/LanguageProvider.tsx +++ b/apps/wallet-mobile/src/kernel/i18n/LanguageProvider.tsx @@ -15,7 +15,7 @@ import { useQuery, useQueryClient, UseQueryOptions, -} from 'react-query' +} from '@tanstack/react-query' import {numberLocale, systemLocale} from './initialization' import {LanguageCode, NumberLocale, supportedLanguages} from './languages' diff --git a/apps/wallet-mobile/src/kernel/query-client.ts b/apps/wallet-mobile/src/kernel/query-client.ts index 3e1d1442ed..a3f1f4bd0c 100644 --- a/apps/wallet-mobile/src/kernel/query-client.ts +++ b/apps/wallet-mobile/src/kernel/query-client.ts @@ -1,5 +1,5 @@ import {freeze} from 'immer' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' const queryClient = new QueryClient() const keyToPersist = 'persist' diff --git a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx index c2010862e6..8c83aadcb9 100644 --- a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfo.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {ActivityIndicator, Linking, StyleSheet, View} from 'react-native' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {Button} from '../../components/Button/Button' import {CopyButton} from '../../components/CopyButton' diff --git a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx index 862a6391a0..0ef0f9b6ce 100644 --- a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.stories.tsx @@ -1,6 +1,6 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {YoroiWallet} from '../../yoroi-wallets/cardano/types' import {mocks} from '../../yoroi-wallets/mocks/wallet' diff --git a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx index d0fa9468dd..f54f7af709 100644 --- a/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx +++ b/apps/wallet-mobile/src/legacy/Dashboard/StakePoolInfos.tsx @@ -2,7 +2,7 @@ import {Balance, Wallet} from '@yoroi/types' import BigNumber from 'bignumber.js' import React from 'react' import {ActivityIndicator, StyleSheet, View} from 'react-native' -import {useQuery, useQueryClient, UseQueryOptions} from 'react-query' +import {useQuery, useQueryClient, UseQueryOptions} from '@tanstack/react-query' import {useSelectedWallet} from '../../features/WalletManager/common/hooks/useSelectedWallet' import {YoroiWallet} from '../../yoroi-wallets/cardano/types' diff --git a/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx index 52bd0458c5..1ebc4b2974 100644 --- a/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.stories.tsx @@ -1,6 +1,6 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {RouteProvider} from '../../../../.storybook/decorators' import {StakingCenterRoutes} from '../../../kernel/navigation' diff --git a/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx index 5a76f87b02..cdbf5f746e 100644 --- a/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React, {useEffect, useState} from 'react' import {defineMessages, useIntl} from 'react-intl' import {Platform, ScrollView, StyleSheet, View} from 'react-native' -import {useQueryClient} from 'react-query' +import {useQueryClient} from '@tanstack/react-query' import {ConfirmTx} from '../../../components/ConfirmTx/ConfirmTx' import {KeyboardSpacer} from '../../../components/KeyboardSpacer' diff --git a/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx index 726cf4b940..dc0e200897 100644 --- a/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolDetails/PoolDetailScreen.tsx @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme' import React from 'react' import {defineMessages, useIntl} from 'react-intl' import {StyleSheet} from 'react-native' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {Button} from '../../../components/Button/Button' import {GradientWarning} from '../../../components/ChainWarning/GradientWarning' diff --git a/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx index 65cebf2c76..71da487929 100644 --- a/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/PoolTransition/usePoolTransition.tsx @@ -5,7 +5,7 @@ import {Wallet} from '@yoroi/types' import BigNumber from 'bignumber.js' import * as React from 'react' import {defineMessages, useIntl} from 'react-intl' -import {useQuery} from 'react-query' +import {useQuery} from '@tanstack/react-query' import {useSelectedNetwork} from '../../../features/WalletManager/common/hooks/useSelectedNetwork' import {useSelectedWallet} from '../../../features/WalletManager/common/hooks/useSelectedWallet' diff --git a/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx index fd11a3db8d..09e32a8fdb 100644 --- a/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx +++ b/apps/wallet-mobile/src/legacy/Staking/StakingCenter/StakingCenter.stories.tsx @@ -1,6 +1,6 @@ import {storiesOf} from '@storybook/react-native' import React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {mocks} from '../../../yoroi-wallets/mocks/wallet' import {WalletManagerProviderMock} from '../../../yoroi-wallets/mocks/WalletManagerProviderMock' diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx b/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx index 0ebcf0cfae..84a178045a 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/usePrimaryTokenActivity.tsx @@ -1,6 +1,6 @@ import {fetchData, isRight} from '@yoroi/common' import {Chain} from '@yoroi/types' -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {networkConfigs} from '../../features/WalletManager/network-manager/network-manager' import {time} from '../../kernel/constants' diff --git a/apps/wallet-mobile/src/yoroi-wallets/cardano/utxoManager/useSetCollateralId.tsx b/apps/wallet-mobile/src/yoroi-wallets/cardano/utxoManager/useSetCollateralId.tsx index dc441d5e8e..a671179172 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/cardano/utxoManager/useSetCollateralId.tsx +++ b/apps/wallet-mobile/src/yoroi-wallets/cardano/utxoManager/useSetCollateralId.tsx @@ -1,5 +1,5 @@ import {useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {RawUtxo} from '../../types/other' import {YoroiWallet} from '../types' diff --git a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts index fb3ee1a9d8..23b21b631f 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts @@ -17,7 +17,7 @@ import { useQuery, useQueryClient, UseQueryOptions, -} from 'react-query' +} from '@tanstack/react-query' import {cardanoConfig} from '../../features/WalletManager/common/adapters/cardano/cardano-config' import {useSelectedNetwork} from '../../features/WalletManager/common/hooks/useSelectedNetwork' diff --git a/apps/wallet-mobile/src/yoroi-wallets/hw/hw.ts b/apps/wallet-mobile/src/yoroi-wallets/hw/hw.ts index 7cf3fac3bd..c8eb18a4df 100644 --- a/apps/wallet-mobile/src/yoroi-wallets/hw/hw.ts +++ b/apps/wallet-mobile/src/yoroi-wallets/hw/hw.ts @@ -1,5 +1,5 @@ import {Permission, PermissionsAndroid, Platform} from 'react-native' -import {useMutation, UseMutationOptions} from 'react-query' +import {useMutation, UseMutationOptions} from '@tanstack/react-query' import {ledgerMessages} from '../../kernel/i18n/global-messages' import {LocalizableError} from '../../kernel/i18n/LocalizableError' diff --git a/apps/wallet/package.json b/apps/wallet/package.json index f4ecb91682..f8df432c7a 100644 --- a/apps/wallet/package.json +++ b/apps/wallet/package.json @@ -43,6 +43,7 @@ "react-intl": "6.7.0", "react-native": "0.74.4", "react-native-mmkv": "3.0.1", + "@tanstack/react-query": "4.36.1", "rxjs": "7.8.1", "zod": "3.23.8" }, diff --git a/packages/api/package.json b/packages/api/package.json index c5298e5b85..cba90a9830 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -173,7 +173,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4", @@ -187,7 +187,7 @@ }, "optionalDependencies": { "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/claim/package.json b/packages/claim/package.json index 4bf91cfa75..e81af2d5c7 100644 --- a/packages/claim/package.json +++ b/packages/claim/package.json @@ -146,7 +146,6 @@ "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@commitlint/config-conventional": "^17.0.2", - "@react-native-async-storage/async-storage": "2.0.0", "@react-native-community/eslint-config": "^3.0.2", "@react-native/babel-preset": "0.74.86", "@react-native/eslint-config": "0.74.86", @@ -181,7 +180,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -193,9 +192,8 @@ "immer": "10.1.1" }, "optionalDependencies": { - "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/claim/src/fixtures/wrapperMaker.tsx b/packages/claim/src/fixtures/wrapperMaker.tsx index 11323458d0..4ca8331fd8 100644 --- a/packages/claim/src/fixtures/wrapperMaker.tsx +++ b/packages/claim/src/fixtures/wrapperMaker.tsx @@ -1,7 +1,7 @@ import {ErrorBoundary, SuspenseBoundary} from '@yoroi/common' import {Claim} from '@yoroi/types' import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {ClaimProvider} from '../translators/reactjs/provider/ClaimProvider' import {ClaimState} from '../translators/reactjs/state/state' diff --git a/packages/claim/src/transformers.test.ts b/packages/claim/src/transformers.test.ts index 386fa4941b..37b3ba6704 100644 --- a/packages/claim/src/transformers.test.ts +++ b/packages/claim/src/transformers.test.ts @@ -1,10 +1,10 @@ import {Api, Claim, Portfolio} from '@yoroi/types' import {tokenMocks, createTokenManagerMock} from '@yoroi/portfolio' +import {cacheRecordMaker} from '@yoroi/common' import {asClaimApiError, asClaimToken} from './transformers' import {claimFaucetResponses} from './api-faucet.mocks' import {claimApiMockResponses} from './manager.mocks' -import {cacheRecordMaker} from '@yoroi/common' const tokenManagerMock = createTokenManagerMock() diff --git a/packages/claim/src/translators/reactjs/hooks/useClaimTokens.test.tsx b/packages/claim/src/translators/reactjs/hooks/useClaimTokens.test.tsx index eaed00a782..e9ec5d1040 100644 --- a/packages/claim/src/translators/reactjs/hooks/useClaimTokens.test.tsx +++ b/packages/claim/src/translators/reactjs/hooks/useClaimTokens.test.tsx @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {queryClientFixture} from '@yoroi/common' import {Claim, Scan} from '@yoroi/types' @@ -10,6 +10,8 @@ import { import {wrapperMaker} from '../../../fixtures/wrapperMaker' import {useClaimTokens} from './useClaimTokens' +jest.useFakeTimers() + describe('useClaimTokens', () => { let queryClient: QueryClient diff --git a/packages/claim/src/translators/reactjs/hooks/useClaimTokens.tsx b/packages/claim/src/translators/reactjs/hooks/useClaimTokens.tsx index 04db97d9da..0533992260 100644 --- a/packages/claim/src/translators/reactjs/hooks/useClaimTokens.tsx +++ b/packages/claim/src/translators/reactjs/hooks/useClaimTokens.tsx @@ -1,6 +1,6 @@ import {Claim, Scan} from '@yoroi/types' import {useMutationWithInvalidations} from '@yoroi/common' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {useClaim} from './useClaim' diff --git a/packages/claim/src/translators/reactjs/provider/ClaimProvider.test.tsx b/packages/claim/src/translators/reactjs/provider/ClaimProvider.test.tsx index 5d8bf46fdc..f95263d88f 100644 --- a/packages/claim/src/translators/reactjs/provider/ClaimProvider.test.tsx +++ b/packages/claim/src/translators/reactjs/provider/ClaimProvider.test.tsx @@ -1,6 +1,6 @@ import {act, renderHook} from '@testing-library/react-hooks' import {queryClientFixture} from '@yoroi/common' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {wrapperMaker} from '../../../fixtures/wrapperMaker' import {claimManagerMockInstances} from '../../../manager.mocks' diff --git a/packages/common/package.json b/packages/common/package.json index 0bbd34ae45..6f4d35092d 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -174,7 +174,7 @@ "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "rxjs": "7.8.1", @@ -192,7 +192,7 @@ "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/common/src/fixtures/query-client.ts b/packages/common/src/fixtures/query-client.ts index d3cb0695fb..5b3f340adf 100644 --- a/packages/common/src/fixtures/query-client.ts +++ b/packages/common/src/fixtures/query-client.ts @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' export const queryClientFixture = () => new QueryClient({ @@ -6,9 +6,13 @@ export const queryClientFixture = () => queries: { retry: false, cacheTime: 0, + staleTime: 0, + networkMode: 'offlineFirst', }, mutations: { retry: false, + cacheTime: 0, + networkMode: 'offlineFirst', }, }, }) diff --git a/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.test.tsx b/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.test.tsx index 142b7f25d3..346d99fad1 100644 --- a/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.test.tsx +++ b/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.test.tsx @@ -1,15 +1,31 @@ import {useMutationWithInvalidations} from './useMutationWithInvalidations' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider, QueryKey} from '@tanstack/react-query' import React, {PropsWithChildren} from 'react' import {waitFor} from '@testing-library/react-native' import {renderHook} from '@testing-library/react-hooks' const mutationFn = () => Promise.resolve(true) +jest.useFakeTimers() + +const getMockedQueryClient = () => { + const queryClient = new QueryClient() + queryClient.cancelQueries = jest.fn() + queryClient.invalidateQueries = jest.fn() + queryClient.setDefaultOptions({queries: {cacheTime: 0, retry: false}}) + return queryClient +} + describe('useMutationWithInvalidations', () => { + const client = getMockedQueryClient() + + afterEach(() => { + client.clear() + jest.clearAllTimers() + }) + it('should cancel and invalidate queries', async () => { - const queries = ['query1', 'query2'] - const client = getMockedQueryClient() + const queries: Array = [['query1'], ['query2']] const wrapper = (props: PropsWithChildren) => ( ) @@ -32,11 +48,3 @@ describe('useMutationWithInvalidations', () => { expect(client.invalidateQueries).toHaveBeenNthCalledWith(2, queries[1]) }) }) - -const getMockedQueryClient = () => { - const queryClient = new QueryClient() - queryClient.cancelQueries = jest.fn() - queryClient.invalidateQueries = jest.fn() - queryClient.setDefaultOptions({queries: {cacheTime: 0, retry: false}}) - return queryClient -} diff --git a/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.ts b/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.ts index 46313fa949..ddab6d912a 100644 --- a/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.ts +++ b/packages/common/src/translators/reactjs/hooks/useMutationWithInvalidations.ts @@ -3,7 +3,7 @@ import { useMutation, UseMutationOptions, useQueryClient, -} from 'react-query' +} from '@tanstack/react-query' export const useMutationWithInvalidations = < TData = unknown, diff --git a/packages/dapp-connector/package.json b/packages/dapp-connector/package.json index ac036756da..1aee63e127 100644 --- a/packages/dapp-connector/package.json +++ b/packages/dapp-connector/package.json @@ -179,7 +179,7 @@ "react-native": "0.74.4", "react-native-builder-bob": "^0.20.4", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4", @@ -194,7 +194,7 @@ "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/dapp-connector/src/translators/reactjs/useDappList.test.tsx b/packages/dapp-connector/src/translators/reactjs/useDappList.test.tsx index 9b92a60e0a..6d8d7c3c47 100644 --- a/packages/dapp-connector/src/translators/reactjs/useDappList.test.tsx +++ b/packages/dapp-connector/src/translators/reactjs/useDappList.test.tsx @@ -1,7 +1,7 @@ import {useDappList} from './useDappList' import {renderHook, waitFor} from '@testing-library/react-native' import * as React from 'react' -import {QueryClientProvider} from 'react-query' +import {QueryClientProvider} from '@tanstack/react-query' import {queryClientFixture} from '@yoroi/common' import {DappConnectorProvider} from './DappConnectorProvider' import {managerMock} from '../../manager.mocks' diff --git a/packages/dapp-connector/src/translators/reactjs/useDappList.ts b/packages/dapp-connector/src/translators/reactjs/useDappList.ts index 1b4bd85b75..658718ebee 100644 --- a/packages/dapp-connector/src/translators/reactjs/useDappList.ts +++ b/packages/dapp-connector/src/translators/reactjs/useDappList.ts @@ -1,4 +1,4 @@ -import {useQuery, UseQueryOptions} from 'react-query' +import {useQuery, UseQueryOptions} from '@tanstack/react-query' import {DappListResponse} from '../../adapters/api' import {useDappConnector} from './DappConnectorProvider' diff --git a/packages/exchange/package.json b/packages/exchange/package.json index 45fe34fc1e..44abd96b7f 100644 --- a/packages/exchange/package.json +++ b/packages/exchange/package.json @@ -166,7 +166,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4", @@ -181,7 +181,7 @@ "optionalDependencies": { "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/exchange/src/fixtures/wrapper.tsx b/packages/exchange/src/fixtures/wrapper.tsx index c3fcae9b97..8f54fda7d3 100644 --- a/packages/exchange/src/fixtures/wrapper.tsx +++ b/packages/exchange/src/fixtures/wrapper.tsx @@ -1,6 +1,6 @@ import {ErrorBoundary, SuspenseBoundary} from '@yoroi/common' import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' type Props = { queryClient: QueryClient diff --git a/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.test.tsx b/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.test.tsx index c0e175e434..39b7d87f6e 100644 --- a/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.test.tsx +++ b/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' import {Exchange} from '@yoroi/types' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {queryClientFixture} from '@yoroi/common' import {useCreateReferralLink} from './useCreateReferralLink' diff --git a/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.tsx b/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.tsx index 58c12eb422..0de82f1e15 100644 --- a/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.tsx +++ b/packages/exchange/src/translators/reactjs/hooks/useCreateReferralLink.tsx @@ -1,6 +1,6 @@ import {Exchange} from '@yoroi/types' import {AxiosRequestConfig} from 'axios' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' export const useCreateReferralLink = ( { diff --git a/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.test.tsx b/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.test.tsx index 67e75b1c93..2c50f174d1 100644 --- a/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.test.tsx +++ b/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' import {Exchange} from '@yoroi/types' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {queryClientFixture} from '@yoroi/common' import {useExchangeProvidersByOrderType} from './useExchangeProvidersByOrderType' diff --git a/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.tsx b/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.tsx index 65f5bd379d..89389ba1ce 100644 --- a/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.tsx +++ b/packages/exchange/src/translators/reactjs/hooks/useExchangeProvidersByOrderType.tsx @@ -1,5 +1,5 @@ import {Exchange} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' export const useExchangeProvidersByOrderType = ( { diff --git a/packages/explorers/package.json b/packages/explorers/package.json index 23a5ee65a3..45f91a3dad 100644 --- a/packages/explorers/package.json +++ b/packages/explorers/package.json @@ -172,7 +172,7 @@ "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -184,7 +184,7 @@ "optionalDependencies": { "react": "18.2.0", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/notifications/package.json b/packages/notifications/package.json index da3d1241b3..99d751b09e 100644 --- a/packages/notifications/package.json +++ b/packages/notifications/package.json @@ -170,7 +170,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -183,7 +183,7 @@ "optionalDependencies": { "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/portfolio/package.json b/packages/portfolio/package.json index 14476b5989..128924e616 100644 --- a/packages/portfolio/package.json +++ b/packages/portfolio/package.json @@ -173,7 +173,7 @@ "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "rxjs": "7.8.1", @@ -192,7 +192,7 @@ "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", "react-native-mmkv": "3.0.1", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/portfolio/src/fixtures/wrapperMaker.tsx b/packages/portfolio/src/fixtures/wrapperMaker.tsx index 4e8983600b..0456328788 100644 --- a/packages/portfolio/src/fixtures/wrapperMaker.tsx +++ b/packages/portfolio/src/fixtures/wrapperMaker.tsx @@ -1,6 +1,6 @@ import {ErrorBoundary, SuspenseBoundary} from '@yoroi/common' import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' type Props = { queryClient: QueryClient diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.test.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.test.tsx index f6a99a5d3a..15197e09c2 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.test.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' import {queryClientFixture} from '@yoroi/common' diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.tsx index a12b9090f8..bd46d04e5c 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenDiscovery.tsx @@ -1,6 +1,6 @@ import {isRight} from '@yoroi/common' import {Chain, Portfolio} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' export function usePortfolioTokenDiscovery( { diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.test.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.test.tsx index 6174aa64fe..57f56940b9 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.test.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' import {queryClientFixture} from '@yoroi/common' diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.tsx index d2a223d290..6bd8fb50b5 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenInfo.tsx @@ -1,6 +1,6 @@ import {isRight} from '@yoroi/common' import {Chain, Portfolio} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {createUnknownTokenInfo} from '../../helpers/create-unknown-token-info' import {isPrimaryToken} from '../../helpers/is-primary-token' diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.test.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.test.tsx index f7cb5d9930..173cd1f191 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.test.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' import {queryClientFixture} from '@yoroi/common' diff --git a/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.tsx b/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.tsx index 8b6312d54e..efecb6f948 100644 --- a/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.tsx +++ b/packages/portfolio/src/translators/reactjs/usePortfolioTokenTraits.tsx @@ -1,6 +1,6 @@ import {isRight} from '@yoroi/common' import {Chain, Portfolio} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' export function usePortfolioTokenTraits( { diff --git a/packages/resolver/package.json b/packages/resolver/package.json index 5eccce7599..b1dde63c84 100644 --- a/packages/resolver/package.json +++ b/packages/resolver/package.json @@ -180,7 +180,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4", @@ -195,7 +195,7 @@ "optionalDependencies": { "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/resolver/src/fixtures/manager-wrapper.tsx b/packages/resolver/src/fixtures/manager-wrapper.tsx index 4e1ed0e143..8c4bd3ae67 100644 --- a/packages/resolver/src/fixtures/manager-wrapper.tsx +++ b/packages/resolver/src/fixtures/manager-wrapper.tsx @@ -1,6 +1,6 @@ import {Resolver} from '@yoroi/types' import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {SuspenseBoundary} from './SuspenseBoundary' import {ErrorBoundary} from './ErrorBoundary' diff --git a/packages/resolver/src/fixtures/query-client.ts b/packages/resolver/src/fixtures/query-client.ts index d3cb0695fb..db4b25e23d 100644 --- a/packages/resolver/src/fixtures/query-client.ts +++ b/packages/resolver/src/fixtures/query-client.ts @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' export const queryClientFixture = () => new QueryClient({ @@ -6,9 +6,13 @@ export const queryClientFixture = () => queries: { retry: false, cacheTime: 0, + staleTime: 0, + networkMode: 'offlineFirst', }, mutations: { + cacheTime: 0, retry: false, + networkMode: 'offlineFirst', }, }, }) diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.test.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.test.tsx index 5ebecd94af..5d36fa3fc3 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.test.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -8,6 +8,8 @@ import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useResolverCryptoAddresses} from './useResolverCryptoAddresses' import {resolverManagerMocks} from '../../manager.mocks' +jest.useFakeTimers() + describe('useResolverCryptoAddresses', () => { let queryClient: QueryClient @@ -18,6 +20,7 @@ describe('useResolverCryptoAddresses', () => { afterEach(() => { queryClient.clear() + jest.clearAllTimers() }) const mockResolverManager = {...resolverManagerMocks.success} @@ -43,6 +46,7 @@ describe('useResolverCryptoAddresses', () => { resolverManager: mockResolverManager, }) const {getByTestId} = render(, {wrapper}) + jest.advanceTimersByTimeAsync(1e3) await waitFor(() => { expect(getByTestId('addresses')).toBeDefined() diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.tsx index 4f05ae767e..c432566494 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverCryptoAddresses.tsx @@ -1,4 +1,4 @@ -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {Resolver} from '@yoroi/types' import {useResolver} from '../provider/ResolverProvider' diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.test.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.test.tsx index 6961657ee9..072039622b 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.test.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.test.tsx @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {queryClientFixture} from '../../../fixtures/query-client' @@ -6,6 +6,8 @@ import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {resolverManagerMocks} from '../../manager.mocks' import {useResolverSetShowNotice} from './useResolverSetShowNotice' +jest.useFakeTimers() + describe('useResolverSetShowNotice', () => { let queryClient: QueryClient @@ -16,6 +18,7 @@ describe('useResolverSetShowNotice', () => { afterEach(() => { queryClient.clear() + jest.clearAllTimers() }) const mockResolverManager = {...resolverManagerMocks.success} diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.tsx index 90a721edb9..7cc2a025b3 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverSetShowNotice.tsx @@ -1,4 +1,4 @@ -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {useResolver} from '../provider/ResolverProvider' import {useMutationWithInvalidations} from '../../../utils/useMutationWithInvalidations' diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.test.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.test.tsx index 430f97a8a5..151f92f2d5 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.test.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -8,6 +8,8 @@ import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {resolverManagerMocks} from '../../manager.mocks' import {useResolverShowNotice} from './useResolverShowNotice' +jest.useFakeTimers() + describe('useResolverCryptoAddresses', () => { let queryClient: QueryClient @@ -18,6 +20,7 @@ describe('useResolverCryptoAddresses', () => { afterEach(() => { queryClient.clear() + jest.clearAllTimers() }) const mockResolverManager = {...resolverManagerMocks.success} diff --git a/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.tsx b/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.tsx index d423da62ba..e7fab88bab 100644 --- a/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.tsx +++ b/packages/resolver/src/translators/reactjs/hooks/useResolverShowNotice.tsx @@ -1,4 +1,4 @@ -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useResolver} from '../provider/ResolverProvider' diff --git a/packages/resolver/src/translators/reactjs/provider/ResolverProvider.test.tsx b/packages/resolver/src/translators/reactjs/provider/ResolverProvider.test.tsx index 078f7b093c..bc7255cbae 100644 --- a/packages/resolver/src/translators/reactjs/provider/ResolverProvider.test.tsx +++ b/packages/resolver/src/translators/reactjs/provider/ResolverProvider.test.tsx @@ -1,5 +1,5 @@ import {Resolver} from '@yoroi/types' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {queryClientFixture} from '../../../fixtures/query-client' diff --git a/packages/resolver/src/utils/useMutationWithInvalidations.tsx b/packages/resolver/src/utils/useMutationWithInvalidations.tsx index e547ff3567..442ce1d809 100644 --- a/packages/resolver/src/utils/useMutationWithInvalidations.tsx +++ b/packages/resolver/src/utils/useMutationWithInvalidations.tsx @@ -3,7 +3,7 @@ import { UseMutationOptions, useMutation, useQueryClient, -} from 'react-query' +} from '@tanstack/react-query' // TODO: import later from @yoroi/common utils/hooks /* istanbul ignore next */ diff --git a/packages/setup-wallet/package.json b/packages/setup-wallet/package.json index 96b4fea452..f7efcf5719 100644 --- a/packages/setup-wallet/package.json +++ b/packages/setup-wallet/package.json @@ -166,7 +166,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "release-it": "^15.0.0" }, "peerDependencies": { @@ -174,7 +174,7 @@ }, "optionalDependencies": { "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/staking/jest.setup.js b/packages/staking/jest.setup.js index fa4cd455dd..f93b9d98df 100644 --- a/packages/staking/jest.setup.js +++ b/packages/staking/jest.setup.js @@ -3,3 +3,4 @@ jest.mock('@react-native-async-storage/async-storage', () => ) jest.setTimeout(30000) +jest.useFakeTimers() diff --git a/packages/staking/package.json b/packages/staking/package.json index ddceef63d9..2c8902c229 100644 --- a/packages/staking/package.json +++ b/packages/staking/package.json @@ -139,7 +139,6 @@ "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@commitlint/config-conventional": "^17.0.2", - "@react-native-async-storage/async-storage": "2.0.0", "@react-native-community/eslint-config": "^3.0.2", "@react-native/babel-preset": "0.74.86", "@react-native/eslint-config": "0.74.86", @@ -175,7 +174,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -186,9 +185,8 @@ "zod": "3.23.8" }, "optionalDependencies": { - "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/staking/src/fixtures/manager-wrapper.tsx b/packages/staking/src/fixtures/manager-wrapper.tsx index 39e0f58f7f..3f2f16fe3e 100644 --- a/packages/staking/src/fixtures/manager-wrapper.tsx +++ b/packages/staking/src/fixtures/manager-wrapper.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {SuspenseBoundary} from './SuspenseBoundary' import {ErrorBoundary} from './ErrorBoundary' diff --git a/packages/staking/src/fixtures/query-client.ts b/packages/staking/src/fixtures/query-client.ts index d3cb0695fb..db4b25e23d 100644 --- a/packages/staking/src/fixtures/query-client.ts +++ b/packages/staking/src/fixtures/query-client.ts @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' export const queryClientFixture = () => new QueryClient({ @@ -6,9 +6,13 @@ export const queryClientFixture = () => queries: { retry: false, cacheTime: 0, + staleTime: 0, + networkMode: 'offlineFirst', }, mutations: { + cacheTime: 0, retry: false, + networkMode: 'offlineFirst', }, }, }) diff --git a/packages/staking/src/governance/translators/react/hooks.test.tsx b/packages/staking/src/governance/translators/react/hooks.test.tsx index f651b025fc..ed69fb48d9 100644 --- a/packages/staking/src/governance/translators/react/hooks.test.tsx +++ b/packages/staking/src/governance/translators/react/hooks.test.tsx @@ -10,7 +10,7 @@ import { import {GovernanceProvider} from './context' import {managerMock} from '../../mocks' import {act, renderHook, waitFor} from '@testing-library/react-native' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {GovernanceManager} from '../../manager' import {init} from '@emurgo/cross-csl-nodejs' diff --git a/packages/staking/src/governance/translators/react/hooks.ts b/packages/staking/src/governance/translators/react/hooks.ts index 33da9f3566..833ba64a3c 100644 --- a/packages/staking/src/governance/translators/react/hooks.ts +++ b/packages/staking/src/governance/translators/react/hooks.ts @@ -3,7 +3,7 @@ import { UseMutationOptions, useQuery, UseQueryOptions, -} from 'react-query' +} from '@tanstack/react-query' import {useGovernance} from './context' import {GovernanceAction, VoteKind} from '../../manager' import {useMutationWithInvalidations} from '@yoroi/common' diff --git a/packages/swap/package.json b/packages/swap/package.json index 9c57b41cc7..a20a3cce0f 100644 --- a/packages/swap/package.json +++ b/packages/swap/package.json @@ -179,7 +179,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -195,7 +195,7 @@ "optionalDependencies": { "@react-native-async-storage/async-storage": "2.0.0", "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/packages/swap/src/fixtures/manager-wrapper.tsx b/packages/swap/src/fixtures/manager-wrapper.tsx index 8a2361f5e9..f6cebf1d8b 100644 --- a/packages/swap/src/fixtures/manager-wrapper.tsx +++ b/packages/swap/src/fixtures/manager-wrapper.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {Swap} from '@yoroi/types' import {SuspenseBoundary} from './SuspenseBoundary' diff --git a/packages/swap/src/fixtures/query-client.ts b/packages/swap/src/fixtures/query-client.ts index d3cb0695fb..de329b2e9f 100644 --- a/packages/swap/src/fixtures/query-client.ts +++ b/packages/swap/src/fixtures/query-client.ts @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' export const queryClientFixture = () => new QueryClient({ diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.test.tsx index 6d0a9405fa..64393eb288 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.test.tsx @@ -1,4 +1,4 @@ -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {queryClientFixture} from '../../../fixtures/query-client' @@ -7,11 +7,14 @@ import {apiMocks} from '../../../adapters/openswap-api/api.mocks' import {useSwapCreateOrder} from './useSwapCreateOrder' import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' +jest.useFakeTimers() + describe('useSwapCreateOrder', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.tsx index 4d4cae4615..5830dc3009 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapCreateOrder.tsx @@ -1,5 +1,5 @@ import {Swap} from '@yoroi/types' -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {useMutationWithInvalidations} from '@yoroi/common' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.test.tsx index 5c0f42534e..c77586fd9b 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.test.tsx @@ -1,19 +1,22 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' +import {storageSerializer} from '@yoroi/common' import {queryClientFixture} from '../../../fixtures/query-client' import {mockSwapManager, swapManagerMocks} from '../../../manager.mocks' import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useSwapOrdersByStatusCompleted} from './useSwapOrdersByStatusCompleted' -import {storageSerializer} from '@yoroi/common' + +jest.useFakeTimers() describe('useSwapOrdersByStatusCompleted', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.tsx index dc1ea15857..06768295ad 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusCompleted.tsx @@ -1,5 +1,5 @@ import {Swap} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.test.tsx index 736e96de57..1a3d121acb 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -9,11 +9,14 @@ import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useSwapOrdersByStatusOpen} from './useSwapOrdersByStatusOpen' import {storageSerializer} from '@yoroi/common' +jest.useFakeTimers() + describe('useSwapOrdersByStatusOpen', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.tsx index b16f0ee7b8..2d6c8b6b6a 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapOrdersByStatusOpen.tsx @@ -1,5 +1,5 @@ import {Swap} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.test.tsx index 044a6ff584..ef6c934d0e 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -9,11 +9,14 @@ import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useSwapPoolsByPair} from './useSwapPoolsByPair' import {storageSerializer} from '@yoroi/common' +jest.useFakeTimers() + describe('useSwapPoolsByPair', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.tsx index 49c856bf3f..181eb9b72b 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapPoolsByPair.tsx @@ -1,5 +1,5 @@ import {Portfolio, Swap} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.test.tsx index 14052be2b5..b92a23a74b 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {SwapProvider} from '../provider/SwapProvider' @@ -7,11 +7,14 @@ import {queryClientFixture} from '../../../fixtures/query-client' import {mockSwapManager} from '../../../manager.mocks' import {useSwapSetSlippage} from './useSwapSetSlippage' +jest.useFakeTimers() + describe('useSwapSetSlippage', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.tsx index cedd352ab4..d108b6a5d8 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapSetSlippage.tsx @@ -1,4 +1,4 @@ -import {UseMutationOptions} from 'react-query' +import {UseMutationOptions} from '@tanstack/react-query' import {useSwap} from './useSwap' import {useMutationWithInvalidations} from '@yoroi/common' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.test.tsx index 95dd0e0857..e333081d37 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -8,11 +8,14 @@ import {mockSwapManager} from '../../../manager.mocks' import {useSwapSlippage} from './useSwapSlippage' import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' +jest.useFakeTimers() + describe('useSwapSlippage', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.tsx index fa5bd394b3..4d61867a74 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapSlippage.tsx @@ -1,4 +1,4 @@ -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {swapStorageSlippageKey} from '../../../adapters/async-storage/storage' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.test.tsx index 7adc335d2d..88707ce3ab 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -8,11 +8,14 @@ import {mockSwapManager, swapManagerMocks} from '../../../manager.mocks' import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useSwapTokensByPair} from './useSwapTokensByPair' +jest.useFakeTimers() + describe('useSwapTokensByPair', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.tsx index 973ac12381..5d40cd9422 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapTokensByPair.tsx @@ -1,5 +1,5 @@ import {Portfolio} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.test.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.test.tsx index d3b105f969..9a6588e57d 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.test.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient} from 'react-query' +import {QueryClient} from '@tanstack/react-query' import {Text, View} from 'react-native' import {render, waitFor} from '@testing-library/react-native' @@ -8,11 +8,14 @@ import {mockSwapManager, swapManagerMocks} from '../../../manager.mocks' import {wrapperManagerFixture} from '../../../fixtures/manager-wrapper' import {useSwapTokensOnlyVerified} from './useSwapTokensOnlyVerified' +jest.useFakeTimers() + describe('useSwapTokensOnlyVerified', () => { let queryClient: QueryClient beforeEach(() => { jest.clearAllMocks() + jest.clearAllTimers() queryClient = queryClientFixture() }) @@ -50,9 +53,7 @@ describe('useSwapTokensOnlyVerified', () => { }) it('empty result (no-api data) should return []', async () => { - mockSwapManager.tokens.list.onlyVerified = jest - .fn() - .mockResolvedValue(undefined) + mockSwapManager.tokens.list.onlyVerified = jest.fn().mockResolvedValue(null) const TestListToken = () => { const tokens = useSwapTokensOnlyVerified() diff --git a/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.tsx b/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.tsx index 0bcbba66b6..c7a313700d 100644 --- a/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.tsx +++ b/packages/swap/src/translators/reactjs/hooks/useSwapTokensOnlyVerified.tsx @@ -1,5 +1,5 @@ import {Portfolio} from '@yoroi/types' -import {UseQueryOptions, useQuery} from 'react-query' +import {UseQueryOptions, useQuery} from '@tanstack/react-query' import {useSwap} from './useSwap' diff --git a/packages/swap/src/translators/reactjs/provider/SwapProvider.test.tsx b/packages/swap/src/translators/reactjs/provider/SwapProvider.test.tsx index b99f134cc3..6453a105c5 100644 --- a/packages/swap/src/translators/reactjs/provider/SwapProvider.test.tsx +++ b/packages/swap/src/translators/reactjs/provider/SwapProvider.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {QueryClient, QueryClientProvider} from 'react-query' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {renderHook, act} from '@testing-library/react-hooks' import {AppApi} from '@yoroi/api' import {Portfolio} from '@yoroi/types' diff --git a/packages/theme/package.json b/packages/theme/package.json index de74321b43..d9c7aa2c0a 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -167,7 +167,6 @@ "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", "react-native-linear-gradient": "2.5.6", - "react-query": "^3.39.3", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" diff --git a/packages/transfer/package.json b/packages/transfer/package.json index b54f8ba7d4..21deb049b7 100644 --- a/packages/transfer/package.json +++ b/packages/transfer/package.json @@ -165,7 +165,7 @@ "react": "18.2.0", "react-native": "0.74.4", "react-native-builder-bob": "^0.23.2", - "react-query": "^3.39.3", + "@tanstack/react-query": "4.36.1", "react-test-renderer": "18.2.0", "release-it": "^15.0.0", "typescript": "5.0.4" @@ -177,7 +177,7 @@ }, "optionalDependencies": { "react": "18.2.0", - "react-query": "^3.39.3" + "@tanstack/react-query": "4.36.1" }, "packageManager": "yarn@1.22.21", "engines": { diff --git a/yarn.lock b/yarn.lock index 2644c38768..81ec9f5ac8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1156,7 +1156,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.12.5", "@babel/runtime@^7.20.0", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.8", "@babel/runtime@^7.25.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.12.5", "@babel/runtime@^7.20.0", "@babel/runtime@^7.21.0", "@babel/runtime@^7.25.0", "@babel/runtime@^7.8.4": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" integrity sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ== @@ -4310,7 +4310,7 @@ before-after-hook@^2.2.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== -big-integer@^1.6.16, big-integer@^1.6.44: +big-integer@^1.6.44: version "1.6.52" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" integrity sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg== @@ -4436,20 +4436,6 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -broadcast-channel@^3.4.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-3.7.0.tgz#2dfa5c7b4289547ac3f6705f9c00af8723889937" - integrity sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg== - dependencies: - "@babel/runtime" "^7.7.2" - detect-node "^2.1.0" - js-sha3 "0.8.0" - microseconds "0.2.0" - nano-time "1.0.0" - oblivious-set "1.0.0" - rimraf "3.0.2" - unload "2.2.0" - browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" @@ -5813,11 +5799,6 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -detect-node@^2.0.4, detect-node@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== - detox-copilot@^0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/detox-copilot/-/detox-copilot-0.0.5.tgz#1a29ed62edae92fc8c02630d6029832c4c7da82b" @@ -9135,11 +9116,6 @@ js-queue@2.0.2: dependencies: easy-stack "^1.0.1" -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -9791,14 +9767,6 @@ marky@^1.2.2: resolved "https://registry.yarnpkg.com/marky/-/marky-1.2.5.tgz#55796b688cbd72390d2d399eaaf1832c9413e3c0" integrity sha512-q9JtQJKjpsVxCRVgQ+WapguSbKC3SQ5HEzFGPAJMStgh3QjCawp00UKv3MTTAArTmGmmPUvllHZoNbZ3gs0I+Q== -match-sorter@^6.0.2: - version "6.3.4" - resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.3.4.tgz#afa779d8e922c81971fbcb4781c7003ace781be7" - integrity sha512-jfZW7cWS5y/1xswZo8VBOdudUiSd9nifYRWphc9M5D/ee4w4AoXLgBEdRbgVaxbMuagBPeUC5y2Hi8DO6o9aDg== - dependencies: - "@babel/runtime" "^7.23.8" - remove-accents "0.5.0" - memoize-one@^5.0.0: version "5.2.1" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" @@ -10111,11 +10079,6 @@ micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -microseconds@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/microseconds/-/microseconds-0.2.0.tgz#233b25f50c62a65d861f978a4a4f8ec18797dc39" - integrity sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -10411,13 +10374,6 @@ nan@^2.14.0, nan@^2.15.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3" integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw== -nano-time@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef" - integrity sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA== - dependencies: - big-integer "^1.6.16" - nanoassert@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" @@ -10860,11 +10816,6 @@ object.values@^1.1.6, object.values@^1.2.0: define-properties "^1.2.1" es-object-atoms "^1.0.0" -oblivious-set@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/oblivious-set/-/oblivious-set-1.0.0.tgz#c8316f2c2fb6ff7b11b6158db3234c49f733c566" - integrity sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw== - on-finished@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -11754,15 +11705,6 @@ react-native@0.74.4: ws "^6.2.2" yargs "^17.6.2" -react-query@^3.39.3: - version "3.39.3" - resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.39.3.tgz#4cea7127c6c26bdea2de5fb63e51044330b03f35" - integrity sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g== - dependencies: - "@babel/runtime" "^7.5.5" - broadcast-channel "^3.4.1" - match-sorter "^6.0.2" - react-refresh@^0.14.0: version "0.14.2" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.2.tgz#3833da01ce32da470f1f936b9d477da5c7028bf9" @@ -12086,11 +12028,6 @@ release-it@^15.0.0: wildcard-match "5.1.2" yargs-parser "21.1.1" -remove-accents@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.5.0.tgz#77991f37ba212afba162e375b627631315bed687" - integrity sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A== - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -12206,7 +12143,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -13572,14 +13509,6 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -unload@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/unload/-/unload-2.2.0.tgz#ccc88fdcad345faa06a92039ec0f80b488880ef7" - integrity sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA== - dependencies: - "@babel/runtime" "^7.6.2" - detect-node "^2.0.4" - unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"