From bcbbdcfbc59b7b4bc97ef6c0cdd684af6e1dc734 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:55:14 +0100 Subject: [PATCH 1/6] Add support for MUI v6 --- examples/crm/package.json | 4 ++-- examples/no-code/package.json | 2 +- packages/ra-input-rich-text/package.json | 4 ++-- packages/ra-ui-materialui/package.json | 6 +++--- yarn.lock | 20 ++++++++++---------- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/crm/package.json b/examples/crm/package.json index 33a01cec4d..54eb93f3d0 100644 --- a/examples/crm/package.json +++ b/examples/crm/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@hello-pangea/dnd": "^16.3.0", - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@nivo/bar": "^0.80.0", "@nivo/core": "^0.80.0", "clsx": "^2.1.1", diff --git a/examples/no-code/package.json b/examples/no-code/package.json index 5e70f237a9..12b23c0b82 100644 --- a/examples/no-code/package.json +++ b/examples/no-code/package.json @@ -8,7 +8,7 @@ "serve": "vite preview" }, "dependencies": { - "@mui/material": "^5.16.12", + "@mui/material": "^6.0.0", "ra-data-local-storage": "^5.0.0", "ra-no-code": "^5.0.0", "react": "^18.3.1", diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json index afd1b881f9..e67d8cd1ff 100644 --- a/packages/ra-input-rich-text/package.json +++ b/packages/ra-input-rich-text/package.json @@ -46,8 +46,8 @@ "react-dom": "^18.0.0 || ^19.0.0" }, "devDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@testing-library/react": "^15.0.7", "@tiptap/extension-mention": "^2.0.3", "@tiptap/suggestion": "^2.0.3", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index b0096951ec..e86b384f1a 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -26,9 +26,9 @@ "watch": "tsc --outDir dist/esm --module es2015 --watch" }, "devDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", - "@mui/utils": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", + "@mui/utils": "^6.0.0", "@testing-library/react": "^15.0.7", "@types/dompurify": "^3.0.2", "@types/react": "^18.3.3", diff --git a/yarn.lock b/yarn.lock index c18e951d77..35f529b532 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3123,7 +3123,7 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.16.12, @mui/utils@npm:^5.16.14": +"@mui/utils@npm:^5.16.14": version: 5.16.14 resolution: "@mui/utils@npm:5.16.14" dependencies: @@ -3143,7 +3143,7 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^6.3.1": +"@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": version: 6.3.1 resolution: "@mui/utils@npm:6.3.1" dependencies: @@ -14343,7 +14343,7 @@ __metadata: version: 0.0.0-use.local resolution: "no-code@workspace:examples/no-code" dependencies: - "@mui/material": "npm:^5.16.12" + "@mui/material": "npm:^6.0.0" "@vitejs/plugin-react": "npm:^4.2.1" ra-data-local-storage: "npm:^5.0.0" ra-no-code: "npm:^5.0.0" @@ -16305,8 +16305,8 @@ __metadata: version: 0.0.0-use.local resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text" dependencies: - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@testing-library/react": "npm:^15.0.7" "@tiptap/core": "npm:^2.0.3" "@tiptap/extension-color": "npm:^2.0.3" @@ -16397,9 +16397,9 @@ __metadata: version: 0.0.0-use.local resolution: "ra-ui-materialui@workspace:packages/ra-ui-materialui" dependencies: - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" - "@mui/utils": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" + "@mui/utils": "npm:^6.0.0" "@tanstack/react-query": "npm:^5.21.7" "@testing-library/react": "npm:^15.0.7" "@types/dompurify": "npm:^3.0.2" @@ -16496,8 +16496,8 @@ __metadata: resolution: "react-admin-crm@workspace:examples/crm" dependencies: "@hello-pangea/dnd": "npm:^16.3.0" - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@nivo/bar": "npm:^0.80.0" "@nivo/core": "npm:^0.80.0" "@testing-library/jest-dom": "npm:^6.4.5" From 2912b63424aa54eaa51e42497c77fbb81f344fcc Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:08:00 +0100 Subject: [PATCH 2/6] Fix yarn.lock --- examples/simple/package.json | 4 +- yarn.lock | 152 ++--------------------------------- 2 files changed, 7 insertions(+), 149 deletions(-) diff --git a/examples/simple/package.json b/examples/simple/package.json index 4c619b2a4d..d653a64b7e 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -10,8 +10,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@tanstack/react-query": "^5.21.7", "@tanstack/react-query-devtools": "^5.21.7", "jsonexport": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 35f529b532..2de884374a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2862,13 +2862,6 @@ __metadata: languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/core-downloads-tracker@npm:5.16.14" - checksum: eb866003ee4564c40423aadc4513b4c7d72c69723fe7dee4697ac70c19951e6e11093bb190761dc51a8f4d2731e562034ecb284930eec931bae1a56b8e18ca60 - languageName: node - linkType: hard - "@mui/core-downloads-tracker@npm:^6.3.1": version: 6.3.1 resolution: "@mui/core-downloads-tracker@npm:6.3.1" @@ -2876,22 +2869,6 @@ __metadata: languageName: node linkType: hard -"@mui/icons-material@npm:^5.16.12": - version: 5.16.14 - resolution: "@mui/icons-material@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - peerDependencies: - "@mui/material": ^5.0.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 11632d1f9904fda0a751e442d3d948a83977cd9ba81481cda4e61b9dfdbd80b0616e27750728c066a4dc505035d7ad6aa29ff7c6160a9b52a2b313fc89aa4be3 - languageName: node - linkType: hard - "@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/icons-material@npm:6.3.1" @@ -2908,39 +2885,6 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.16.12": - version: 5.16.14 - resolution: "@mui/material@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/core-downloads-tracker": "npm:^5.16.14" - "@mui/system": "npm:^5.16.14" - "@mui/types": "npm:^7.2.15" - "@mui/utils": "npm:^5.16.14" - "@popperjs/core": "npm:^2.11.8" - "@types/react-transition-group": "npm:^4.4.10" - clsx: "npm:^2.1.0" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - react-is: "npm:^19.0.0" - react-transition-group: "npm:^4.4.5" - peerDependencies: - "@emotion/react": ^11.5.0 - "@emotion/styled": ^11.3.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - "@types/react": - optional: true - checksum: e313c1274f18a245f7128c9ccbd6444d6edb91a99fef7b6ec9ece4d2d19da0fec9a484afc24c0c35e9fcc53fb090dc524083d682c78428754a1c5b6cebb70a63 - languageName: node - linkType: hard - "@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/material@npm:6.3.1" @@ -2977,23 +2921,6 @@ __metadata: languageName: node linkType: hard -"@mui/private-theming@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/private-theming@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/utils": "npm:^5.16.14" - prop-types: "npm:^15.8.1" - peerDependencies: - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 9723b63bd19000c096884f5a8900dc228afbe829d880d371865ae29387448cc669c10160bb55369210f3e903afb577ba832a39bc565427351bc27b42591c8099 - languageName: node - linkType: hard - "@mui/private-theming@npm:^6.3.1": version: 6.3.1 resolution: "@mui/private-theming@npm:6.3.1" @@ -3011,27 +2938,6 @@ __metadata: languageName: node linkType: hard -"@mui/styled-engine@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/styled-engine@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@emotion/cache": "npm:^11.13.5" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - peerDependencies: - "@emotion/react": ^11.4.1 - "@emotion/styled": ^11.3.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - checksum: cd512faea4ad3ff5a9b315e136a518223ea3e4e34462fe70c56d1f166c46bee0a885ed982773d75c1d56ead62b95989cc5907601e8d65bfa75494b3f3288c2ad - languageName: node - linkType: hard - "@mui/styled-engine@npm:^6.3.1": version: 6.3.1 resolution: "@mui/styled-engine@npm:6.3.1" @@ -3055,34 +2961,6 @@ __metadata: languageName: node linkType: hard -"@mui/system@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/system@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/private-theming": "npm:^5.16.14" - "@mui/styled-engine": "npm:^5.16.14" - "@mui/types": "npm:^7.2.15" - "@mui/utils": "npm:^5.16.14" - clsx: "npm:^2.1.0" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - peerDependencies: - "@emotion/react": ^11.5.0 - "@emotion/styled": ^11.3.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - "@types/react": - optional: true - checksum: d7ab8dfd9fbecbde4423a0d432e63f45cd8c96bb4e48116f9f9b46cb001c2e32df3a1f09727f8b30c1bc182774cc33e338b1475287a2985dba795ee5486fc4cb - languageName: node - linkType: hard - "@mui/system@npm:^6.3.1": version: 6.3.1 resolution: "@mui/system@npm:6.3.1" @@ -3111,7 +2989,7 @@ __metadata: languageName: node linkType: hard -"@mui/types@npm:^7.2.15, @mui/types@npm:^7.2.21": +"@mui/types@npm:^7.2.21": version: 7.2.21 resolution: "@mui/types@npm:7.2.21" peerDependencies: @@ -3123,26 +3001,6 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/utils@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/types": "npm:^7.2.15" - "@types/prop-types": "npm:^15.7.12" - clsx: "npm:^2.1.1" - prop-types: "npm:^15.8.1" - react-is: "npm:^19.0.0" - peerDependencies: - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 5148dedb8597a76df193df4c3b4ff4bb3c19d99f3b69df8b9d6c9905c5cc5eb750a71429aea7e52a03ad8b858c7ec48d04e5670ecf4e39b8c3a6a84f1a83721a - languageName: node - linkType: hard - "@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": version: 6.3.1 resolution: "@mui/utils@npm:6.3.1" @@ -5255,7 +5113,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12, @types/prop-types@npm:^15.7.14": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.14": version: 15.7.14 resolution: "@types/prop-types@npm:15.7.14" checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1 @@ -7384,7 +7242,7 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^2.0.0, clsx@npm:^2.1.0, clsx@npm:^2.1.1": +"clsx@npm:^2.0.0, clsx@npm:^2.1.1": version: 2.1.1 resolution: "clsx@npm:2.1.1" checksum: c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839 @@ -17939,8 +17797,8 @@ __metadata: resolution: "simple@workspace:examples/simple" dependencies: "@hookform/devtools": "npm:^4.3.3" - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@tanstack/react-query": "npm:^5.21.7" "@tanstack/react-query-devtools": "npm:^5.21.7" "@vitejs/plugin-react": "npm:^4.2.1" From 9fd768a99016a9aca6dfc088bc2a15348ab62424 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:05:36 +0100 Subject: [PATCH 3/6] Revert devDependencies to v5 --- examples/crm/package.json | 4 +- examples/no-code/package.json | 2 +- examples/simple/package.json | 4 +- packages/ra-input-rich-text/package.json | 4 +- packages/ra-ui-materialui/package.json | 6 +- yarn.lock | 170 +++++++++++++++++++++-- 6 files changed, 166 insertions(+), 24 deletions(-) diff --git a/examples/crm/package.json b/examples/crm/package.json index 54eb93f3d0..33a01cec4d 100644 --- a/examples/crm/package.json +++ b/examples/crm/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@hello-pangea/dnd": "^16.3.0", - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@nivo/bar": "^0.80.0", "@nivo/core": "^0.80.0", "clsx": "^2.1.1", diff --git a/examples/no-code/package.json b/examples/no-code/package.json index 12b23c0b82..5e70f237a9 100644 --- a/examples/no-code/package.json +++ b/examples/no-code/package.json @@ -8,7 +8,7 @@ "serve": "vite preview" }, "dependencies": { - "@mui/material": "^6.0.0", + "@mui/material": "^5.16.12", "ra-data-local-storage": "^5.0.0", "ra-no-code": "^5.0.0", "react": "^18.3.1", diff --git a/examples/simple/package.json b/examples/simple/package.json index d653a64b7e..4c619b2a4d 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -10,8 +10,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@tanstack/react-query": "^5.21.7", "@tanstack/react-query-devtools": "^5.21.7", "jsonexport": "^3.2.0", diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json index e67d8cd1ff..afd1b881f9 100644 --- a/packages/ra-input-rich-text/package.json +++ b/packages/ra-input-rich-text/package.json @@ -46,8 +46,8 @@ "react-dom": "^18.0.0 || ^19.0.0" }, "devDependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@testing-library/react": "^15.0.7", "@tiptap/extension-mention": "^2.0.3", "@tiptap/suggestion": "^2.0.3", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index e86b384f1a..b0096951ec 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -26,9 +26,9 @@ "watch": "tsc --outDir dist/esm --module es2015 --watch" }, "devDependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", - "@mui/utils": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", + "@mui/utils": "^5.16.12", "@testing-library/react": "^15.0.7", "@types/dompurify": "^3.0.2", "@types/react": "^18.3.3", diff --git a/yarn.lock b/yarn.lock index 2de884374a..c18e951d77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2862,6 +2862,13 @@ __metadata: languageName: node linkType: hard +"@mui/core-downloads-tracker@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/core-downloads-tracker@npm:5.16.14" + checksum: eb866003ee4564c40423aadc4513b4c7d72c69723fe7dee4697ac70c19951e6e11093bb190761dc51a8f4d2731e562034ecb284930eec931bae1a56b8e18ca60 + languageName: node + linkType: hard + "@mui/core-downloads-tracker@npm:^6.3.1": version: 6.3.1 resolution: "@mui/core-downloads-tracker@npm:6.3.1" @@ -2869,6 +2876,22 @@ __metadata: languageName: node linkType: hard +"@mui/icons-material@npm:^5.16.12": + version: 5.16.14 + resolution: "@mui/icons-material@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + peerDependencies: + "@mui/material": ^5.0.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 11632d1f9904fda0a751e442d3d948a83977cd9ba81481cda4e61b9dfdbd80b0616e27750728c066a4dc505035d7ad6aa29ff7c6160a9b52a2b313fc89aa4be3 + languageName: node + linkType: hard + "@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/icons-material@npm:6.3.1" @@ -2885,6 +2908,39 @@ __metadata: languageName: node linkType: hard +"@mui/material@npm:^5.16.12": + version: 5.16.14 + resolution: "@mui/material@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/core-downloads-tracker": "npm:^5.16.14" + "@mui/system": "npm:^5.16.14" + "@mui/types": "npm:^7.2.15" + "@mui/utils": "npm:^5.16.14" + "@popperjs/core": "npm:^2.11.8" + "@types/react-transition-group": "npm:^4.4.10" + clsx: "npm:^2.1.0" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + react-transition-group: "npm:^4.4.5" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@types/react": + optional: true + checksum: e313c1274f18a245f7128c9ccbd6444d6edb91a99fef7b6ec9ece4d2d19da0fec9a484afc24c0c35e9fcc53fb090dc524083d682c78428754a1c5b6cebb70a63 + languageName: node + linkType: hard + "@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/material@npm:6.3.1" @@ -2921,6 +2977,23 @@ __metadata: languageName: node linkType: hard +"@mui/private-theming@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/private-theming@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/utils": "npm:^5.16.14" + prop-types: "npm:^15.8.1" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 9723b63bd19000c096884f5a8900dc228afbe829d880d371865ae29387448cc669c10160bb55369210f3e903afb577ba832a39bc565427351bc27b42591c8099 + languageName: node + linkType: hard + "@mui/private-theming@npm:^6.3.1": version: 6.3.1 resolution: "@mui/private-theming@npm:6.3.1" @@ -2938,6 +3011,27 @@ __metadata: languageName: node linkType: hard +"@mui/styled-engine@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/styled-engine@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@emotion/cache": "npm:^11.13.5" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.4.1 + "@emotion/styled": ^11.3.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + checksum: cd512faea4ad3ff5a9b315e136a518223ea3e4e34462fe70c56d1f166c46bee0a885ed982773d75c1d56ead62b95989cc5907601e8d65bfa75494b3f3288c2ad + languageName: node + linkType: hard + "@mui/styled-engine@npm:^6.3.1": version: 6.3.1 resolution: "@mui/styled-engine@npm:6.3.1" @@ -2961,6 +3055,34 @@ __metadata: languageName: node linkType: hard +"@mui/system@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/system@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/private-theming": "npm:^5.16.14" + "@mui/styled-engine": "npm:^5.16.14" + "@mui/types": "npm:^7.2.15" + "@mui/utils": "npm:^5.16.14" + clsx: "npm:^2.1.0" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@types/react": + optional: true + checksum: d7ab8dfd9fbecbde4423a0d432e63f45cd8c96bb4e48116f9f9b46cb001c2e32df3a1f09727f8b30c1bc182774cc33e338b1475287a2985dba795ee5486fc4cb + languageName: node + linkType: hard + "@mui/system@npm:^6.3.1": version: 6.3.1 resolution: "@mui/system@npm:6.3.1" @@ -2989,7 +3111,7 @@ __metadata: languageName: node linkType: hard -"@mui/types@npm:^7.2.21": +"@mui/types@npm:^7.2.15, @mui/types@npm:^7.2.21": version: 7.2.21 resolution: "@mui/types@npm:7.2.21" peerDependencies: @@ -3001,7 +3123,27 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": +"@mui/utils@npm:^5.16.12, @mui/utils@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/utils@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/types": "npm:^7.2.15" + "@types/prop-types": "npm:^15.7.12" + clsx: "npm:^2.1.1" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 5148dedb8597a76df193df4c3b4ff4bb3c19d99f3b69df8b9d6c9905c5cc5eb750a71429aea7e52a03ad8b858c7ec48d04e5670ecf4e39b8c3a6a84f1a83721a + languageName: node + linkType: hard + +"@mui/utils@npm:^6.3.1": version: 6.3.1 resolution: "@mui/utils@npm:6.3.1" dependencies: @@ -5113,7 +5255,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.14": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12, @types/prop-types@npm:^15.7.14": version: 15.7.14 resolution: "@types/prop-types@npm:15.7.14" checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1 @@ -7242,7 +7384,7 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^2.0.0, clsx@npm:^2.1.1": +"clsx@npm:^2.0.0, clsx@npm:^2.1.0, clsx@npm:^2.1.1": version: 2.1.1 resolution: "clsx@npm:2.1.1" checksum: c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839 @@ -14201,7 +14343,7 @@ __metadata: version: 0.0.0-use.local resolution: "no-code@workspace:examples/no-code" dependencies: - "@mui/material": "npm:^6.0.0" + "@mui/material": "npm:^5.16.12" "@vitejs/plugin-react": "npm:^4.2.1" ra-data-local-storage: "npm:^5.0.0" ra-no-code: "npm:^5.0.0" @@ -16163,8 +16305,8 @@ __metadata: version: 0.0.0-use.local resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text" dependencies: - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@testing-library/react": "npm:^15.0.7" "@tiptap/core": "npm:^2.0.3" "@tiptap/extension-color": "npm:^2.0.3" @@ -16255,9 +16397,9 @@ __metadata: version: 0.0.0-use.local resolution: "ra-ui-materialui@workspace:packages/ra-ui-materialui" dependencies: - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" - "@mui/utils": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" + "@mui/utils": "npm:^5.16.12" "@tanstack/react-query": "npm:^5.21.7" "@testing-library/react": "npm:^15.0.7" "@types/dompurify": "npm:^3.0.2" @@ -16354,8 +16496,8 @@ __metadata: resolution: "react-admin-crm@workspace:examples/crm" dependencies: "@hello-pangea/dnd": "npm:^16.3.0" - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@nivo/bar": "npm:^0.80.0" "@nivo/core": "npm:^0.80.0" "@testing-library/jest-dom": "npm:^6.4.5" @@ -17797,8 +17939,8 @@ __metadata: resolution: "simple@workspace:examples/simple" dependencies: "@hookform/devtools": "npm:^4.3.3" - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@tanstack/react-query": "npm:^5.21.7" "@tanstack/react-query-devtools": "npm:^5.21.7" "@vitejs/plugin-react": "npm:^4.2.1" From 16a612ac040a81ab6db2cebdefd54ac960d1d7f7 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:13:54 +0100 Subject: [PATCH 4/6] Add support for react-router v7 --- examples/demo/package.json | 4 +- .../src/categories/LinkToRelatedProducts.tsx | 2 +- examples/demo/src/dashboard/CardWithIcon.tsx | 2 +- examples/demo/src/dashboard/NewCustomers.tsx | 2 +- examples/demo/src/dashboard/PendingOrder.tsx | 2 +- .../demo/src/dashboard/PendingReviews.tsx | 2 +- examples/demo/src/layout/Login.tsx | 2 +- examples/demo/src/products/GridList.tsx | 2 +- examples/demo/src/reviews/ReviewList.tsx | 2 +- .../src/segments/LinkToRelatedCustomers.tsx | 2 +- examples/tutorial/package.json | 4 +- packages/ra-core/package.json | 4 +- packages/ra-ui-materialui/package.json | 4 +- packages/react-admin/package.json | 4 +- yarn.lock | 76 +++++++++++++++++-- 15 files changed, 88 insertions(+), 26 deletions(-) diff --git a/examples/demo/package.json b/examples/demo/package.json index e7c1f1823e..7156f49e4b 100644 --- a/examples/demo/package.json +++ b/examples/demo/package.json @@ -29,8 +29,8 @@ "react": "^19.0.0", "react-admin": "^5.0.0", "react-dom": "^19.0.0", - "react-router": "^6.22.0", - "react-router-dom": "^6.22.0", + "react-router": "^7.1.1", + "react-router-dom": "^7.1.1", "recharts": "^2.15.0" }, "scripts": { diff --git a/examples/demo/src/categories/LinkToRelatedProducts.tsx b/examples/demo/src/categories/LinkToRelatedProducts.tsx index bf502f5f09..110c9beac0 100644 --- a/examples/demo/src/categories/LinkToRelatedProducts.tsx +++ b/examples/demo/src/categories/LinkToRelatedProducts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Button from '@mui/material/Button'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { useTranslate, useRecordContext } from 'react-admin'; import { stringify } from 'query-string'; diff --git a/examples/demo/src/dashboard/CardWithIcon.tsx b/examples/demo/src/dashboard/CardWithIcon.tsx index bb0c444686..494db1ea78 100644 --- a/examples/demo/src/dashboard/CardWithIcon.tsx +++ b/examples/demo/src/dashboard/CardWithIcon.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { FC, createElement } from 'react'; import { Card, Box, Typography, Divider } from '@mui/material'; -import { Link, To } from 'react-router-dom'; +import { Link, To } from 'react-router'; import { ReactNode } from 'react'; interface Props { diff --git a/examples/demo/src/dashboard/NewCustomers.tsx b/examples/demo/src/dashboard/NewCustomers.tsx index f357ce8b81..26ff1ce028 100644 --- a/examples/demo/src/dashboard/NewCustomers.tsx +++ b/examples/demo/src/dashboard/NewCustomers.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Avatar, Box, Button } from '@mui/material'; import CustomerIcon from '@mui/icons-material/PersonAdd'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { ListBase, WithListContext, diff --git a/examples/demo/src/dashboard/PendingOrder.tsx b/examples/demo/src/dashboard/PendingOrder.tsx index 49a7ced13c..51362c9ffa 100644 --- a/examples/demo/src/dashboard/PendingOrder.tsx +++ b/examples/demo/src/dashboard/PendingOrder.tsx @@ -8,7 +8,7 @@ import { Box, ListItemButton, } from '@mui/material'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { useTranslate, useReference } from 'react-admin'; import { Customer, Order } from '../types'; diff --git a/examples/demo/src/dashboard/PendingReviews.tsx b/examples/demo/src/dashboard/PendingReviews.tsx index 2a717fd80f..bae2155681 100644 --- a/examples/demo/src/dashboard/PendingReviews.tsx +++ b/examples/demo/src/dashboard/PendingReviews.tsx @@ -10,7 +10,7 @@ import { ListItemText, } from '@mui/material'; import CommentIcon from '@mui/icons-material/Comment'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { ReferenceField, diff --git a/examples/demo/src/layout/Login.tsx b/examples/demo/src/layout/Login.tsx index 4f145f9955..eb46ff0843 100644 --- a/examples/demo/src/layout/Login.tsx +++ b/examples/demo/src/layout/Login.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router'; import { Avatar, diff --git a/examples/demo/src/products/GridList.tsx b/examples/demo/src/products/GridList.tsx index 5a3649e679..bc1e1c8dcc 100644 --- a/examples/demo/src/products/GridList.tsx +++ b/examples/demo/src/products/GridList.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { useTheme, useMediaQuery } from '@mui/material'; import { Box, ImageList, ImageListItem, ImageListItemBar } from '@mui/material'; import { useCreatePath, NumberField, useListContext } from 'react-admin'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; const GridList = () => { const { isPending } = useListContext(); diff --git a/examples/demo/src/reviews/ReviewList.tsx b/examples/demo/src/reviews/ReviewList.tsx index 0accf1c94a..ae4f018a79 100644 --- a/examples/demo/src/reviews/ReviewList.tsx +++ b/examples/demo/src/reviews/ReviewList.tsx @@ -9,7 +9,7 @@ import { TopToolbar, useDefaultTitle, } from 'react-admin'; -import { matchPath, useLocation, useNavigate } from 'react-router-dom'; +import { matchPath, useLocation, useNavigate } from 'react-router'; import { Box, Drawer, useMediaQuery, Theme } from '@mui/material'; import ReviewListMobile from './ReviewListMobile'; diff --git a/examples/demo/src/segments/LinkToRelatedCustomers.tsx b/examples/demo/src/segments/LinkToRelatedCustomers.tsx index 44bc745cfd..7b6db657ef 100644 --- a/examples/demo/src/segments/LinkToRelatedCustomers.tsx +++ b/examples/demo/src/segments/LinkToRelatedCustomers.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Button } from '@mui/material'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router'; import { useTranslate } from 'react-admin'; import { stringify } from 'query-string'; diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json index 1105a69d39..8ed28f92f7 100644 --- a/examples/tutorial/package.json +++ b/examples/tutorial/package.json @@ -14,7 +14,9 @@ "ra-data-json-server": "^5.0.0", "react": "^19.0.0", "react-admin": "^5.0.0", - "react-dom": "^19.0.0" + "react-dom": "^19.0.0", + "react-router": "^7.1.1", + "react-router-dom": "^7.1.1" }, "devDependencies": { "@types/react": "^18.3.3", diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json index 09b82787f7..d39884a88c 100644 --- a/packages/ra-core/package.json +++ b/packages/ra-core/package.json @@ -53,8 +53,8 @@ "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "react-hook-form": "^7.53.0", - "react-router": "^6.22.0", - "react-router-dom": "^6.22.0" + "react-router": "^6.22.0 || ^7.0.0", + "react-router-dom": "^6.22.0 || ^7.0.0" }, "dependencies": { "@tanstack/react-query": "^5.21.7", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index b0096951ec..be5f2b4b73 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -60,8 +60,8 @@ "react-dom": "^18.0.0 || ^19.0.0", "react-hook-form": "*", "react-is": "^18.0.0 || ^19.0.0", - "react-router": "^6.22.0", - "react-router-dom": "^6.22.0" + "react-router": "^6.22.0 || ^7.0.0", + "react-router-dom": "^6.22.0 || ^7.0.0" }, "dependencies": { "@tanstack/react-query": "^5.21.7", diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json index a34200bfff..afae442747 100644 --- a/packages/react-admin/package.json +++ b/packages/react-admin/package.json @@ -43,8 +43,8 @@ "ra-language-english": "^5.4.3", "ra-ui-materialui": "^5.4.3", "react-hook-form": "^7.53.0", - "react-router": "^6.22.0", - "react-router-dom": "^6.22.0" + "react-router": "^6.22.0 || ^7.0.0", + "react-router-dom": "^6.22.0 || ^7.0.0" }, "gitHead": "587df4c27bfcec4a756df4f95e5fc14728dfc0d7" } diff --git a/yarn.lock b/yarn.lock index c18e951d77..c701a8a6fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4883,6 +4883,13 @@ __metadata: languageName: node linkType: hard +"@types/cookie@npm:^0.6.0": + version: 0.6.0 + resolution: "@types/cookie@npm:0.6.0" + checksum: 5b326bd0188120fb32c0be086b141b1481fec9941b76ad537f9110e10d61ee2636beac145463319c71e4be67a17e85b81ca9e13ceb6e3bb63b93d16824d6c149 + languageName: node + linkType: hard + "@types/d3-array@npm:^3.0.3": version: 3.2.1 resolution: "@types/d3-array@npm:3.2.1" @@ -7740,6 +7747,13 @@ __metadata: languageName: node linkType: hard +"cookie@npm:^1.0.1": + version: 1.0.2 + resolution: "cookie@npm:1.0.2" + checksum: fd25fe79e8fbcfcaf6aa61cd081c55d144eeeba755206c058682257cb38c4bd6795c6620de3f064c740695bb65b7949ebb1db7a95e4636efb8357a335ad3f54b + languageName: node + linkType: hard + "core-js-compat@npm:^3.20.0, core-js-compat@npm:^3.31.0, core-js-compat@npm:^3.36.1": version: 3.37.1 resolution: "core-js-compat@npm:3.37.1" @@ -8560,8 +8574,8 @@ __metadata: react: "npm:^19.0.0" react-admin: "npm:^5.0.0" react-dom: "npm:^19.0.0" - react-router: "npm:^6.22.0" - react-router-dom: "npm:^6.22.0" + react-router: "npm:^7.1.1" + react-router-dom: "npm:^7.1.1" recharts: "npm:^2.15.0" rewire: "npm:^5.0.0" rollup-plugin-visualizer: "npm:^5.12.0" @@ -16163,8 +16177,8 @@ __metadata: react: ^18.0.0 || ^19.0.0 react-dom: ^18.0.0 || ^19.0.0 react-hook-form: ^7.53.0 - react-router: ^6.22.0 - react-router-dom: ^6.22.0 + react-router: ^6.22.0 || ^7.0.0 + react-router-dom: ^6.22.0 || ^7.0.0 languageName: unknown linkType: soft @@ -16442,8 +16456,8 @@ __metadata: react-dom: ^18.0.0 || ^19.0.0 react-hook-form: "*" react-is: ^18.0.0 || ^19.0.0 - react-router: ^6.22.0 - react-router-dom: ^6.22.0 + react-router: ^6.22.0 || ^7.0.0 + react-router-dom: ^6.22.0 || ^7.0.0 languageName: unknown linkType: soft @@ -16593,8 +16607,8 @@ __metadata: ra-language-english: "npm:^5.4.3" ra-ui-materialui: "npm:^5.4.3" react-hook-form: "npm:^7.53.0" - react-router: "npm:^6.22.0" - react-router-dom: "npm:^6.22.0" + react-router: "npm:^6.22.0 || ^7.0.0" + react-router-dom: "npm:^6.22.0 || ^7.0.0" rimraf: "npm:^3.0.2" typescript: "npm:^5.1.3" peerDependencies: @@ -16820,6 +16834,18 @@ __metadata: languageName: node linkType: hard +"react-router-dom@npm:^6.22.0 || ^7.0.0, react-router-dom@npm:^7.1.1": + version: 7.1.1 + resolution: "react-router-dom@npm:7.1.1" + dependencies: + react-router: "npm:7.1.1" + peerDependencies: + react: ">=18" + react-dom: ">=18" + checksum: 2dc5b231dd21aab21378c615b1e373149007d173e90db984e6f708b5ee4b28923b3cf88ce7d6f727be927829b37ba37c01436f9f7abeb84ba3d1bfc9ecd4bc72 + languageName: node + linkType: hard + "react-router-dom@npm:^6.22.0, react-router-dom@npm:^6.25.1": version: 6.25.1 resolution: "react-router-dom@npm:6.25.1" @@ -16844,6 +16870,24 @@ __metadata: languageName: node linkType: hard +"react-router@npm:7.1.1, react-router@npm:^6.22.0 || ^7.0.0, react-router@npm:^7.1.1": + version: 7.1.1 + resolution: "react-router@npm:7.1.1" + dependencies: + "@types/cookie": "npm:^0.6.0" + cookie: "npm:^1.0.1" + set-cookie-parser: "npm:^2.6.0" + turbo-stream: "npm:2.4.0" + peerDependencies: + react: ">=18" + react-dom: ">=18" + peerDependenciesMeta: + react-dom: + optional: true + checksum: 39f4859670f286eb2eac29e5830c1f730405701fca0808e5db853ec05e54e55a848c764e10ffd14a7b9b3b2154a0d6449656d7f208b9b3e4b2af780e07bf57a8 + languageName: node + linkType: hard + "react-simple-animate@npm:^3.3.12, react-simple-animate@npm:^3.5.3": version: 3.5.3 resolution: "react-simple-animate@npm:3.5.3" @@ -17821,6 +17865,13 @@ __metadata: languageName: node linkType: hard +"set-cookie-parser@npm:^2.6.0": + version: 2.7.1 + resolution: "set-cookie-parser@npm:2.7.1" + checksum: 060c198c4c92547ac15988256f445eae523f57f2ceefeccf52d30d75dedf6bff22b9c26f756bd44e8e560d44ff4ab2130b178bd2e52ef5571bf7be3bd7632d9a + languageName: node + linkType: hard + "set-function-length@npm:^1.2.1": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" @@ -19044,6 +19095,13 @@ __metadata: languageName: node linkType: hard +"turbo-stream@npm:2.4.0": + version: 2.4.0 + resolution: "turbo-stream@npm:2.4.0" + checksum: e68b2569f1f16e6e9633d090c6024b2ae9f0e97bfeacb572451ca3732e120ebbb546f3bc4afc717c46cb57b5aea6104e04ef497f9912eef6a7641e809518e98a + languageName: node + linkType: hard + "tutorial@workspace:examples/tutorial": version: 0.0.0-use.local resolution: "tutorial@workspace:examples/tutorial" @@ -19057,6 +19115,8 @@ __metadata: react: "npm:^19.0.0" react-admin: "npm:^5.0.0" react-dom: "npm:^19.0.0" + react-router: "npm:^7.1.1" + react-router-dom: "npm:^7.1.1" typescript: "npm:^5.1.3" vite: "npm:^5.0.11" languageName: unknown From 528618b3574d61520bef5a72123cf0ed039603c7 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:34:09 +0100 Subject: [PATCH 5/6] Fix tests --- packages/react-admin/src/Admin.spec.tsx | 4 ++-- test-setup.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/react-admin/src/Admin.spec.tsx b/packages/react-admin/src/Admin.spec.tsx index 985f554025..b02d0d845c 100644 --- a/packages/react-admin/src/Admin.spec.tsx +++ b/packages/react-admin/src/Admin.spec.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { render, screen } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { Basic, InsideRouter, SubPath, DefaultError } from './Admin.stories'; @@ -25,7 +25,7 @@ describe('', () => { it('works when mounted in a subPath', async () => { render(); - screen.getByText('Go to admin').click(); + fireEvent.click(await screen.findByText('Go to admin')); await screen.findByText('Post List'); screen.getAllByText('Comments')[0].click(); await screen.findByText('Comment List'); diff --git a/test-setup.js b/test-setup.js index 750b126752..ef6fdc8cab 100644 --- a/test-setup.js +++ b/test-setup.js @@ -26,3 +26,10 @@ global.Request = Request; /** Mock scrollTo as it is not supported by JSDOM */ global.scrollTo = jest.fn(); + +/** Mock TextEncoder as it is not supported by JSDOM */ +if (!global.TextEncoder || !global.TextDecoder) { + const { TextDecoder, TextEncoder } = require('node:util'); + global.TextEncoder = TextEncoder; + global.TextDecoder = TextDecoder; +} From c9dd0ddb9314769e156b4da5e31f644634b80f50 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:46:13 +0100 Subject: [PATCH 6/6] Ensure react-admin uses rr6 locally --- packages/react-admin/package.json | 4 ++++ yarn.lock | 38 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json index afae442747..19dc88f7d4 100644 --- a/packages/react-admin/package.json +++ b/packages/react-admin/package.json @@ -26,8 +26,12 @@ "watch": "tsc --outDir dist/esm --module es2015 --watch" }, "devDependencies": { + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "cross-env": "^5.2.0", "expect": "^27.4.6", + "react-router": "^6.25.1", + "react-router-dom": "^6.25.1", "rimraf": "^3.0.2", "typescript": "^5.1.3" }, diff --git a/yarn.lock b/yarn.lock index c701a8a6fe..b4bcc62810 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2892,7 +2892,7 @@ __metadata: languageName: node linkType: hard -"@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": +"@mui/icons-material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/icons-material@npm:6.3.1" dependencies: @@ -2941,7 +2941,7 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": +"@mui/material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/material@npm:6.3.1" dependencies: @@ -16598,8 +16598,8 @@ __metadata: version: 0.0.0-use.local resolution: "react-admin@workspace:packages/react-admin" dependencies: - "@mui/icons-material": "npm:^5.16.12 || ^6.0.0" - "@mui/material": "npm:^5.16.12 || ^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" cross-env: "npm:^5.2.0" expect: "npm:^27.4.6" ra-core: "npm:^5.4.3" @@ -16607,8 +16607,8 @@ __metadata: ra-language-english: "npm:^5.4.3" ra-ui-materialui: "npm:^5.4.3" react-hook-form: "npm:^7.53.0" - react-router: "npm:^6.22.0 || ^7.0.0" - react-router-dom: "npm:^6.22.0 || ^7.0.0" + react-router: "npm:^6.25.1" + react-router-dom: "npm:^6.25.1" rimraf: "npm:^3.0.2" typescript: "npm:^5.1.3" peerDependencies: @@ -16834,18 +16834,6 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.22.0 || ^7.0.0, react-router-dom@npm:^7.1.1": - version: 7.1.1 - resolution: "react-router-dom@npm:7.1.1" - dependencies: - react-router: "npm:7.1.1" - peerDependencies: - react: ">=18" - react-dom: ">=18" - checksum: 2dc5b231dd21aab21378c615b1e373149007d173e90db984e6f708b5ee4b28923b3cf88ce7d6f727be927829b37ba37c01436f9f7abeb84ba3d1bfc9ecd4bc72 - languageName: node - linkType: hard - "react-router-dom@npm:^6.22.0, react-router-dom@npm:^6.25.1": version: 6.25.1 resolution: "react-router-dom@npm:6.25.1" @@ -16859,6 +16847,18 @@ __metadata: languageName: node linkType: hard +"react-router-dom@npm:^7.1.1": + version: 7.1.1 + resolution: "react-router-dom@npm:7.1.1" + dependencies: + react-router: "npm:7.1.1" + peerDependencies: + react: ">=18" + react-dom: ">=18" + checksum: 2dc5b231dd21aab21378c615b1e373149007d173e90db984e6f708b5ee4b28923b3cf88ce7d6f727be927829b37ba37c01436f9f7abeb84ba3d1bfc9ecd4bc72 + languageName: node + linkType: hard + "react-router@npm:6.25.1, react-router@npm:^6.22.0, react-router@npm:^6.25.1": version: 6.25.1 resolution: "react-router@npm:6.25.1" @@ -16870,7 +16870,7 @@ __metadata: languageName: node linkType: hard -"react-router@npm:7.1.1, react-router@npm:^6.22.0 || ^7.0.0, react-router@npm:^7.1.1": +"react-router@npm:7.1.1, react-router@npm:^7.1.1": version: 7.1.1 resolution: "react-router@npm:7.1.1" dependencies: