From 009ff9121ab1f738dd39f47435d37286adf8021c Mon Sep 17 00:00:00 2001 From: Mattias Andersson Date: Fri, 11 Oct 2024 15:38:36 +0200 Subject: [PATCH] Update redux to latest version (#851) * - Update redux to latest version. useDispatch used in EditableTextCellWithCrudAndModified requires correct action types, but best practice is to derive types from store. Since we don't have a store, we need a different solution here. Will just typecast to "never" for now. * - Add type to Dispatch instead of casting actions as never. - Remove unused @types/react-redux. --- packages/filter/package.json | 4 +- packages/grid/package.json | 10 ++- .../EditableTextCellWithCrudAndModified.tsx | 3 +- packages/redux/package.json | 8 +-- yarn.lock | 63 +++++++------------ 5 files changed, 34 insertions(+), 54 deletions(-) diff --git a/packages/filter/package.json b/packages/filter/package.json index 95221abd4..cbe84d3ef 100644 --- a/packages/filter/package.json +++ b/packages/filter/package.json @@ -53,7 +53,7 @@ "prop-types": ">=15.5.4", "react": ">=18.3.1", "react-dom": ">=18.3.1", - "redux": ">=4.0.5" + "redux": ">=5.0.1" }, "devDependencies": { "@emotion/react": "^11.11.4", @@ -65,7 +65,7 @@ "prop-types": "^15.5.4", "react": "^18.3.1", "react-dom": "^18.3.1", - "redux": "^4.0.5" + "redux": "^5.0.1" }, "files": [ "dist" diff --git a/packages/grid/package.json b/packages/grid/package.json index b2a5f3d71..2fb58c05b 100644 --- a/packages/grid/package.json +++ b/packages/grid/package.json @@ -51,13 +51,12 @@ "@types/lodash-es": ">=4.17.12", "@types/react": ">=18.3.3", "@types/react-dom": ">=18.3.0", - "@types/react-redux": ">=7.1.8", "csstype": ">=3.0.8", "prop-types": ">=15.5.4", "react": ">=18.3.1", "react-dom": ">=18.3.1", - "react-redux": ">=7.2.0", - "redux": ">=4.0.5" + "react-redux": ">=9.1.2", + "redux": ">=5.0.1" }, "devDependencies": { "@emotion/react": "^11.11.4", @@ -67,13 +66,12 @@ "@types/lodash-es": "^4.17.12", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "@types/react-redux": "^7.1.8", "csstype": "^3.0.8", "prop-types": "^15.5.4", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-redux": "^7.2.0", - "redux": "^4.0.5" + "react-redux": "^9.1.2", + "redux": "^5.0.1" }, "files": [ "dist" diff --git a/packages/grid/src/features/table-ui/components/cells/EditableTextCellWithCrudAndModified.tsx b/packages/grid/src/features/table-ui/components/cells/EditableTextCellWithCrudAndModified.tsx index 175523105..cc013c8b5 100644 --- a/packages/grid/src/features/table-ui/components/cells/EditableTextCellWithCrudAndModified.tsx +++ b/packages/grid/src/features/table-ui/components/cells/EditableTextCellWithCrudAndModified.tsx @@ -25,6 +25,7 @@ import { CrudStatusIndicator, hasIndicatorContent, } from "../CrudStatusIndicator"; +import { Action, Dispatch } from "redux"; interface Props { value?: string; @@ -58,7 +59,7 @@ export const EditableTextCellWithCrudAndModified = }: Props) { const enableGridCell = true; - const dispatch = useDispatch(); + const dispatch = useDispatch() as Dispatch; const modifiedFieldsState = useSelector( modifiedFieldsRedux.selectors.getState, diff --git a/packages/redux/package.json b/packages/redux/package.json index d641fffee..dd6c7089a 100644 --- a/packages/redux/package.json +++ b/packages/redux/package.json @@ -36,8 +36,8 @@ "prop-types": ">=15.5.4", "react": ">=18.3.1", "react-dom": ">=18.3.1", - "react-redux": ">=7.2.0", - "redux": ">=4.0.5" + "react-redux": ">=9.1.2", + "redux": ">=5.0.1" }, "devDependencies": { "@types/react": "^18.3.3", @@ -45,8 +45,8 @@ "prop-types": "^15.5.4", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-redux": "^7.2.0", - "redux": "^4.0.5" + "react-redux": "^9.1.2", + "redux": "^5.0.1" }, "files": [ "dist" diff --git a/yarn.lock b/yarn.lock index 8a3065cf8..fbcce94d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -257,7 +257,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.7" -"@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7": version "7.25.0" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz" integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw== @@ -2608,14 +2608,6 @@ dependencies: "@types/unist" "*" -"@types/hoist-non-react-statics@^3.3.0": - version "3.3.1" - resolved "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz" - integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== - dependencies: - "@types/react" "*" - hoist-non-react-statics "^3.3.0" - "@types/http-errors@*": version "2.0.4" resolved "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz" @@ -2723,16 +2715,6 @@ dependencies: "@types/react" "*" -"@types/react-redux@^7.1.8": - version "7.1.11" - resolved "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.11.tgz" - integrity sha512-OjaFlmqy0CRbYKBoaWF84dub3impqnLJUrz4u8PRjDzaa4n1A2cVmjMV81shwXyAD5x767efhA8STFGJz/r1Zg== - dependencies: - "@types/hoist-non-react-statics" "^3.3.0" - "@types/react" "*" - hoist-non-react-statics "^3.3.0" - redux "^4.0.0" - "@types/react-test-renderer@*": version "17.0.0" resolved "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-17.0.0.tgz" @@ -2797,6 +2779,11 @@ resolved "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz" integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== +"@types/use-sync-external-store@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz#b6725d5f4af24ace33b36fafd295136e75509f43" + integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA== + "@types/uuid@^9.0.1": version "9.0.8" resolved "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz" @@ -6006,7 +5993,7 @@ hast-util-to-string@^3.0.0: dependencies: "@types/hast" "^3.0.0" -hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: +hoist-non-react-statics@^3.3.1: version "3.3.2" resolved "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== @@ -9407,16 +9394,13 @@ react-modal@^3.14.3: react-lifecycles-compat "^3.0.0" warning "^4.0.3" -react-redux@^7.2.0: - version "7.2.2" - resolved "https://registry.npmjs.org/react-redux/-/react-redux-7.2.2.tgz" - integrity sha512-8+CQ1EvIVFkYL/vu6Olo7JFLWop1qRUeb46sGtIMDCSpgwPQq8fPLpirIB0iTqFe9XYEFPHssdX8/UwN6pAkEA== +react-redux@^9.1.2: + version "9.1.2" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-9.1.2.tgz#deba38c64c3403e9abd0c3fbeab69ffd9d8a7e4b" + integrity sha512-0OA4dhM1W48l3uzmv6B7TXPCGmokUU4p1M44DGN2/D9a1FjVPukVjER1PcPX97jIg6aUeLq1XJo1IpfbgULn0w== dependencies: - "@babel/runtime" "^7.12.1" - hoist-non-react-statics "^3.3.2" - loose-envify "^1.4.0" - prop-types "^15.7.2" - react-is "^16.13.1" + "@types/use-sync-external-store" "^0.0.3" + use-sync-external-store "^1.0.0" react-refresh@^0.14.2: version "0.14.2" @@ -9579,13 +9563,10 @@ reduce-flatten@^2.0.0: resolved "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz" integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== -redux@^4.0.0, redux@^4.0.5: - version "4.0.5" - resolved "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz" - integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w== - dependencies: - loose-envify "^1.4.0" - symbol-observable "^1.2.0" +redux@5.0.1, redux@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/redux/-/redux-5.0.1.tgz#97fa26881ce5746500125585d5642c77b6e9447b" + integrity sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w== reflect.getprototypeof@^1.0.4: version "1.0.6" @@ -10514,11 +10495,6 @@ svgson@^4.1.0: omit-deep "0.3.0" xml-reader "2.4.3" -symbol-observable@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" @@ -11079,6 +11055,11 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" +use-sync-external-store@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz#c3b6390f3a30eba13200d2302dcdf1e7b57b2ef9" + integrity sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw== + user-home@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz"