diff --git a/examples/astro/package.json b/examples/astro/package.json index ee169673..1b2e987b 100644 --- a/examples/astro/package.json +++ b/examples/astro/package.json @@ -25,9 +25,9 @@ "@rspc/solid-query": "workspace:*", "@rspc/svelte-query": "workspace:*", "@rspc/tauri": "workspace:^", - "@tanstack/react-query": "^4.36.1", - "@tanstack/solid-query": "^4.36.1", - "@tanstack/svelte-query": "^4.36.1", + "@tanstack/react-query": "^5.4.3", + "@tanstack/solid-query": "^5.4.3", + "@tanstack/svelte-query": "^5.4.3", "react": "^18.2.0", "react-dom": "^18.2.0", "solid-js": "^1.8.3", diff --git a/examples/astro/src/components/react/index.tsx b/examples/astro/src/components/react/index.tsx index e0b5a30c..8fe35edb 100644 --- a/examples/astro/src/components/react/index.tsx +++ b/examples/astro/src/components/react/index.tsx @@ -97,7 +97,7 @@ function Example({ name }: { name: string }) { diff --git a/examples/astro/src/components/solid/index.tsx b/examples/astro/src/components/solid/index.tsx index a739003b..0a97fac1 100644 --- a/examples/astro/src/components/solid/index.tsx +++ b/examples/astro/src/components/solid/index.tsx @@ -100,7 +100,7 @@ function Example({ name }: { name: string }) { diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 268264e1..7525d4e0 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -7,7 +7,7 @@ "dependencies": { "@rspc/client": "workspace:*", "@rspc/react-query": "workspace:*", - "@tanstack/react-query": "^4.36.1", + "@tanstack/react-query": "^5.4.3", "next": "^13.5.6", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/nextjs/pages/using-use-mutation.tsx b/examples/nextjs/pages/using-use-mutation.tsx index 7747cb62..28c8490b 100644 --- a/examples/nextjs/pages/using-use-mutation.tsx +++ b/examples/nextjs/pages/using-use-mutation.tsx @@ -4,7 +4,7 @@ import { rspc } from "../src/rspc"; import styles from "../styles/Home.module.css"; const UsingUseMutation: NextPage = () => { - const { mutate, data, isLoading, error } = rspc.useMutation("sendMsg"); + const { mutate, data, isPending, error } = rspc.useMutation("sendMsg"); const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); @@ -33,7 +33,7 @@ const UsingUseMutation: NextPage = () => {

- {isLoading && "Loading data ..."} + {isPending && "Loading data ..."} {data && `Server received message: ${data}`} {error && JSON.stringify(error)}

diff --git a/examples/nextjs/tsconfig.json b/examples/nextjs/tsconfig.json index 5a851d6e..0b659951 100644 --- a/examples/nextjs/tsconfig.json +++ b/examples/nextjs/tsconfig.json @@ -1,6 +1,9 @@ { "compilerOptions": { - "target": "es5", + "target": "ESNext", + "module": "ESNext", + // Enable node-style module resolution, for things like npm package imports. + "moduleResolution": "Bundler", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -8,8 +11,6 @@ "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/examples/vercel/package.json b/examples/vercel/package.json index 7510a680..9f3cd581 100644 --- a/examples/vercel/package.json +++ b/examples/vercel/package.json @@ -8,7 +8,7 @@ "dependencies": { "@rspc/client": "workspace:*", "@rspc/react-query": "workspace:*", - "@tanstack/react-query": "^4.36.1", + "@tanstack/react-query": "^5.4.3", "next": "^13.5.6", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/vercel/pages/using-use-mutation.tsx b/examples/vercel/pages/using-use-mutation.tsx index 23b53f2a..844c002f 100644 --- a/examples/vercel/pages/using-use-mutation.tsx +++ b/examples/vercel/pages/using-use-mutation.tsx @@ -4,7 +4,7 @@ import { rspc } from "../src/rspc"; import styles from "../styles/Home.module.css"; const UsingUseMutation: NextPage = () => { - const { mutate, data, isLoading, error } = rspc.useMutation("sendMsg"); + const { mutate, data, isPending, error } = rspc.useMutation("sendMsg"); return (
@@ -33,7 +33,7 @@ const UsingUseMutation: NextPage = () => {

- {isLoading && "Loading data ..."} + {isPending && "Loading data ..."} {data && `Server received message: ${data}`} {error && JSON.stringify(error)}

diff --git a/packages/query-core/package.json b/packages/query-core/package.json index 809db9dd..ee96f0b8 100644 --- a/packages/query-core/package.json +++ b/packages/query-core/package.json @@ -3,6 +3,7 @@ "version": "1.0.0-rc.3", "description": "A blazingly fast and easy to use tRPC-like server for Rust.", "keywords": [], + "module": true, "author": "Oscar Beaumont", "license": "MIT", "main": "dist/index.js", @@ -25,7 +26,7 @@ }, "devDependencies": { "@rspc/client": "workspace:*", - "@tanstack/query-core": "^4.36.1", + "@tanstack/query-core": "^5.4.3", "tslib": "^2.6.2", "tsup": "^7.2.0", "typescript": "^5.2.2", diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 2a870361..8ff999c6 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@rspc/client": "workspace:*", - "@tanstack/react-query": "^4.36.1", + "@tanstack/react-query": "^5.4.3", "@types/react": "^18.2.31", "react": "^18.2.0", "tslib": "^2.6.2", diff --git a/packages/react-query/src/index.tsx b/packages/react-query/src/index.tsx index 4747de39..2e2c9884 100644 --- a/packages/react-query/src/index.tsx +++ b/packages/react-query/src/index.tsx @@ -89,7 +89,7 @@ export function createReactQueryHooks

() { keyAndInput, opts: rawOpts, }), - [tanstack.hashQueryKey(keyAndInput), opts.enabled ?? true] + [tanstack.hashKey(keyAndInput), opts.enabled ?? true] ); } diff --git a/packages/solid-query/package.json b/packages/solid-query/package.json index dae3f4b3..46350a12 100644 --- a/packages/solid-query/package.json +++ b/packages/solid-query/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@rspc/client": "workspace:*", - "@tanstack/solid-query": "^4.36.1", + "@tanstack/solid-query": "^5.4.3", "rollup": "^4.1.4", "rollup-preset-solid": "^2.0.1", "solid-js": "^1.8.3", diff --git a/packages/solid-query/src/index.tsx b/packages/solid-query/src/index.tsx index 9083a6a4..190697a7 100644 --- a/packages/solid-query/src/index.tsx +++ b/packages/solid-query/src/index.tsx @@ -13,11 +13,11 @@ export function createSolidQueryHooks

() { rspc.HookOptions< P, rspc.QueryOptionsOmit< - tanstack.CreateQueryOptions< + tanstack.SolidQueryOptions< rspc.inferQueryResult, rspc.inferQueryError, rspc.inferQueryResult, - () => [K, rspc.inferQueryInput] + [K, rspc.inferQueryInput] > > >; @@ -29,12 +29,7 @@ export function createSolidQueryHooks

() { ], opts?: CreateQueryOptions ) { - return tanstack.createQuery< - rspc.inferQueryResult, - rspc.inferQueryError, - rspc.inferQueryResult, - () => [K, rspc.inferQueryInput] - >(helpers.useQueryArgs(keyAndInput, opts)); + return tanstack.createQuery(() => helpers.useQueryArgs(keyAndInput, opts)); } type CreateMutationOptions< @@ -56,7 +51,7 @@ export function createSolidQueryHooks

() { K extends rspc.inferMutations

["key"] & string, TContext = unknown >(key: K | [K], opts?: CreateMutationOptions) { - return tanstack.createMutation(helpers.useMutationArgs(key, opts)); + return tanstack.createMutation(() => helpers.useMutationArgs(key, opts)); } function createSubscription< diff --git a/packages/svelte-query/package.json b/packages/svelte-query/package.json index b328a41f..8895aee4 100644 --- a/packages/svelte-query/package.json +++ b/packages/svelte-query/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@rspc/client": "workspace:*", "@sveltejs/package": "^2.2.2", - "@tanstack/svelte-query": "^4.36.1", + "@tanstack/svelte-query": "^5.4.3", "tslib": "^2.6.2", "typescript": "^5.2.2", "vitest": "^0.34.6" diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 22d21810..bb9c7ad9 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -1,6 +1,9 @@ { "compilerOptions": { - "target": "es2020", + "target": "ESNext", + "module": "ESNext", + // Enable node-style module resolution, for things like npm package imports. + "moduleResolution": "Bundler", "strict": true, // "noUnusedLocals": true, // TODO: enable this // "noUnusedParameters": true, // TODO: enable this @@ -9,7 +12,6 @@ "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, "strictNullChecks": true, - "moduleResolution": "node", "esModuleInterop": true, "importHelpers": true, "skipLibCheck": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80f53cde..81bb0272 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,14 +82,14 @@ importers: specifier: workspace:^ version: link:../../packages/tauri '@tanstack/react-query': - specifier: ^4.36.1 - version: 4.36.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.4.3 + version: 5.4.3(react-dom@18.2.0)(react@18.2.0) '@tanstack/solid-query': - specifier: ^4.36.1 - version: 4.36.1(solid-js@1.8.3) + specifier: ^5.4.3 + version: 5.4.3(solid-js@1.8.3) '@tanstack/svelte-query': - specifier: ^4.36.1 - version: 4.36.1(svelte@4.2.2) + specifier: ^5.4.3 + version: 5.4.3(svelte@4.2.2) react: specifier: ^18.2.0 version: 18.2.0 @@ -137,8 +137,8 @@ importers: specifier: workspace:* version: link:../../packages/react-query '@tanstack/react-query': - specifier: ^4.36.1 - version: 4.36.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.4.3 + version: 5.4.3(react-dom@18.2.0)(react@18.2.0) next: specifier: ^13.5.6 version: 13.5.6(react-dom@18.2.0)(react@18.2.0) @@ -187,8 +187,8 @@ importers: specifier: workspace:* version: link:../../packages/react-query '@tanstack/react-query': - specifier: ^4.36.1 - version: 4.36.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.4.3 + version: 5.4.3(react-dom@18.2.0)(react@18.2.0) next: specifier: ^13.5.6 version: 13.5.6(react-dom@18.2.0)(react@18.2.0) @@ -236,8 +236,8 @@ importers: specifier: workspace:* version: link:../client '@tanstack/query-core': - specifier: ^4.36.1 - version: 4.36.1 + specifier: ^5.4.3 + version: 5.4.3 tslib: specifier: ^2.6.2 version: 2.6.2 @@ -261,8 +261,8 @@ importers: specifier: workspace:* version: link:../client '@tanstack/react-query': - specifier: ^4.36.1 - version: 4.36.1(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.4.3 + version: 5.4.3(react-dom@18.2.0)(react@18.2.0) '@types/react': specifier: ^18.2.31 version: 18.2.31 @@ -292,8 +292,8 @@ importers: specifier: workspace:* version: link:../client '@tanstack/solid-query': - specifier: ^4.36.1 - version: 4.36.1(solid-js@1.8.3) + specifier: ^5.4.3 + version: 5.4.3(solid-js@1.8.3) rollup: specifier: ^4.1.4 version: 4.1.4 @@ -329,8 +329,8 @@ importers: specifier: ^2.2.2 version: 2.2.2(svelte@4.2.2)(typescript@5.2.2) '@tanstack/svelte-query': - specifier: ^4.36.1 - version: 4.36.1(svelte@4.2.2) + specifier: ^5.4.3 + version: 5.4.3(svelte@4.2.2) tslib: specifier: ^2.6.2 version: 2.6.2 @@ -2711,14 +2711,14 @@ packages: tslib: 2.6.2 dev: false - /@tanstack/query-core@4.36.1: - resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==} + /@tanstack/query-core@5.4.3: + resolution: {integrity: sha512-fnI9ORjcuLGm1sNrKatKIosRQUpuqcD4SV7RqRSVmj8JSicX2aoMyKryHEBpVQvf6N4PaBVgBxQomjsbsGPssQ==} - /@tanstack/react-query@4.36.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==} + /@tanstack/react-query@5.4.3(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-4aSOrRNa6yEmf7mws5QPTVMn8Lp7L38tFoTZ0c1ZmhIvbr8GIA0WT7X5N3yz/nuK8hUtjw9cAzBr4BPDZZ+tzA==} peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^18.0.0 + react-dom: ^18.0.0 react-native: '*' peerDependenciesMeta: react-dom: @@ -2726,25 +2726,24 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.36.1 + '@tanstack/query-core': 5.4.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - use-sync-external-store: 1.2.0(react@18.2.0) - /@tanstack/solid-query@4.36.1(solid-js@1.8.3): - resolution: {integrity: sha512-w8L6B12AsCyF7AB2Np4fj9qsOBfrzzxyIkdsniKo9HErdXdlGLyynYaDm4EGsH9ePPcdJSUX7ELGqmXllofn/Q==} + /@tanstack/solid-query@5.4.3(solid-js@1.8.3): + resolution: {integrity: sha512-vC+EmPZF8GeKCwiGmTIPHdZT9pXZqpATt37YHPhDUnfccTRQYx0jF3OBWDrbVk2bzKOEddJrlzbGh9SppNW9Cw==} peerDependencies: - solid-js: ^1.5.7 + solid-js: ^1.6.0 dependencies: - '@tanstack/query-core': 4.36.1 + '@tanstack/query-core': 5.4.3 solid-js: 1.8.3 - /@tanstack/svelte-query@4.36.1(svelte@4.2.2): - resolution: {integrity: sha512-5fj79QuAu5HuS6G/fairU6ywgILXfs4TGl3+Xc9+MBlmB1aPoQBvGsgJrNyhqvXQcnxro8wDNyZOH8S+Qitycw==} + /@tanstack/svelte-query@5.4.3(svelte@4.2.2): + resolution: {integrity: sha512-mVUTuGkWCvr6PE/CgA75jZtbAtI5WCYrU4DV/WshNOod3H88ynlx2EC8x8PfQGTREl0NUHZwDUxeXIA7RDNfug==} peerDependencies: svelte: '>=3 <5' dependencies: - '@tanstack/query-core': 4.36.1 + '@tanstack/query-core': 5.4.3 svelte: 4.2.2 /@tauri-apps/api@1.5.1: @@ -8285,13 +8284,6 @@ packages: picocolors: 1.0.0 dev: true - /use-sync-external-store@1.2.0(react@18.2.0): - resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true