From 7c538024b7aaf0e6bb1a52c02d821ff78bb59402 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 6 Dec 2024 14:33:07 +0100 Subject: [PATCH 1/5] React 19 dependencies --- admin/test-bad-package/README.mdx | 2 +- package.json | 8 +- .../templates/classic-typescript/package.json | 4 +- .../templates/classic/package.json | 4 +- packages/docusaurus-mdx-loader/package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- packages/docusaurus-plugin-debug/package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- packages/docusaurus-plugin-pwa/package.json | 4 +- .../docusaurus-plugin-rsdoctor/package.json | 4 +- .../docusaurus-plugin-sitemap/package.json | 4 +- packages/docusaurus-plugin-svgr/package.json | 4 +- .../package.json | 4 +- .../docusaurus-preset-classic/package.json | 4 +- .../docusaurus-theme-classic/package.json | 6 +- packages/docusaurus-theme-common/package.json | 4 +- .../package.json | 4 +- .../docusaurus-theme-mermaid/package.json | 6 +- .../package.json | 4 +- packages/docusaurus-types/package.json | 4 +- packages/docusaurus/package.json | 6 +- website/package.json | 4 +- yarn.lock | 75 ++++++++----------- 29 files changed, 93 insertions(+), 102 deletions(-) diff --git a/admin/test-bad-package/README.mdx b/admin/test-bad-package/README.mdx index 40abc5448c2b..260522db2417 100644 --- a/admin/test-bad-package/README.mdx +++ b/admin/test-bad-package/README.mdx @@ -12,7 +12,7 @@ import {version as ReactVersion} from 'react'; import {version as ReactDOMVersion} from 'react-dom'; export function TestComponent() { - const expectedVersion = 18; + const expectedVersion = 19; if (!ReactVersion.startsWith(`${expectedVersion}`)) { throw new Error( `'test-bad-package/README.mdx' is rendered with bad React version: ${ReactVersion}`, diff --git a/package.json b/package.json index aecf0f4b3652..605b19aa5c79 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@types/prompts": "^2.4.4", "@types/react": "^18.2.15", "@types/react-dev-utils": "^9.0.11", - "@types/react-test-renderer": "^18.0.0", + "@types/react-test-renderer": "^19.0.0", "@types/semver": "^7.5.0", "@types/shelljs": "^0.8.12", "@typescript-eslint/eslint-plugin": "^5.62.0", @@ -113,10 +113,10 @@ "lockfile-lint": "^4.14.0", "npm-run-all": "^4.1.5", "prettier": "^2.8.8", - "react": "^18.0.0", - "react-dom": "^18.0.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "react-helmet-async": "^1.3.0", - "react-test-renderer": "^18.0.0", + "react-test-renderer": "^19.0.0", "rimraf": "^3.0.2", "sharp": "^0.32.3", "strip-ansi": "^6.0.1", diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index 5cbb27904f86..168d0e39cbdd 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -20,8 +20,8 @@ "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.6.3", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index aa0709133bc7..338f15974023 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -19,8 +19,8 @@ "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.6.3", diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index 69546431d9d4..c358ab79b5ad 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -58,8 +58,8 @@ "unist-util-remove-position": "^5.0.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-client-redirects/package.json b/packages/docusaurus-plugin-client-redirects/package.json index 7473f9b78c44..094c3a8d6583 100644 --- a/packages/docusaurus-plugin-client-redirects/package.json +++ b/packages/docusaurus-plugin-client-redirects/package.json @@ -32,8 +32,8 @@ "@docusaurus/types": "3.6.3" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-content-blog/package.json b/packages/docusaurus-plugin-content-blog/package.json index 4ed76c8e4733..0d9c247770a7 100644 --- a/packages/docusaurus-plugin-content-blog/package.json +++ b/packages/docusaurus-plugin-content-blog/package.json @@ -52,8 +52,8 @@ }, "peerDependencies": { "@docusaurus/plugin-content-docs": "*", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-content-docs/package.json b/packages/docusaurus-plugin-content-docs/package.json index b0d964444f84..d34f3470fbd5 100644 --- a/packages/docusaurus-plugin-content-docs/package.json +++ b/packages/docusaurus-plugin-content-docs/package.json @@ -61,8 +61,8 @@ "shelljs": "^0.8.5" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-content-pages/package.json b/packages/docusaurus-plugin-content-pages/package.json index f8efc0331d73..1a4461877410 100644 --- a/packages/docusaurus-plugin-content-pages/package.json +++ b/packages/docusaurus-plugin-content-pages/package.json @@ -28,8 +28,8 @@ "webpack": "^5.88.1" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-debug/package.json b/packages/docusaurus-plugin-debug/package.json index 40c84b146811..3448fe68957b 100644 --- a/packages/docusaurus-plugin-debug/package.json +++ b/packages/docusaurus-plugin-debug/package.json @@ -28,8 +28,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-google-analytics/package.json b/packages/docusaurus-plugin-google-analytics/package.json index 5b90e5a123f1..c49e4b56fda4 100644 --- a/packages/docusaurus-plugin-google-analytics/package.json +++ b/packages/docusaurus-plugin-google-analytics/package.json @@ -24,8 +24,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-google-gtag/package.json b/packages/docusaurus-plugin-google-gtag/package.json index 84e2752be3df..9710d370dc32 100644 --- a/packages/docusaurus-plugin-google-gtag/package.json +++ b/packages/docusaurus-plugin-google-gtag/package.json @@ -25,8 +25,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-google-tag-manager/package.json b/packages/docusaurus-plugin-google-tag-manager/package.json index 2faaa9e043bf..672370a0191c 100644 --- a/packages/docusaurus-plugin-google-tag-manager/package.json +++ b/packages/docusaurus-plugin-google-tag-manager/package.json @@ -24,8 +24,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-ideal-image/package.json b/packages/docusaurus-plugin-ideal-image/package.json index 94ae2d1ed34e..9e0918a606a5 100644 --- a/packages/docusaurus-plugin-ideal-image/package.json +++ b/packages/docusaurus-plugin-ideal-image/package.json @@ -38,8 +38,8 @@ }, "peerDependencies": { "jimp": "*", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "peerDependenciesMeta": { "jimp": { diff --git a/packages/docusaurus-plugin-pwa/package.json b/packages/docusaurus-plugin-pwa/package.json index 3a8a68f487b0..632ce0e2730e 100644 --- a/packages/docusaurus-plugin-pwa/package.json +++ b/packages/docusaurus-plugin-pwa/package.json @@ -45,8 +45,8 @@ "fs-extra": "^11.1.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-rsdoctor/package.json b/packages/docusaurus-plugin-rsdoctor/package.json index 7b5f5e6073bd..83be3440e212 100644 --- a/packages/docusaurus-plugin-rsdoctor/package.json +++ b/packages/docusaurus-plugin-rsdoctor/package.json @@ -26,8 +26,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-sitemap/package.json b/packages/docusaurus-plugin-sitemap/package.json index 9cea0a4b00db..f6ad7c3bba5c 100644 --- a/packages/docusaurus-plugin-sitemap/package.json +++ b/packages/docusaurus-plugin-sitemap/package.json @@ -32,8 +32,8 @@ "@total-typescript/shoehorn": "^0.1.2" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-svgr/package.json b/packages/docusaurus-plugin-svgr/package.json index c4af737e688f..490f153b0c9a 100644 --- a/packages/docusaurus-plugin-svgr/package.json +++ b/packages/docusaurus-plugin-svgr/package.json @@ -28,8 +28,8 @@ "webpack": "^5.88.1" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-plugin-vercel-analytics/package.json b/packages/docusaurus-plugin-vercel-analytics/package.json index 65c6e85387f0..535d83a1467d 100644 --- a/packages/docusaurus-plugin-vercel-analytics/package.json +++ b/packages/docusaurus-plugin-vercel-analytics/package.json @@ -27,8 +27,8 @@ "tslib": "^2.6.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-preset-classic/package.json b/packages/docusaurus-preset-classic/package.json index 77736348bcfe..45c5e856763d 100644 --- a/packages/docusaurus-preset-classic/package.json +++ b/packages/docusaurus-preset-classic/package.json @@ -34,8 +34,8 @@ "@docusaurus/types": "3.6.3" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-theme-classic/package.json b/packages/docusaurus-theme-classic/package.json index 849448cbcadf..dcb32c1d275e 100644 --- a/packages/docusaurus-theme-classic/package.json +++ b/packages/docusaurus-theme-classic/package.json @@ -52,12 +52,12 @@ "@types/prismjs": "^1.26.0", "@types/rtlcss": "^3.5.1", "fs-extra": "^11.1.1", - "react-test-renderer": "^18.0.0", + "react-test-renderer": "^19.0.0", "utility-types": "^3.10.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-theme-common/package.json b/packages/docusaurus-theme-common/package.json index 6bff8d544502..6d9d68da0db1 100644 --- a/packages/docusaurus-theme-common/package.json +++ b/packages/docusaurus-theme-common/package.json @@ -52,8 +52,8 @@ }, "peerDependencies": { "@docusaurus/plugin-content-docs": "*", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-theme-live-codeblock/package.json b/packages/docusaurus-theme-live-codeblock/package.json index adb317c148a2..7ceba587c28c 100644 --- a/packages/docusaurus-theme-live-codeblock/package.json +++ b/packages/docusaurus-theme-live-codeblock/package.json @@ -38,8 +38,8 @@ "@types/buble": "^0.20.1" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-theme-mermaid/package.json b/packages/docusaurus-theme-mermaid/package.json index 5904a63b25c5..0f107909b532 100644 --- a/packages/docusaurus-theme-mermaid/package.json +++ b/packages/docusaurus-theme-mermaid/package.json @@ -42,11 +42,11 @@ "tslib": "^2.6.0" }, "devDependencies": { - "react-test-renderer": "^18.0.0" + "react-test-renderer": "^19.0.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-theme-search-algolia/package.json b/packages/docusaurus-theme-search-algolia/package.json index 7736e766e356..53fbb1933311 100644 --- a/packages/docusaurus-theme-search-algolia/package.json +++ b/packages/docusaurus-theme-search-algolia/package.json @@ -54,8 +54,8 @@ "@docusaurus/module-type-aliases": "3.6.3" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/packages/docusaurus-types/package.json b/packages/docusaurus-types/package.json index d54d448916b3..c2558cdd0fcc 100644 --- a/packages/docusaurus-types/package.json +++ b/packages/docusaurus-types/package.json @@ -24,7 +24,7 @@ "webpack-merge": "^5.9.0" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" } } diff --git a/packages/docusaurus/package.json b/packages/docusaurus/package.json index 6ec765a2e816..784d1cfd7059 100644 --- a/packages/docusaurus/package.json +++ b/packages/docusaurus/package.json @@ -88,14 +88,14 @@ "@types/serve-handler": "^6.1.4", "@types/update-notifier": "^6.0.4", "@types/webpack-bundle-analyzer": "^4.7.0", - "react-test-renderer": "^18.0.0", + "react-test-renderer": "^19.0.0", "tmp-promise": "^3.0.3", "tree-node-cli": "^1.6.0" }, "peerDependencies": { "@mdx-js/react": "^3.0.0", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "react": "^19.0.0", + "react-dom": "^19.0.0" }, "engines": { "node": ">=18.0" diff --git a/website/package.json b/website/package.json index fc61ef63ae06..4f1442b77001 100644 --- a/website/package.json +++ b/website/package.json @@ -58,8 +58,8 @@ "netlify-plugin-cache": "^1.0.3", "pure-react-carousel": "^1.30.1", "raw-loader": "^4.0.2", - "react": "^18.0.0", - "react-dom": "^18.0.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", "react-lite-youtube-embed": "^2.3.52", "react-medium-image-zoom": "^5.1.6", "recma-mdx-displayname": "^0.4.1", diff --git a/yarn.lock b/yarn.lock index 3e31547793d2..6f7cce3b49ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4234,10 +4234,10 @@ "@types/history" "^4.7.11" "@types/react" "*" -"@types/react-test-renderer@^18.0.0": - version "18.3.0" - resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-18.3.0.tgz#839502eae70058a4ae161f63385a8e7929cef4c0" - integrity sha512-HW4MuEYxfDbOHQsVlY/XtOvNHftCVEPhJF2pQXXwcUiUF+Oyb0usgp48HSgpK5rt8m9KZb22yqOeZm+rrVG8gw== +"@types/react-test-renderer@^19.0.0": + version "19.0.0" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-19.0.0.tgz#4cdeace7561bf359ee167f51704f420c07d4bd8d" + integrity sha512-qDVnNybqFm2eZKJ4jD34EvRd6VHD67KjgnWaEMM0Id9L22EpWe3nOSVKHWL1XWRCxUWe3lhXwlEeCKD1BlJCQA== dependencies: "@types/react" "*" @@ -15103,13 +15103,12 @@ react-dom@16.14.0: prop-types "^15.6.2" scheduler "^0.19.1" -react-dom@^18.0.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" - integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== +react-dom@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57" + integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ== dependencies: - loose-envify "^1.1.0" - scheduler "^0.23.2" + scheduler "^0.25.0" react-error-boundary@^3.1.0: version "3.1.4" @@ -15139,16 +15138,21 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", "react-is@^17.0.1 || ^18.0.0", react-is@^18.0.0, react-is@^18.3.1: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" - integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== - react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +"react-is@^17.0.1 || ^18.0.0", react-is@^18.0.0: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + +react-is@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-19.0.0.tgz#d6669fd389ff022a9684f708cf6fa4962d1fea7a" + integrity sha512-H91OHcwjZsbq3ClIDHMzBShc1rotbfACdWENsmEf0IFvZ3FgGPtdHMcsv45bQ1hAbgdfiA8SnxTKfDS+x/8m2g== + react-json-view-lite@^1.2.0: version "1.5.0" resolved "https://registry.yarnpkg.com/react-json-view-lite/-/react-json-view-lite-1.5.0.tgz#377cc302821717ac79a1b6d099e1891df54c8662" @@ -15222,22 +15226,13 @@ react-router@5.3.4, react-router@^5.3.4: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" -react-shallow-renderer@^16.15.0: - version "16.15.0" - resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz#48fb2cf9b23d23cde96708fe5273a7d3446f4457" - integrity sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA== - dependencies: - object-assign "^4.1.1" - react-is "^16.12.0 || ^17.0.0 || ^18.0.0" - -react-test-renderer@^18.0.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.3.1.tgz#e693608a1f96283400d4a3afead6893f958b80b4" - integrity sha512-KkAgygexHUkQqtvvx/otwxtuFu5cVjfzTCtjXLH9boS19/Nbtg84zS7wIQn39G8IlrhThBpQsMKkq5ZHZIYFXA== +react-test-renderer@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-19.0.0.tgz#ca6fa322c58d4bfa34635788fe242a8c3daa4c7d" + integrity sha512-oX5u9rOQlHzqrE/64CNr0HB0uWxkCQmZNSfozlYvwE71TLVgeZxVf0IjouGEr1v7r1kcDifdAJBeOhdhxsG/DA== dependencies: - react-is "^18.3.1" - react-shallow-renderer "^16.15.0" - scheduler "^0.23.2" + react-is "^19.0.0" + scheduler "^0.25.0" react-waypoint@^10.3.0: version "10.3.0" @@ -15258,12 +15253,10 @@ react@16.14.0: object-assign "^4.1.1" prop-types "^15.6.2" -react@^18.0.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" - integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== - dependencies: - loose-envify "^1.1.0" +react@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd" + integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== read-cmd-shim@3.0.0: version "3.0.0" @@ -16020,12 +16013,10 @@ scheduler@^0.19.1: loose-envify "^1.1.0" object-assign "^4.1.1" -scheduler@^0.23.2: - version "0.23.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" - integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== - dependencies: - loose-envify "^1.1.0" +scheduler@^0.25.0: + version "0.25.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015" + integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA== schema-dts@^1.1.2: version "1.1.2" From 9acdf024cc6d88f394f82d1ef54f5b9e51250df9 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 6 Dec 2024 15:09:36 +0100 Subject: [PATCH 2/5] React 19 types --- package.json | 2 +- .../docusaurus-module-type-aliases/package.json | 2 +- yarn.lock | 14 ++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 605b19aa5c79..c6831e4a3564 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "@types/lodash": "^4.14.197", "@types/node": "^18.16.19", "@types/prompts": "^2.4.4", - "@types/react": "^18.2.15", + "@types/react": "^19.0.0", "@types/react-dev-utils": "^9.0.11", "@types/react-test-renderer": "^19.0.0", "@types/semver": "^7.5.0", diff --git a/packages/docusaurus-module-type-aliases/package.json b/packages/docusaurus-module-type-aliases/package.json index a7ba21f20ea4..2316d61fc5d7 100644 --- a/packages/docusaurus-module-type-aliases/package.json +++ b/packages/docusaurus-module-type-aliases/package.json @@ -14,7 +14,7 @@ "dependencies": { "@docusaurus/types": "3.6.3", "@types/history": "^4.7.11", - "@types/react": "*", + "@types/react": "^19.0.0", "@types/react-router-config": "*", "@types/react-router-dom": "*", "react-helmet-async": "*", diff --git a/yarn.lock b/yarn.lock index 6f7cce3b49ea..40f81505dd88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4174,11 +4174,6 @@ "@types/node" "*" kleur "^3.0.3" -"@types/prop-types@*": - version "15.7.13" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.13.tgz#2af91918ee12d9d32914feb13f5326658461b451" - integrity sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA== - "@types/qs@*": version "6.9.16" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794" @@ -4241,12 +4236,11 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.2.15": - version "18.3.12" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60" - integrity sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw== +"@types/react@*", "@types/react@^19.0.0": + version "19.0.0" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.0.tgz#fbbb53ce223f4e2b750ad5dd09580b2c43522bbf" + integrity sha512-MY3oPudxvMYyesqs/kW1Bh8y9VqSmf+tzqw3ae8a9DZW68pUe3zAdHeI1jc6iAysuRdACnVknHP8AhwD4/dxtg== dependencies: - "@types/prop-types" "*" csstype "^3.0.2" "@types/relateurl@*": From ca7ef20d06e8648a55bca5d004facfea755efff3 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 6 Dec 2024 18:38:23 +0100 Subject: [PATCH 3/5] fix type errors --- packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts | 4 ++-- packages/docusaurus-theme-common/src/utils/reactUtils.tsx | 2 +- .../docusaurus-theme-common/src/utils/skipToContentUtils.tsx | 2 +- .../src/theme/SearchBar/index.tsx | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts b/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts index 12cf2eff4c8d..208584861a28 100644 --- a/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts +++ b/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts @@ -11,7 +11,7 @@ import {useMutationObserver} from './useMutationObserver'; // Callback fires when the "hidden" attribute of a tabpanel changes // See https://github.com/facebook/docusaurus/pull/7485 function useTabBecameVisibleCallback( - codeBlockRef: RefObject, + codeBlockRef: RefObject, callback: () => void, ) { const [hiddenTabElement, setHiddenTabElement] = useState< @@ -53,7 +53,7 @@ function useTabBecameVisibleCallback( } export function useCodeWordWrap(): { - readonly codeBlockRef: RefObject; + readonly codeBlockRef: RefObject; readonly isEnabled: boolean; readonly isCodeScrollable: boolean; readonly toggle: () => void; diff --git a/packages/docusaurus-theme-common/src/utils/reactUtils.tsx b/packages/docusaurus-theme-common/src/utils/reactUtils.tsx index 764b34ec98f5..e426d3d8526a 100644 --- a/packages/docusaurus-theme-common/src/utils/reactUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/reactUtils.tsx @@ -44,7 +44,7 @@ export function useEvent unknown>( * Gets `value` from the last render. */ export function usePrevious(value: T): T | undefined { - const ref = useRef(); + const ref = useRef(undefined); useIsomorphicLayoutEffect(() => { ref.current = value; diff --git a/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx b/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx index 3c5e16fd1cf1..fcc4228a6830 100644 --- a/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx @@ -52,7 +52,7 @@ function useSkipToContent(): { * so that keyboard navigators can instantly interact with the link and jump * to content. */ - containerRef: React.RefObject; + containerRef: React.RefObject; /** * Callback fired when the skip to content link has been clicked. * It will programmatically focus the main content. diff --git a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx index d367dada2672..21da9aeedfd2 100644 --- a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx +++ b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx @@ -199,7 +199,6 @@ function DocSearch({ })), ).current; - // @ts-expect-error: TODO fix lib issue after React 19, using JSX.Element const resultsFooterComponent: DocSearchProps['resultsFooterComponent'] = useMemo( () => From c2c20de559b7e4ec23868f93d3029c07a52c3170 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 6 Dec 2024 18:53:46 +0100 Subject: [PATCH 4/5] quick fix for React 19 ideal image default props --- .../src/theme/IdealImage/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/docusaurus-plugin-ideal-image/src/theme/IdealImage/index.tsx b/packages/docusaurus-plugin-ideal-image/src/theme/IdealImage/index.tsx index a983927ec4a3..e5b16dcfc4de 100644 --- a/packages/docusaurus-plugin-ideal-image/src/theme/IdealImage/index.tsx +++ b/packages/docusaurus-plugin-ideal-image/src/theme/IdealImage/index.tsx @@ -93,6 +93,10 @@ export default function IdealImage(props: Props): ReactNode { return ( = 19 not applying defaultProps + icons={ReactIdealImage.defaultProps.icons} + // @ts-expect-error: quick fix for React >= 19 not applying defaultProps + theme={ReactIdealImage.defaultProps.theme} {...propsRest} height={img.src.height ?? 100} width={img.src.width ?? 100} From 06781f024ec70c53c5467f691250a7f3584a5b48 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 6 Dec 2024 19:00:12 +0100 Subject: [PATCH 5/5] fix type --- packages/docusaurus/src/client/exports/Link.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus/src/client/exports/Link.tsx b/packages/docusaurus/src/client/exports/Link.tsx index 76c9f4f5ea69..e294ecff7b70 100644 --- a/packages/docusaurus/src/client/exports/Link.tsx +++ b/packages/docusaurus/src/client/exports/Link.tsx @@ -100,7 +100,7 @@ function Link( const IOSupported = ExecutionEnvironment.canUseIntersectionObserver; - const ioRef = useRef(); + const ioRef = useRef(undefined); const handleRef = (el: HTMLAnchorElement | null) => { innerRef.current = el;