diff --git a/package.json b/package.json index f6f313a..d3aced8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "react-dom": "18.2.0", "react-hotkeys-hook": "4.5.0", "react-icons": "5.3.0", - "react-router-dom": "6.26.1", + "react-router": "7.0.1", "recharts": "2.12.7", "use-immer": "0.10.0", "use-undo": "1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1300d45..02b3cff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,9 +47,9 @@ importers: react-icons: specifier: 5.3.0 version: 5.3.0(react@18.2.0) - react-router-dom: - specifier: 6.26.1 - version: 6.26.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-router: + specifier: 7.0.1 + version: 7.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) recharts: specifier: 2.12.7 version: 2.12.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -966,10 +966,6 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 - '@remix-run/router@1.19.1': - resolution: {integrity: sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==} - engines: {node: '>=14.0.0'} - '@restart/hooks@0.4.11': resolution: {integrity: sha512-Ft/ncTULZN6ldGHiF/k5qt72O8JyRMOeg0tApvCni8LkoiEahO+z3TNxfXIVGy890YtWVDvJAl662dVJSJXvMw==} peerDependencies: @@ -1220,6 +1216,9 @@ packages: '@types/big.js@6.2.2': resolution: {integrity: sha512-e2cOW9YlVzFY2iScnGBBkplKsrn2CsObHQ2Hiw4V1sSyiGbgWL8IyqE3zFi1Pt5o1pdAtYkDAIsF3KKUPjdzaA==} + '@types/cookie@0.6.0': + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + '@types/d3-array@3.0.8': resolution: {integrity: sha512-2xAVyAUgaXHX9fubjcCbGAUOqYfRJN1em1EKR2HfzWBpObZhwfnZKvofTN4TplMqJdFQao61I+NVSai/vnBvDQ==} @@ -1548,6 +1547,10 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie@1.0.2: + resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} + engines: {node: '>=18'} + core-js-compat@3.39.0: resolution: {integrity: sha512-VgEUx3VwlExr5no0tXlBt+silBvhTryPwCXRI2Id1PN8WTKu7MreethvddqOubrYxkFdv/RnYrqlv1sFNAUelw==} @@ -2522,18 +2525,15 @@ packages: react: ^16.8.0 || ^17 || ^18 react-dom: ^16.8.0 || ^17 || ^18 - react-router-dom@6.26.1: - resolution: {integrity: sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==} - engines: {node: '>=14.0.0'} - peerDependencies: - react: '>=16.8' - react-dom: '>=16.8' - - react-router@6.26.1: - resolution: {integrity: sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==} - engines: {node: '>=14.0.0'} + react-router@7.0.1: + resolution: {integrity: sha512-WVAhv9oWCNsja5AkK6KLpXJDSJCQizOIyOd4vvB/+eHGbYx5vkhcmcmwWjQ9yqkRClogi+xjEg9fNEOd5EX/tw==} + engines: {node: '>=20.0.0'} peerDependencies: - react: '>=16.8' + react: '>=18' + react-dom: '>=18' + peerDependenciesMeta: + react-dom: + optional: true react-smooth@4.0.0: resolution: {integrity: sha512-2NMXOBY1uVUQx1jBeENGA497HK20y6CPGYL1ZnJLeoQ8rrc3UfmOM82sRxtzpcoCkUMy4CS0RGylfuVhuFjBgg==} @@ -2666,6 +2666,9 @@ packages: serialize-javascript@4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} + set-cookie-parser@2.7.1: + resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -2868,6 +2871,9 @@ packages: tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + turbo-stream@2.4.0: + resolution: {integrity: sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==} + type-fest@0.16.0: resolution: {integrity: sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==} engines: {node: '>=10'} @@ -3119,7 +3125,6 @@ packages: workbox-google-analytics@7.0.0: resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==} - deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@7.0.0: resolution: {integrity: sha512-juWCSrxo/fiMz3RsvDspeSLGmbgC0U9tKqcUPZBCf35s64wlaLXyn2KdHHXVQrb2cqF7I0Hc9siQalainmnXJA==} @@ -4086,8 +4091,6 @@ snapshots: '@swc/helpers': 0.5.3 react: 18.2.0 - '@remix-run/router@1.19.1': {} - '@restart/hooks@0.4.11(react@18.2.0)': dependencies: dequal: 2.0.3 @@ -4320,6 +4323,8 @@ snapshots: '@types/big.js@6.2.2': {} + '@types/cookie@0.6.0': {} + '@types/d3-array@3.0.8': {} '@types/d3-color@3.1.1': {} @@ -4687,6 +4692,8 @@ snapshots: convert-source-map@2.0.0: {} + cookie@1.0.2: {} + core-js-compat@3.39.0: dependencies: browserslist: 4.24.2 @@ -5693,17 +5700,15 @@ snapshots: react-fast-compare: 3.2.2 warning: 4.0.3 - react-router-dom@6.26.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + react-router@7.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - '@remix-run/router': 1.19.1 + '@types/cookie': 0.6.0 + cookie: 1.0.2 react: 18.2.0 + set-cookie-parser: 2.7.1 + turbo-stream: 2.4.0 + optionalDependencies: react-dom: 18.2.0(react@18.2.0) - react-router: 6.26.1(react@18.2.0) - - react-router@6.26.1(react@18.2.0): - dependencies: - '@remix-run/router': 1.19.1 - react: 18.2.0 react-smooth@4.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: @@ -5873,6 +5878,8 @@ snapshots: dependencies: randombytes: 2.1.0 + set-cookie-parser@2.7.1: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -6084,6 +6091,8 @@ snapshots: tslib@2.6.2: {} + turbo-stream@2.4.0: {} + type-fest@0.16.0: {} typed-array-buffer@1.0.2: diff --git a/src/App.tsx b/src/App.tsx index 6d6ef86..d384e18 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import "bootstrap/dist/css/bootstrap.min.css"; -import { Route, BrowserRouter as Router, Routes } from "react-router-dom"; +import { Route, BrowserRouter as Router, Routes } from "react-router"; import "./App.css"; import "./colors.css"; import { BudgetProvider } from "./guitos/context/BudgetContext"; diff --git a/src/guitos/hooks/useDB.ts b/src/guitos/hooks/useDB.ts index 23fd711..08dddaf 100644 --- a/src/guitos/hooks/useDB.ts +++ b/src/guitos/hooks/useDB.ts @@ -3,7 +3,7 @@ import Papa from "papaparse"; import type React from "react"; import { useCallback, useEffect, useRef, useState } from "react"; import type { Option } from "react-bootstrap-typeahead/types/types"; -import { useNavigate, useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router"; import { createBudgetNameList, saveLastOpenedBudget } from "../../utils"; import { useBudget } from "../context/BudgetContext"; import { useConfig } from "../context/ConfigContext"; diff --git a/src/guitos/hooks/useMove.ts b/src/guitos/hooks/useMove.ts index f84d272..e1f1137 100644 --- a/src/guitos/hooks/useMove.ts +++ b/src/guitos/hooks/useMove.ts @@ -1,4 +1,4 @@ -import { useNavigate } from "react-router-dom"; +import { useNavigate } from "react-router"; import { saveLastOpenedBudget } from "../../utils"; import { useBudget } from "../context/BudgetContext"; import type { Budget } from "../domain/budget"; diff --git a/src/guitos/sections/Budget/BudgetPage.test.tsx b/src/guitos/sections/Budget/BudgetPage.test.tsx index 16a1281..213c854 100644 --- a/src/guitos/sections/Budget/BudgetPage.test.tsx +++ b/src/guitos/sections/Budget/BudgetPage.test.tsx @@ -1,7 +1,7 @@ import { cleanup, render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { act } from "react-dom/test-utils"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { describe, expect, it, vi } from "vitest"; import { budgetContextSpy, diff --git a/src/guitos/sections/Budget/BudgetPage.tsx b/src/guitos/sections/Budget/BudgetPage.tsx index ad0b8e4..0e0f6f6 100644 --- a/src/guitos/sections/Budget/BudgetPage.tsx +++ b/src/guitos/sections/Budget/BudgetPage.tsx @@ -2,7 +2,7 @@ import { produce } from "immer"; import { Suspense, lazy, useCallback, useEffect, useState } from "react"; import { Col, Container, Row, ToastContainer } from "react-bootstrap"; import { useHotkeys } from "react-hotkeys-hook"; -import { useParams } from "react-router-dom"; +import { useParams } from "react-router"; import { createBudgetNameList } from "../../../utils"; import { useBudget } from "../../context/BudgetContext"; import { diff --git a/src/guitos/sections/CalculateButton/CalculateButton.test.tsx b/src/guitos/sections/CalculateButton/CalculateButton.test.tsx index cdd2b47..b0a8061 100644 --- a/src/guitos/sections/CalculateButton/CalculateButton.test.tsx +++ b/src/guitos/sections/CalculateButton/CalculateButton.test.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { vi } from "vitest"; import { describe, expect, it } from "vitest"; import { BudgetItemsMother } from "../../domain/budgetItem.mother"; diff --git a/src/guitos/sections/ChartsPage/ChartsPage.test.tsx b/src/guitos/sections/ChartsPage/ChartsPage.test.tsx index 3adb6c6..8adf61b 100644 --- a/src/guitos/sections/ChartsPage/ChartsPage.test.tsx +++ b/src/guitos/sections/ChartsPage/ChartsPage.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; import ChartsPage from "./ChartsPage"; diff --git a/src/guitos/sections/ItemForm/ItemFormGroup.test.tsx b/src/guitos/sections/ItemForm/ItemFormGroup.test.tsx index f8c77f9..0fb2536 100644 --- a/src/guitos/sections/ItemForm/ItemFormGroup.test.tsx +++ b/src/guitos/sections/ItemForm/ItemFormGroup.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createRef } from "react"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { describe, expect, it } from "vitest"; import { setBudgetMock } from "../../../setupTests"; import { BudgetMother } from "../../domain/budget.mother"; diff --git a/src/guitos/sections/LandingPage/LandingPage.test.tsx b/src/guitos/sections/LandingPage/LandingPage.test.tsx index 768485d..c6b6439 100644 --- a/src/guitos/sections/LandingPage/LandingPage.test.tsx +++ b/src/guitos/sections/LandingPage/LandingPage.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { describe, expect, it } from "vitest"; import { setBudgetMock } from "../../../setupTests"; import { BudgetMother } from "../../domain/budget.mother"; diff --git a/src/guitos/sections/NavBar/NavBar.test.tsx b/src/guitos/sections/NavBar/NavBar.test.tsx index 30c6b45..92b0a9c 100644 --- a/src/guitos/sections/NavBar/NavBar.test.tsx +++ b/src/guitos/sections/NavBar/NavBar.test.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { budgetContextSpy, diff --git a/src/guitos/sections/TableCard/TableCard.test.tsx b/src/guitos/sections/TableCard/TableCard.test.tsx index 8c1cbec..4a2d20f 100644 --- a/src/guitos/sections/TableCard/TableCard.test.tsx +++ b/src/guitos/sections/TableCard/TableCard.test.tsx @@ -1,6 +1,6 @@ import { cleanup, render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter } from "react-router"; import { describe, expect, it } from "vitest"; import { setBudgetMock } from "../../../setupTests"; import { BudgetMother } from "../../domain/budget.mother"; diff --git a/src/utils.ts b/src/utils.ts index e4a1c4d..daf26c1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import Big from "big.js"; import type { MutableRefObject } from "react"; -import type { NavigateFunction } from "react-router-dom"; +import type { NavigateFunction } from "react-router"; import type { Budget } from "./guitos/domain/budget"; import type { ItemOperation } from "./guitos/domain/calculationHistoryItem"; import type { UserOptions } from "./guitos/domain/userOptions";