Skip to content

Commit 3fa3a4e

Browse files
chore: support next.js 15 (#4387)
* chore: upgrade to next.js 15 * fix: await cookies and headers in blitz auth * chore: run codemod * upgrade to latest react * fix: add await to blitz rpc handler * chore: upgrade to latest dynamic import * fix: remaining type fixes * Create wild-news-shop.md * fix: react types * upgrade testing library * fix turbopack exports * fix * chore: remove outdated `@testing-library/react-hooks` * Merge branch 'siddharth/upgrade-to-next-15' of https://github.com/blitz-js/blitz into siddharth/upgrade-to-next-15 * upgrade testing library * fix turbopack exports * fix chore: remove outdated `@testing-library/react-hooks` * upgrade to react 19 * fix unit tests * fix * fix * fix again --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 565db3c commit 3fa3a4e

File tree

72 files changed

+1132
-721
lines changed

Some content is hidden

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

72 files changed

+1132
-721
lines changed

.changeset/wild-news-shop.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@blitzjs/auth": minor
3+
"@blitzjs/next": minor
4+
"@blitzjs/rpc": minor
5+
"blitz": minor
6+
---
7+
8+
chore: support next.js 15

apps/next13/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
"@tanstack/react-query": "4.0.10",
2323
"blitz": "2.1.4",
2424
"flatted": "3.2.7",
25-
"next": "14.2.15",
25+
"next": "15.0.1",
2626
"prisma": "^4.5.0",
27-
"react": "18.2.0",
28-
"react-dom": "18.2.0",
27+
"react": "19.0.0",
28+
"react-dom": "19.0.0",
2929
"react-hook-form": "7.39.1",
3030
"superjson": "1.11.0",
3131
"zod": "3.23.8"
3232
},
3333
"devDependencies": {
3434
"@types/node": "18.11.7",
35-
"@types/react": "18.0.23",
36-
"@types/react-dom": "18.0.7",
35+
"@types/react": "npm:types-react@19.0.0",
36+
"@types/react-dom": "npm:types-react-dom@19.0.0",
3737
"eslint": "8.26.0",
3838
"eslint-config-next": "13.0.0",
3939
"typescript": "4.8.4"

apps/next13/src/core/components/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {zodResolver} from "@hookform/resolvers/zod"
44
import {z} from "zod"
55

66
export interface FormProps<S extends z.ZodType<any, any>>
7-
extends Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit"> {
7+
extends Omit<PropsWithoutRef<React.JSX.IntrinsicElements["form"]>, "onSubmit"> {
88
/** All your form fields */
99
children?: ReactNode
1010
/** Text to display in the submit button */

apps/next13/src/core/components/LabeledTextField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import {forwardRef, PropsWithoutRef, ComponentPropsWithoutRef} from "react"
22
import {useFormContext} from "react-hook-form"
33
import {ErrorMessage} from "@hookform/error-message"
44

5-
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
5+
export interface LabeledTextFieldProps
6+
extends PropsWithoutRef<React.JSX.IntrinsicElements["input"]> {
67
/** Field name. */
78
name: string
89
/** Field label. */
910
label: string
1011
/** Field type. Doesn't include radio buttons and checkboxes */
1112
type?: "text" | "password" | "email" | "number"
12-
outerProps?: PropsWithoutRef<JSX.IntrinsicElements["div"]>
13+
outerProps?: PropsWithoutRef<React.JSX.IntrinsicElements["div"]>
1314
labelProps?: ComponentPropsWithoutRef<"label">
1415
}
1516

apps/toolkit-app-passportjs/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,22 @@
3131
"@hookform/resolvers": "2.9.10",
3232
"@prisma/client": "6.1.0",
3333
"blitz": "2.1.4",
34-
"next": "14.2.15",
34+
"next": "15.0.1",
3535
"openid-client": "5.2.1",
3636
"prisma": "6.1.0",
37-
"react": "18.2.0",
38-
"react-dom": "18.2.0",
37+
"react": "19.0.0",
38+
"react-dom": "19.0.0",
3939
"react-hook-form": "7.39.1",
4040
"ts-node": "10.9.1",
4141
"zod": "3.23.8"
4242
},
4343
"devDependencies": {
4444
"@next/bundle-analyzer": "12.0.8",
45-
"@testing-library/react": "13.4.0",
46-
"@testing-library/react-hooks": "8.0.1",
45+
"@testing-library/react": "16.0.1",
4746
"@types/jest": "29.2.2",
4847
"@types/node": "18.11.9",
4948
"@types/preview-email": "2.0.1",
50-
"@types/react": "18.0.25",
49+
"@types/react": "npm:types-react@19.0.0",
5150
"@typescript-eslint/eslint-plugin": "5.42.1",
5251
"eslint": "8.27.0",
5352
"eslint-config-next": "12.3.1",

apps/toolkit-app-passportjs/src/core/components/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
44
import { z } from "zod"
55

66
export interface FormProps<S extends z.ZodType<any, any>>
7-
extends Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit"> {
7+
extends Omit<PropsWithoutRef<React.JSX.IntrinsicElements["form"]>, "onSubmit"> {
88
/** All your form fields */
99
children?: ReactNode
1010
/** Text to display in the submit button */

apps/toolkit-app-passportjs/src/core/components/LabeledTextField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { forwardRef, PropsWithoutRef, ComponentPropsWithoutRef } from "react"
22
import { useFormContext } from "react-hook-form"
33
import { ErrorMessage } from "@hookform/error-message"
44

5-
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
5+
export interface LabeledTextFieldProps
6+
extends PropsWithoutRef<React.JSX.IntrinsicElements["input"]> {
67
/** Field name. */
78
name: string
89
/** Field label. */
910
label: string
1011
/** Field type. Doesn't include radio buttons and checkboxes */
1112
type?: "text" | "password" | "email" | "number"
12-
outerProps?: PropsWithoutRef<JSX.IntrinsicElements["div"]>
13+
outerProps?: PropsWithoutRef<React.JSX.IntrinsicElements["div"]>
1314
labelProps?: ComponentPropsWithoutRef<"label">
1415
}
1516

apps/toolkit-app/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/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,22 @@
3232
"@hookform/resolvers": "2.9.10",
3333
"@prisma/client": "6.1.0",
3434
"blitz": "2.1.4",
35-
"next": "14.2.15",
35+
"next": "15.0.1",
3636
"next-auth": "4.24.7",
3737
"prisma": "6.1.0",
38-
"react": "18.2.0",
39-
"react-dom": "18.2.0",
38+
"react": "19.0.0",
39+
"react-dom": "19.0.0",
4040
"react-hook-form": "7.39.1",
4141
"ts-node": "10.9.1",
4242
"zod": "3.23.8"
4343
},
4444
"devDependencies": {
4545
"@next/bundle-analyzer": "12.0.8",
4646
"@testing-library/jest-dom": "5.16.5",
47-
"@testing-library/react": "13.4.0",
48-
"@testing-library/react-hooks": "8.0.1",
47+
"@testing-library/react": "16.0.1",
4948
"@types/node": "18.11.9",
5049
"@types/preview-email": "2.0.1",
51-
"@types/react": "18.0.25",
50+
"@types/react": "npm:types-react@19.0.0",
5251
"@typescript-eslint/eslint-plugin": "5.42.1",
5352
"@vitejs/plugin-react": "2.2.0",
5453
"eslint": "8.27.0",

apps/toolkit-app/src/core/components/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
44
import { z } from "zod"
55

66
export interface FormProps<S extends z.ZodType<any, any>>
7-
extends Omit<PropsWithoutRef<JSX.IntrinsicElements["form"]>, "onSubmit"> {
7+
extends Omit<PropsWithoutRef<React.JSX.IntrinsicElements["form"]>, "onSubmit"> {
88
/** All your form fields */
99
children?: ReactNode
1010
/** Text to display in the submit button */

apps/toolkit-app/src/core/components/LabelSelectField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef } from "react"
22
import { useFormContext } from "react-hook-form"
33
import { ErrorMessage } from "@hookform/error-message"
44

5-
export interface LabeledSelectFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["select"]> {
5+
export interface LabeledSelectFieldProps
6+
extends PropsWithoutRef<React.JSX.IntrinsicElements["select"]> {
67
/** Field name. */
78
name: string
89
/** Field label. */
910
label: string
1011
/** Field type. Doesn't include radio buttons and checkboxes */
1112
options: any[]
12-
outerProps?: PropsWithoutRef<JSX.IntrinsicElements["div"]>
13+
outerProps?: PropsWithoutRef<React.JSX.IntrinsicElements["div"]>
1314
labelProps?: ComponentPropsWithoutRef<"label">
1415
}
1516

apps/toolkit-app/src/core/components/LabeledTextField.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { forwardRef, PropsWithoutRef, ComponentPropsWithoutRef } from "react"
22
import { useFormContext } from "react-hook-form"
33
import { ErrorMessage } from "@hookform/error-message"
44

5-
export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements["input"]> {
5+
export interface LabeledTextFieldProps
6+
extends PropsWithoutRef<React.JSX.IntrinsicElements["input"]> {
67
/** Field name. */
78
name: string
89
/** Field label. */
910
label: string
1011
/** Field type. Doesn't include radio buttons and checkboxes */
1112
type?: "text" | "password" | "email" | "number"
12-
outerProps?: PropsWithoutRef<JSX.IntrinsicElements["div"]>
13+
outerProps?: PropsWithoutRef<React.JSX.IntrinsicElements["div"]>
1314
labelProps?: ComponentPropsWithoutRef<"label">
1415
}
1516

apps/web/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
"blitz": "2.1.4",
2727
"jest": "29.3.0",
2828
"jest-environment-jsdom": "29.3.0",
29-
"next": "14.2.15",
29+
"next": "15.0.1",
3030
"passport-mock-strategy": "2.0.0",
3131
"passport-twitter": "1.0.4",
3232
"prisma": "6.1.0",
33-
"react": "18.2.0",
34-
"react-dom": "18.2.0",
33+
"react": "19.0.0",
34+
"react-dom": "19.0.0",
3535
"ts-node": "10.9.1"
3636
},
3737
"devDependencies": {
3838
"@next/bundle-analyzer": "12.0.8",
39-
"@types/react": "18.0.25",
39+
"@types/react": "npm:types-react@19.0.0",
4040
"eslint": "8.27.0",
4141
"typescript": "^4.8.4"
4242
}

integration-tests/auth-with-rpc/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,21 @@
2626
"@prisma/client": "6.1.0",
2727
"blitz": "2.1.4",
2828
"delay": "5.0.0",
29-
"next": "14.2.15",
29+
"next": "15.0.1",
3030
"prisma": "6.1.0",
31-
"react": "18.2.0",
32-
"react-dom": "18.2.0",
31+
"react": "19.0.0",
32+
"react-dom": "19.0.0",
3333
"react-hook-form": "7.39.1",
3434
"ts-node": "10.9.1",
3535
"zod": "3.23.8"
3636
},
3737
"devDependencies": {
3838
"@next/bundle-analyzer": "12.0.8",
3939
"@testing-library/jest-dom": "5.16.5",
40-
"@testing-library/react": "13.4.0",
41-
"@testing-library/react-hooks": "8.0.1",
40+
"@testing-library/react": "16.0.1",
4241
"@types/node": "18.11.9",
4342
"@types/preview-email": "2.0.1",
44-
"@types/react": "18.0.25",
43+
"@types/react": "npm:types-react@19.0.0",
4544
"@typescript-eslint/eslint-plugin": "5.42.1",
4645
"@vitejs/plugin-react": "2.2.0",
4746
"eslint": "8.27.0",

integration-tests/auth/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"@prisma/client": "6.1.0",
2424
"blitz": "2.1.4",
2525
"lowdb": "3.0.0",
26-
"next": "14.2.15",
26+
"next": "15.0.1",
2727
"prisma": "6.1.0",
28-
"react": "18.2.0",
29-
"react-dom": "18.2.0",
28+
"react": "19.0.0",
29+
"react-dom": "19.0.0",
3030
"secure-password": "4.0.0",
3131
"wait-port": "1.0.4"
3232
},
@@ -36,7 +36,7 @@
3636
"@types/fs-extra": "9.0.13",
3737
"@types/node": "18.7.13",
3838
"@types/node-fetch": "2.6.1",
39-
"@types/react": "18.0.25",
39+
"@types/react": "npm:types-react@19.0.0",
4040
"b64-lite": "1.4.0",
4141
"eslint": "8.27.0",
4242
"fs-extra": "10.0.1",

integration-tests/get-initial-props/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
"@prisma/client": "6.1.0",
2323
"blitz": "2.1.4",
2424
"lowdb": "2.1.0",
25-
"next": "14.2.15",
25+
"next": "15.0.1",
2626
"prisma": "6.1.0",
27-
"react": "18.2.0",
28-
"react-dom": "18.2.0"
27+
"react": "19.0.0",
28+
"react-dom": "19.0.0"
2929
},
3030
"devDependencies": {
3131
"@blitzjs/config": "2.1.4",
3232
"@next/bundle-analyzer": "12.0.8",
3333
"@types/express": "4.17.13",
3434
"@types/fs-extra": "9.0.13",
3535
"@types/node-fetch": "2.6.1",
36-
"@types/react": "18.0.25",
36+
"@types/react": "npm:types-react@19.0.0",
3737
"b64-lite": "1.4.0",
3838
"eslint": "8.27.0",
3939
"fs-extra": "10.0.1",

integration-tests/middleware/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
"@blitzjs/next": "2.1.4",
1616
"@blitzjs/rpc": "2.1.4",
1717
"blitz": "2.1.4",
18-
"next": "14.2.15",
19-
"react": "18.2.0",
20-
"react-dom": "18.2.0"
18+
"next": "15.0.1",
19+
"react": "19.0.0",
20+
"react-dom": "19.0.0"
2121
},
2222
"devDependencies": {
2323
"@next/bundle-analyzer": "12.0.8",
2424
"@types/express": "4.17.13",
2525
"@types/fs-extra": "9.0.13",
2626
"@types/node-fetch": "2.6.1",
27-
"@types/react": "18.0.25",
27+
"@types/react": "npm:types-react@19.0.0",
2828
"eslint": "8.27.0",
2929
"fs-extra": "10.0.1",
3030
"get-port": "6.1.2",

integration-tests/next-13-app-dir/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/app/building-your-application/configuring/typescript for more information.

integration-tests/next-13-app-dir/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"@prisma/client": "6.1.0",
2525
"blitz": "2.1.4",
2626
"lowdb": "2.1.0",
27-
"next": "14.2.15",
27+
"next": "15.0.1",
2828
"prisma": "6.1.0",
29-
"react": "18.2.0",
30-
"react-dom": "18.2.0",
29+
"react": "19.0.0",
30+
"react-dom": "19.0.0",
3131
"secure-password": "4.0.0",
3232
"wait-port": "1.0.4"
3333
},
@@ -37,7 +37,7 @@
3737
"@types/fs-extra": "9.0.13",
3838
"@types/node": "18.7.13",
3939
"@types/node-fetch": "2.6.1",
40-
"@types/react": "18.0.25",
40+
"@types/react": "npm:types-react@19.0.0",
4141
"b64-lite": "1.4.0",
4242
"eslint": "8.27.0",
4343
"fs-extra": "10.0.1",

integration-tests/no-suspense/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
"@prisma/client": "6.1.0",
2323
"blitz": "2.1.4",
2424
"lowdb": "3.0.0",
25-
"next": "14.2.15",
25+
"next": "15.0.1",
2626
"prisma": "6.1.0",
27-
"react": "18.2.0",
28-
"react-dom": "18.2.0"
27+
"react": "19.0.0",
28+
"react-dom": "19.0.0"
2929
},
3030
"devDependencies": {
3131
"@blitzjs/config": "2.1.4",
3232
"@next/bundle-analyzer": "12.0.8",
3333
"@types/express": "4.17.13",
3434
"@types/fs-extra": "9.0.13",
3535
"@types/node-fetch": "2.6.1",
36-
"@types/react": "18.0.25",
36+
"@types/react": "npm:types-react@19.0.0",
3737
"b64-lite": "1.4.0",
3838
"eslint": "8.27.0",
3939
"fs-extra": "10.0.1",

integration-tests/qm/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"@prisma/client": "6.1.0",
1616
"@tanstack/react-query": "4.0.10",
1717
"blitz": "2.1.4",
18-
"next": "14.2.15",
18+
"next": "15.0.1",
1919
"prisma": "6.1.0",
20-
"react": "18.2.0",
21-
"react-dom": "18.2.0"
20+
"react": "19.0.0",
21+
"react-dom": "19.0.0"
2222
},
2323
"devDependencies": {
24-
"@testing-library/react": "13.4.0",
25-
"@types/react": "18.0.25",
24+
"@testing-library/react": "16.0.1",
25+
"@types/react": "npm:types-react@19.0.0",
2626
"@vitejs/plugin-react": "1.3.0",
2727
"delay": "5.0.0",
2828
"eslint": "8.27.0",

0 commit comments

Comments
 (0)