build(deps): bump react-router from 7.18.1 to 8.3.0 in /client

The bump alone doesn't work, it needs three supporting changes:

- react-router 8 exposes its types through an exports map, which the old
  "moduleResolution": "Node" can't read, so tsc failed to find the module in
  every file importing it. Switch to "Bundler", which is what Vite has always
  resolved with anyway.
- @refinedev/react-router peer-depends on react-router ^7.0.2, so npm kept a
  nested 7.18.2 next to the top-level 8.3.0. Two copies means two React
  contexts, and Refine's useLocation() threw "may be used only in the context
  of a <Router> component" inside ThemedSider, leaving a blank page. Override
  the adapter's react-router to ^8.3.0 so the tree dedupes.
- Bundler resolution correctly rejects the deep import of NumberFieldProps
  from @refinedev/antd, which isn't in that package's exports map and isn't
  re-exported from its root. Mirror the type locally instead of taking on
  @refinedev/ui-types as a new dependency.

react-router 8 requires Node >= 22.22.0, so the client's engines range drops
Node 20. CI and the Docker build already use Node 24.

Verified with the frontend Playwright suite (both tests pass, including the
smoke test asserting no console errors on every page).
This commit is contained in:
Donkie committed 2026-08-08 20:24:11 +02:00
1 parent 8680805416
commit be127f2fb7
4 files changed
+33 -33

No files matched your search

+15 -29
View File
@@ -29,7 +29,7 @@
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^19.2.3",
"react-i18next": "^16.5.1",
"react-router": "^7.11.0",
"react-router": "^8.3.0",
"react-to-print": "^3.2.0",
"uuid": "^14.0.0",
"vite-plugin-svgr": "^4.5.0",
@@ -58,7 +58,7 @@
"vite-plugin-pwa": "^1.2.0"
},
"engines": {
"node": "^20.19 || ^22.12 || >=24"
"node": "^22.22 || >=24"
}
},
"node_modules/@ant-design/colors": {
@@ -6193,6 +6193,12 @@
"node": ">= 0.6"
}
},
"node_modules/cookie-es": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz",
"integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==",
"license": "MIT"
},
"node_modules/cookie-signature": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
@@ -12384,20 +12390,19 @@
}
},
"node_modules/react-router": {
"version": "7.18.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.1.tgz",
"integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-8.3.0.tgz",
"integrity": "sha512-qyPMvW83jGIct3yiieisxdk9M745anqhpIMKN5m1t6yBMfgVPpt77aHOqs5fUlEJRMCGffg9BaQLH9oPVOL7xQ==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
"set-cookie-parser": "^2.6.0"
"cookie-es": "^3.1.1"
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.22.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
"react": ">=19.2.7",
"react-dom": ">=19.2.7"
},
"peerDependenciesMeta": {
"react-dom": {
@@ -12405,19 +12410,6 @@
}
}
},
"node_modules/react-router/node_modules/cookie": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/react-to-print": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/react-to-print/-/react-to-print-3.3.0.tgz",
@@ -13140,12 +13132,6 @@
"node": ">= 0.8.0"
}
},
"node_modules/set-cookie-parser": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
"integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
"license": "MIT"
},
"node_modules/set-function-length": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
+5 -2
View File
@@ -2,7 +2,7 @@
"name": "spoolman-ui",
"version": "0.26.1",
"engines": {
"node": "^20.19 || ^22.12 || >=24"
"node": "^22.22 || >=24"
},
"private": true,
"type": "module",
@@ -28,7 +28,7 @@
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^19.2.3",
"react-i18next": "^16.5.1",
"react-router": "^7.11.0",
"react-router": "^8.3.0",
"react-to-print": "^3.2.0",
"uuid": "^14.0.0",
"vite-plugin-svgr": "^4.5.0",
@@ -37,6 +37,9 @@
"overrides": {
"@ant-design/pro-layout": {
"path-to-regexp": "^8.4.0"
},
"@refinedev/react-router": {
"react-router": "^8.3.0"
}
},
"devDependencies": {
+12 -1
View File
@@ -1,8 +1,19 @@
import { NumberFieldProps } from "@refinedev/antd/dist/components/fields/types";
import { Typography } from "antd";
import type { TextProps } from "antd/lib/typography/Text";
import type { ReactNode } from "react";
const { Text } = Typography;
/**
* Mirror of @refinedev/antd's NumberFieldProps. That package only exports the type from a
* deep path which isn't listed in its exports map, so it can't be imported directly.
*/
type NumberFieldProps = TextProps & {
value: ReactNode;
locale?: string | string[];
options?: Intl.NumberFormatOptions;
};
function toLocaleStringSupportsOptions() {
return !!(typeof Intl == "object" && Intl && typeof Intl.NumberFormat == "function");
}
+1 -1
View File
@@ -10,7 +10,7 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,