Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/angry-islands-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"wagmi": minor
"@wagmi/solid": minor
"@wagmi/core": minor
"@wagmi/vue": minor
---

Bumped Tanstack Query Packages to v5.90.x
2 changes: 2 additions & 0 deletions packages/core/src/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ export { fallback } from '../transports/fallback.js'

export type { SelectChains } from '../types/chain.js'

export type { MutationFunctionContext } from '../types/query.js'

export type { Register, ResolvedRegister } from '../types/register.js'

////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/query/getFeeHistory.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { QueryClient } from '@tanstack/query-core'
import { chain, config } from '@wagmi/test'
import { expect, test } from 'vitest'

import { getFeeHistoryQueryOptions } from './getFeeHistory.js'

const queryClient = new QueryClient()

test('default', async () => {
expect(
getFeeHistoryQueryOptions(config, {
Expand Down Expand Up @@ -109,6 +112,7 @@ test('behavior: blockCount is required', async () => {
const options = getFeeHistoryQueryOptions(config, {})
await expect(
options.queryFn({
client: queryClient,
queryKey: options.queryKey,
signal: new AbortSignal(),
meta: undefined,
Expand All @@ -122,6 +126,7 @@ test('behavior: rewardPercentiles is required', async () => {
const options = getFeeHistoryQueryOptions(config, { blockCount: 4 })
await expect(
options.queryFn({
client: queryClient,
queryKey: options.queryKey,
signal: new AbortSignal(),
meta: undefined,
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/query/infiniteReadContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export function infiniteReadContractsQueryOptions<
InfiniteReadContractsQueryFnData<contracts, allowFailure>,
ReadContractsErrorType,
InfiniteReadContractsData<contracts, allowFailure>,
InfiniteReadContractsData<contracts, allowFailure>,
InfiniteReadContractsQueryKey<contracts, allowFailure, pageParam, config>,
pageParam
>
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/query/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ export type InfiniteQueryOptions<
queryFnData = unknown,
error = DefaultError,
data = queryFnData,
queryData = queryFnData,
queryKey extends QueryKey = QueryKey,
pageParam = unknown,
///
options extends InfiniteQueryObserverOptions<
queryFnData,
error,
data,
queryData,
queryKey,
pageParam
> = InfiniteQueryObserverOptions<
queryFnData,
error,
data,
queryData,
queryKey,
pageParam
>,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/types/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type * as Query from '@tanstack/query-core'
import type { Compute, LooseOmit, RequiredBy, UnionLooseOmit } from './utils.js'

export type { MutationFunctionContext } from '@tanstack/query-core'

export type MutationParameter<
data = unknown,
error = Error,
Expand Down
15 changes: 15 additions & 0 deletions packages/react/src/hooks/codegen/createUseReadContract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}),
)

await vi.waitUntil(() => result.current.isSuccess, { timeout: 10_000 })

Check failure on line 27 in packages/react/src/hooks/codegen/createUseReadContract.test.ts

View workflow job for this annotation

GitHub Actions / Verify / Test (4, 4)

[react (chromium)] packages/react/src/hooks/codegen/createUseReadContract.test.ts > default

Error: Timed out in waitUntil! ❯ packages/react/src/hooks/codegen/createUseReadContract.test.ts:27:11

Check failure on line 27 in packages/react/src/hooks/codegen/createUseReadContract.test.ts

View workflow job for this annotation

GitHub Actions / Verify / Test (4, 4)

[react (chromium)] packages/react/src/hooks/codegen/createUseReadContract.test.ts > default

Error: Timed out in waitUntil! ❯ packages/react/src/hooks/codegen/createUseReadContract.test.ts:27:11

expect(result.current).toMatchInlineSnapshot(`
{
Expand All @@ -36,6 +36,7 @@
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -50,6 +51,10 @@
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"readContract",
{
Expand Down Expand Up @@ -96,6 +101,7 @@
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -110,6 +116,10 @@
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"readContract",
{
Expand Down Expand Up @@ -152,6 +162,7 @@
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -166,6 +177,10 @@
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"readContract",
{
Expand Down
15 changes: 15 additions & 0 deletions packages/react/src/hooks/codegen/createUseSimulateContract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test('default', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -74,6 +75,10 @@ test('default', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"simulateContract",
{
Expand Down Expand Up @@ -144,6 +149,7 @@ test('multichain', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -158,6 +164,10 @@ test('multichain', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"simulateContract",
{
Expand Down Expand Up @@ -221,6 +231,7 @@ test('functionName', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -235,6 +246,10 @@ test('functionName', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"simulateContract",
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { MutationFunctionContext } from '@wagmi/core'
import { abi } from '@wagmi/test'
import type { Address, Hash } from 'viem'
import { mainnet, optimism } from 'viem/chains'
Expand Down Expand Up @@ -28,16 +29,17 @@ test('context', () => {

const { writeContract } = useWriteErc20({
mutation: {
onMutate() {
onMutate(_mutationContext) {
return contextValue
},
onSuccess(data, variables, context) {
onSuccess(data, variables, context, mutationContext) {
expectTypeOf(data).toEqualTypeOf<Hash>()
expectTypeOf(variables.functionName).toEqualTypeOf<string>()
expectTypeOf(variables.args).toEqualTypeOf<
readonly unknown[] | undefined
>()
expectTypeOf(context).toEqualTypeOf<typeof contextValue>()
expectTypeOf(mutationContext).toEqualTypeOf<MutationFunctionContext>()
},
},
})
Expand All @@ -49,11 +51,12 @@ test('context', () => {
args: ['0x', 123n],
},
{
onSuccess(data, variables, context) {
onSuccess(data, variables, context, mutationContext) {
expectTypeOf(data).toEqualTypeOf<Hash>()
expectTypeOf(variables.functionName).toEqualTypeOf<'transfer'>()
expectTypeOf(variables.args).toEqualTypeOf<readonly [Address, bigint]>()
expectTypeOf(context).toEqualTypeOf<typeof contextValue>()
expectTypeOf(context).toEqualTypeOf<typeof contextValue | undefined>()
expectTypeOf(mutationContext).toEqualTypeOf<MutationFunctionContext>()
},
},
)
Expand Down
20 changes: 20 additions & 0 deletions packages/react/src/hooks/useBalance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ test('default', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -50,6 +51,10 @@ test('default', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"balance",
{
Expand Down Expand Up @@ -84,6 +89,7 @@ test('parameters: chainId', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -98,6 +104,10 @@ test('parameters: chainId', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"balance",
{
Expand Down Expand Up @@ -126,6 +136,7 @@ test('behavior: address: undefined -> defined', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": false,
"isError": false,
"isFetched": false,
"isFetchedAfterMount": false,
Expand All @@ -140,6 +151,10 @@ test('behavior: address: undefined -> defined', async () => {
"isRefetching": false,
"isStale": false,
"isSuccess": false,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"balance",
{
Expand Down Expand Up @@ -171,6 +186,7 @@ test('behavior: address: undefined -> defined', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -185,6 +201,10 @@ test('behavior: address: undefined -> defined', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"balance",
{
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/hooks/useBlock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test('mounts', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -34,6 +35,10 @@ test('mounts', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"block",
{
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/hooks/useBlockNumber.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test('mounts', async () => {
"failureCount": 0,
"failureReason": null,
"fetchStatus": "idle",
"isEnabled": true,
"isError": false,
"isFetched": true,
"isFetchedAfterMount": true,
Expand All @@ -35,6 +36,10 @@ test('mounts', async () => {
"isRefetching": false,
"isStale": true,
"isSuccess": true,
"promise": Promise {
"reason": [Error: experimental_prefetchInRender feature flag is not enabled],
"status": "rejected",
},
"queryKey": [
"blockNumber",
{
Expand Down
Loading
Loading