mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
eb8e777741
The last React-18 leftover in the dependency tree. v4 declared
use-sync-external-store as a hard dependency and its main entry imported the
shim; v5 declares no dependencies at all and calls React.useSyncExternalStore
directly. Only zustand/traditional still reaches for the shim, and nothing here
imports it, so it no longer reaches the bundle.
The upgrade itself needed one line. What it needed more of was checking, because
the one thing v5 changes about behaviour does not show up as a test failure.
v4 subscribed through useSyncExternalStoreWithSelector, which memoised the
selector's result. v5 hands React a plain getSnapshot of
`() => selector(api.getState())` and compares with Object.is. A selector that
builds a fresh object or array therefore returns a new reference on every call,
and React reads that as "the store changed" — an infinite render loop, or at
best a re-render on every parent render.
All 294 store selectors return a property or a primitive. None builds an object
literal, array literal, filter/map/slice result, `?? []` default, Object.keys or
a new Set/Map, so none of them needed useShallow. The suite confirms it: 533
files, 11,165 tests, and zero "getSnapshot should be cached" or "Maximum update
depth" warnings anywhere in the output.
The one source change is the seedStore test helper, which was typed against a
hand-written `{ setState: (partial, replace?: boolean) => void }` shape. As of
v5 setState is an overload pair — partial with replace?: false, full state with
replace: true — and no single signature is assignable to that. Typing it against
zustand's own StoreApi fixes all 129 resulting errors and is what the helper
meant in the first place.
99 lines
3.2 KiB
JSON
99 lines
3.2 KiB
JSON
{
|
|
"name": "@trek/client",
|
|
"version": "3.4.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"prebuild": "node scripts/generate-icons.mjs",
|
|
"build": "vite build",
|
|
"build:analyze": "vite build --mode analyze",
|
|
"preview": "vite preview",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:unit": "vitest run tests/unit",
|
|
"test:integration": "vitest run tests/integration src/**/*.test.{ts,tsx}",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage",
|
|
"lint": "eslint .",
|
|
"lint:check": "eslint .",
|
|
"lint:pages": "node scripts/check-page-pattern.mjs",
|
|
"check:gl-split": "node scripts/check-gl-split.mjs",
|
|
"theme:lint": "node scripts/theme-lint.mjs",
|
|
"theme:lint:strict": "node scripts/theme-lint.mjs --strict",
|
|
"e2e": "playwright test",
|
|
"shots": "playwright test --project=screenshots",
|
|
"shots:promote": "node e2e/screenshots/promote.mjs",
|
|
"e2e:report": "playwright show-report",
|
|
"format": "prettier --write \"src/**/*.tsx\" \"src/**/*.css\"",
|
|
"format:check": "prettier --check \"src/**/*.tsx\" \"src/**/*.css\""
|
|
},
|
|
"dependencies": {
|
|
"@fontsource/geist-sans": "^5.2.5",
|
|
"@fontsource/museomoderno": "^5.3.0",
|
|
"@fontsource/poppins": "^5.2.7",
|
|
"@simplewebauthn/browser": "^13.1.2",
|
|
"@trek/shared": "*",
|
|
"axios": "^1.6.7",
|
|
"dexie": "^4.4.2",
|
|
"drag-drop-touch": "^1.3.1",
|
|
"heic-to": "^1.4.2",
|
|
"iso-3166-2": "^1.0.0",
|
|
"leaflet": "^1.9.4",
|
|
"lucide-react": "^0.344.0",
|
|
"mapbox-gl": "^3.22.0",
|
|
"maplibre-gl": "^5.24.0",
|
|
"marked": "^18.0.0",
|
|
"plyr": "^3.8.4",
|
|
"react": "^19.2.6",
|
|
"react-dom": "^19.2.6",
|
|
"react-dropzone": "^14.4.1",
|
|
"react-leaflet": "^5.0.0",
|
|
"react-leaflet-cluster": "^4.1.3",
|
|
"react-markdown": "^10.1.0",
|
|
"react-router": "^7.18.2",
|
|
"rehype-sanitize": "^6.0.0",
|
|
"remark-breaks": "^4.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"topojson-client": "^3.1.0",
|
|
"tz-lookup": "^6.1.25",
|
|
"zod": "^4.3.6",
|
|
"zustand": "^5.0.14"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@playwright/test": "^1.60.0",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
"@types/leaflet": "^1.9.8",
|
|
"@types/node": "^25.9.3",
|
|
"@types/react": "^19.2.15",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@vitejs/plugin-react": "^6.0.2",
|
|
"@vitest/coverage-v8": "^4.1.9",
|
|
"autoprefixer": "^10.4.18",
|
|
"eslint": "^10.2.1",
|
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
"fake-indexeddb": "^6.2.5",
|
|
"jsdom": "^29.0.1",
|
|
"msw": "^2.13.0",
|
|
"postcss": "^8.4.35",
|
|
"prettier": "^3.8.3",
|
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
"sharp": "^0.35.0",
|
|
"tailwindcss": "^3.4.1",
|
|
"typescript": "^6.0.2",
|
|
"typescript-eslint": "^8.58.2",
|
|
"vite": "8.1.0",
|
|
"vite-plugin-pwa": "^1.3.0",
|
|
"vitest": "^4.1.9"
|
|
}
|
|
}
|