Skip to content

Commit ce1a603

Browse files
authored
feat: upgrade tanstack query to v5 (#4360)
* upgrade syntax to v5 * blitz-next changes * fix types and export new functions * fix blitz suspense logic * fix workflow * changeset * fix pnpm version * fix pnpm lock file * latest pnpm version * fix * fix pnpm lock file * fixes * commit * commit * pnpm lock update * revert change * fixes * temp: remove patch * lockfile * chore: fix build and lint * fix: auth-with-rpc tests * qm test * remaining tests * fix rpc unit tests * revrt * another revert pnpm version change * revert back to pnpm 8.6.6 * pnpm lock fix * try fix * fix
1 parent 125370a commit ce1a603

File tree

65 files changed

+538
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+538
-421
lines changed

.changeset/sweet-socks-juggle.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@blitzjs/next": major
3+
"@blitzjs/rpc": major
4+
"blitz": major
5+
"@blitzjs/auth": major
6+
"@blitzjs/codemod": major
7+
"@blitzjs/config": major
8+
"@blitzjs/generator": major
9+
---
10+
11+
TODO: Upgrade @tanstack/react-query to v5.1.1

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
- name: Install playwright
149149
if: matrix.folder != 'next-13-app-dir' || matrix.os != 'windows-latest'
150150
run: |
151-
pnpx playwright@1.28.0 install --with-deps
151+
pnpx playwright@1.49.1 install --with-deps
152152
shell: bash
153153

154154
- name: Build

.github/workflows/pr-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
pr="$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }})"
3131
head_sha="$(echo "$pr" | jq -r .head.sha)"
32-
32+
3333
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
3434
3535
- uses: actions/checkout@v4
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup PNPM
4040
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
4141
with:
42-
version: 8.9.0
42+
version: 8.6.6
4343

4444
- name: Setup Node
4545
uses: actions/setup-node@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Pre-publish
3838
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
3939
with:
40-
version: 8.9.0
40+
version: 8.6.6
4141
- run: pnpm install
4242
env:
4343
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

apps/next13/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@hookform/error-message": "2.0.0",
2020
"@hookform/resolvers": "2.9.10",
2121
"@prisma/client": "^4.5.0",
22-
"@tanstack/react-query": "4.0.10",
22+
"@tanstack/react-query": "5.51.1",
2323
"blitz": "2.2.1",
2424
"flatted": "3.2.7",
2525
"next": "15.0.1",

apps/next13/src/app/loading.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default function Loading() {
2+
// You can add any UI inside Loading, including a Skeleton.
3+
return "Loading..."
4+
}

apps/next13/src/app/react-query.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"use client"
22

3-
import {useQuery, useMutation} from "@blitzjs/rpc"
3+
import {useQuery, useMutation, useSuspenseQuery} from "@blitzjs/rpc"
44
import logout from "../auth/mutations/logout"
55
import getCurrentUser from "../users/queries/getCurrentUser"
66
import {useTransition} from "react"
77
import {useRouter} from "next/navigation"
88

99
export default function Test() {
1010
const router = useRouter()
11-
const [user] = useQuery(getCurrentUser, null)
11+
const [user] = useSuspenseQuery(getCurrentUser, null)
1212
const [isPending, startTransition] = useTransition()
1313
const [logoutMutation] = useMutation(logout)
1414
console.log(user)

apps/toolkit-app-passportjs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

apps/toolkit-app/next.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { withNextAuthAdapter } = require("@blitzjs/auth/next-auth")
21
const { withBlitz } = require("@blitzjs/next")
32

43
/**
@@ -11,4 +10,4 @@ const config = {
1110
},
1211
}
1312

14-
module.exports = withBlitz(withNextAuthAdapter(config))
13+
module.exports = withBlitz(config)

apps/toolkit-app/src/pages/api/auth/[...nextauth].ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)