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 */

0 commit comments

Comments
 (0)