From 354f5a05bf6a5a81de7dabb347966b79bb2f70c6 Mon Sep 17 00:00:00 2001 From: jordyvanderhaegen Date: Fri, 13 Dec 2024 02:32:31 +0100 Subject: [PATCH] [1.x] feat: support react 19 (#2121) * feat: support react 19 * chore: use react 19 in playground * chore: unable to build due to ts issues in older type definitions * Align React dependencies --------- Co-authored-by: Jonathan Reinink --- package-lock.json | 87 +++++++++++++++++++++------------- packages/react/package.json | 8 ++-- playgrounds/react/package.json | 8 ++-- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2d9e6d650..39803e77e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1226,12 +1226,13 @@ } }, "node_modules/@types/react-dom": { - "version": "16.9.24", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.24.tgz", - "integrity": "sha512-Gcmq2JTDheyWn/1eteqyzzWKSqDjYU6KYsIvH7thb7CR5OYInAWOX+7WnKf6PaU/cbdOc4szJItcDEJO7UGmfA==", + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.1.tgz", + "integrity": "sha512-hljHij7MpWPKF6u5vojuyfV0YA4YURsQG7KT6SzV0Zs2BXAtgdTxG6A229Ub/xiWV4w/7JL8fi6aAyjshH4meA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/react": "^16" + "@types/react": "*" } }, "node_modules/@types/scheduler": { @@ -3539,19 +3540,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", - "dev": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" - }, - "peerDependencies": { - "react": "^18.2.0" - } - }, "node_modules/react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", @@ -3680,15 +3668,6 @@ } ] }, - "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dev": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -5171,14 +5150,14 @@ "lodash.isequal": "^4.5.0" }, "devDependencies": { - "@types/react": "^16.9.1", - "@types/react-dom": "^16.9.17", + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "@types/react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "esbuild": "^0.16.13", - "react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "typescript": "^4.9.4" }, "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18.0.0" + "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "packages/react/node_modules/typescript": { @@ -5921,21 +5900,61 @@ "name": "@inertiajs/react-playground", "devDependencies": { "@inertiajs/react": "1.3.0-beta.2", - "@types/react": "^16.14.35", - "@types/react-dom": "^16.9.18", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "^3.0.0", "autoprefixer": "^10.4.13", "axios": "^1.6.0", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", "postcss": "^8.4.31", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "tailwindcss": "^3.2.4", "typescript": "^4.9.5", "vite": "^4.5.3" } }, + "playgrounds/react/node_modules/@types/react": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.1.tgz", + "integrity": "sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "playgrounds/react/node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "playgrounds/react/node_modules/react-dom": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", + "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.25.0" + }, + "peerDependencies": { + "react": "^19.0.0" + } + }, + "playgrounds/react/node_modules/scheduler": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", + "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", + "dev": true, + "license": "MIT" + }, "playgrounds/react/node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", diff --git a/packages/react/package.json b/packages/react/package.json index 538edb720..4ea2be4eb 100755 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -49,14 +49,14 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@types/react": "^16.9.1", - "@types/react-dom": "^16.9.17", + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "@types/react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "esbuild": "^0.16.13", - "react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "typescript": "^4.9.4" }, "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18.0.0" + "react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "dependencies": { "@inertiajs/core": "1.3.0-beta.2", diff --git a/playgrounds/react/package.json b/playgrounds/react/package.json index 50531415b..0bf2e50f0 100644 --- a/playgrounds/react/package.json +++ b/playgrounds/react/package.json @@ -7,16 +7,16 @@ }, "devDependencies": { "@inertiajs/react": "1.3.0-beta.2", - "@types/react": "^16.14.35", - "@types/react-dom": "^16.9.18", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "^3.0.0", "autoprefixer": "^10.4.13", "axios": "^1.6.0", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", "postcss": "^8.4.31", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "tailwindcss": "^3.2.4", "typescript": "^4.9.5", "vite": "^4.5.3"