From 01ae17eda7c5882acd825e974a15612e478e6cc3 Mon Sep 17 00:00:00 2001 From: Benjamin Cutler Date: Fri, 1 Nov 2024 13:01:26 -0600 Subject: [PATCH] update react-router to 6.4 (#730) [#188449418] --- bundles/admin/app.js | 148 ++++--- .../donationProcessing/processPendingBids.tsx | 2 +- .../processPendingBidsSpec.tsx | 10 +- bundles/admin/index.js | 11 +- bundles/admin/interstitials/Editor/index.tsx | 14 +- bundles/admin/scheduleEditor/index.js | 16 +- bundles/admin/scheduleEditor/indexSpec.tsx | 8 +- bundles/processing/App.tsx | 10 +- bundles/processing/pages/ProcessDonations.tsx | 4 +- bundles/processing/pages/ReadDonations.tsx | 4 +- bundles/public/api/index.js | 13 +- bundles/public/api/reducers/index.js | 4 +- bundles/tracker/App.tsx | 44 +- .../donation/__tests__/Donate.spec.tsx | 8 +- .../tracker/donation/components/Donate.tsx | 4 +- .../tracker/events/components/EventRouter.tsx | 41 -- bundles/tracker/index.tsx | 1 - bundles/tracker/prizes/components/Prize.tsx | 13 +- .../tracker/prizes/components/PrizeCard.tsx | 7 +- .../prizes/components/PrizeCardSpec.tsx | 7 +- .../tracker/prizes/components/PrizeSpec.tsx | 7 +- bundles/tracker/router/RouterUtils.ts | 55 +-- package.json | 9 +- tracker/ui/urls.py | 4 +- webpack.config.js | 3 +- yarn.lock | 383 ++---------------- 26 files changed, 264 insertions(+), 566 deletions(-) delete mode 100644 bundles/tracker/events/components/EventRouter.tsx diff --git a/bundles/admin/app.js b/bundles/admin/app.js index 9d7dc97c2..757a4f2c0 100644 --- a/bundles/admin/app.js +++ b/bundles/admin/app.js @@ -1,13 +1,12 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Route, Switch, useRouteMatch } from 'react-router'; -import { Link } from 'react-router-dom'; -import loadable from '@loadable/component'; +import { Outlet, Route, Routes } from 'react-router'; +import { BrowserRouter, Link } from 'react-router-dom'; import { useConstants } from '@common/Constants'; import Loading from '@common/Loading'; import { actions } from '@public/api'; -import { usePermission, usePermissions } from '@public/api/helpers/auth'; +import { usePermissions } from '@public/api/helpers/auth'; import V2HTTPUtils from '@public/apiv2/HTTPUtils'; import Dropdown from '@public/dropdown'; import Spinner from '@public/spinner'; @@ -17,20 +16,15 @@ import { setAPIRoot } from '@tracker/Endpoints'; import NotFound from '../public/notFound'; import ScheduleEditor from './scheduleEditor'; -const Interstitials = loadable(() => import('./interstitials' /* webpackChunkName: 'interstitials' */), { - loading: Loading, -}); +const Interstitials = React.lazy(() => import('./interstitials' /* webpackChunkName: 'interstitials' */)); -const ProcessPendingBids = loadable( - () => import('./donationProcessing/processPendingBids' /* webpackChunkName: 'donationProcessing' */), - { - loading: Loading, - }, +const ProcessPendingBids = React.lazy(() => + import('./donationProcessing/processPendingBids' /* webpackChunkName: 'donationProcessing' */), ); const EventMenuComponents = {}; -function EventMenu(name, path) { +function EventMenu(name) { return ( EventMenuComponents[name] || (EventMenuComponents[name] = function EventMenuInner() { @@ -38,8 +32,6 @@ function EventMenu(name, path) { events: state.models.event, status: state.status, })); - const url = useRouteMatch().url; - path = path || url; const sortedEvents = React.useMemo( () => [...(events || [])].sort((a, b) => b.datetime.localeCompare(a.datetime)), [events], @@ -52,7 +44,7 @@ function EventMenu(name, path) { {sortedEvents && sortedEvents.map(e => (
  • - {e.short} + {e.short} {(!e.allow_donations || e.locked) && '🔒'}
  • ))} @@ -64,8 +56,6 @@ function EventMenu(name, path) { } function DropdownMenu({ name, path }) { - const match = useRouteMatch(); - const events = useSelector(state => state.models.event); const sortedEvents = React.useMemo( () => [...(events || [])].sort((a, b) => b.datetime.localeCompare(a.datetime)), @@ -87,7 +77,7 @@ function DropdownMenu({ name, path }) { {sortedEvents && sortedEvents.map(e => (
  • - {e.short} + {e.short} {(!e.allow_donations || e.locked) && '🔒'}
  • ))} @@ -97,8 +87,36 @@ function DropdownMenu({ name, path }) { ); } -function App() { - const match = useRouteMatch(); +function Menu() { + const { ADMIN_ROOT } = useConstants(); + const canSeeHiddenBids = usePermissions(['tracker.change_bid', 'tracker.view_hidden_bid']); + const { status } = useSelector(state => ({ + status: state.status, + })); + return ( +
    + + {ADMIN_ROOT && ( + <> + Admin Home + — + + )} + + — + + {canSeeHiddenBids && ( + <> + — + + + )} + +
    + ); +} + +function App({ rootPath }) { const dispatch = useDispatch(); const [ready, setReady] = React.useState(false); @@ -107,11 +125,10 @@ function App() { status: state.status, })); - const { API_ROOT, APIV2_ROOT, ADMIN_ROOT } = useConstants(); - const canChangeDonations = usePermission('tracker.change_donation'); + const { API_ROOT, APIV2_ROOT } = useConstants(); const canSeeHiddenBids = usePermissions(['tracker.change_bid', 'tracker.view_hidden_bid']); - React.useEffect(() => { + React.useLayoutEffect(() => { setAPIRoot(API_ROOT); V2HTTPUtils.setAPIRoot(APIV2_ROOT); setReady(true); @@ -130,51 +147,54 @@ function App() { }, [dispatch, status.event, ready]); return ( - - -
    -
    - - {ADMIN_ROOT && ( + + + + + - Admin Home - — + + + }> + } /> + + }> + + + } + /> + }> + + + } + /> + {canSeeHiddenBids && ( + )} - - — - {canSeeHiddenBids && ( - <> - — - - + }> + + + } + /> )} - -
    - -
    - - - - - {canSeeHiddenBids && ( - - )} - {canSeeHiddenBids && ( - - )} - - -
    -
    -
    -
    -
    + } /> + + + + + ); } diff --git a/bundles/admin/donationProcessing/processPendingBids.tsx b/bundles/admin/donationProcessing/processPendingBids.tsx index 3ef7adec8..f87d5b6c9 100644 --- a/bundles/admin/donationProcessing/processPendingBids.tsx +++ b/bundles/admin/donationProcessing/processPendingBids.tsx @@ -30,7 +30,7 @@ const stateMap = { export default React.memo(function ProcessPendingBids() { const { ADMIN_ROOT } = useConstants(); - const eventId = +useParams<{ event: string }>().event; + const eventId = +useParams<{ eventId: string }>().eventId!; const status = useSelector((state: any) => state.status); const bids = useSelector((state: any) => state.models.bid) as Bid[]; const event = useSelector((state: any) => state.models.event?.find((e: any) => e.pk === eventId)); diff --git a/bundles/admin/donationProcessing/processPendingBidsSpec.tsx b/bundles/admin/donationProcessing/processPendingBidsSpec.tsx index 225a94c44..778b920fa 100644 --- a/bundles/admin/donationProcessing/processPendingBidsSpec.tsx +++ b/bundles/admin/donationProcessing/processPendingBidsSpec.tsx @@ -1,7 +1,9 @@ import React from 'react'; import MockAdapter from 'axios-mock-adapter'; import { Provider } from 'react-redux'; -import { Route, StaticRouter } from 'react-router'; +import { Route } from 'react-router'; +import { Routes } from 'react-router-dom'; +import { StaticRouter } from 'react-router-dom/server'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { render, waitFor } from '@testing-library/react'; @@ -89,8 +91,10 @@ describe('ProcessPendingBids', () => { }); return render( - - + + + } /> + , ); diff --git a/bundles/admin/index.js b/bundles/admin/index.js index 82b8d4879..6b3aeff98 100644 --- a/bundles/admin/index.js +++ b/bundles/admin/index.js @@ -1,11 +1,9 @@ import React from 'react'; -import { ConnectedRouter } from 'connected-react-router'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import { createRoot } from 'react-dom/client'; import { QueryClient, QueryClientProvider } from 'react-query'; import { Provider } from 'react-redux'; -import { Redirect, Route, Switch } from 'react-router'; import Constants from '@common/Constants'; import { createTrackerStore } from '@public/api'; @@ -17,8 +15,6 @@ import App from './app'; import '@common/init'; function Routes(props) { - const redirect = React.useCallback(({ location }) => , []); - const store = createTrackerStore(); const queryClient = new QueryClient({ defaultOptions: { @@ -34,12 +30,7 @@ function Routes(props) { - - - - - - + diff --git a/bundles/admin/interstitials/Editor/index.tsx b/bundles/admin/interstitials/Editor/index.tsx index f46a1e7b1..758a57017 100644 --- a/bundles/admin/interstitials/Editor/index.tsx +++ b/bundles/admin/interstitials/Editor/index.tsx @@ -20,20 +20,20 @@ type Aggregate = [Interview[], Ad[] | ServerError, Run[], Person | ServerError]; export default function InterstitialEditor() { const { API_ROOT, CSRF_TOKEN } = useConstants(); - const { event } = useParams<{ event: string }>(); + const { eventId } = useParams<{ eventId: string }>(); const [promise, setPromise] = useState>(new Promise(() => {})); const [saveError, setSaveError] = useState(null); const fetchAll = useCallback(() => { setPromise( Promise.all([ - fetch(`${API_ROOT}interviews/${event}`).then(JSONResponseWithForbidden), - fetch(`${API_ROOT}ads/${event}`).then(JSONResponseWithForbidden), - fetch(`${API_ROOT}search?type=run&event=${event}`).then(JSONResponse), + fetch(`${API_ROOT}interviews/${eventId}`).then(JSONResponseWithForbidden), + fetch(`${API_ROOT}ads/${eventId}`).then(JSONResponseWithForbidden), + fetch(`${API_ROOT}search?type=run&event=${eventId}`).then(JSONResponse), fetch(`${API_ROOT}me`).then(JSONResponseWithForbidden), ]), ); setSaveError(null); - }, [API_ROOT, event]); + }, [API_ROOT, eventId]); useEffect(fetchAll, [fetchAll]); const moveInterstitial = useCallback( @@ -97,7 +97,7 @@ export default function InterstitialEditor() { ); const [result, error, state] = usePromise(promise, [promise]); - if (state === 'pending') return 'Loading...'; + if (state === 'pending') return <>Loading...; if (error) { return (
    @@ -109,7 +109,7 @@ export default function InterstitialEditor() { ); } if (!result) { - return 'shrug'; + return <>shrug; } const interviews = result[0] as Interview[] | ServerError; const ads = result[1] as Ad[] | ServerError; diff --git a/bundles/admin/scheduleEditor/index.js b/bundles/admin/scheduleEditor/index.js index ad3b3a07c..5afaa6c15 100644 --- a/bundles/admin/scheduleEditor/index.js +++ b/bundles/admin/scheduleEditor/index.js @@ -1,5 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; +import { useParams } from 'react-router'; import { actions } from '@public/api'; import authHelper from '@public/api/helpers/auth'; @@ -40,13 +41,13 @@ class ScheduleEditor extends React.Component { } componentDidUpdate(newProps) { - if (this.props.match.params.event !== newProps.match.params.event) { - this.refreshSpeedruns_(newProps.match.params.event); + if (this.props.eventId !== newProps.eventId) { + this.refreshSpeedruns_(newProps.eventId); } } componentDidMount() { - this.refreshSpeedruns_(this.props.match.params.event); + this.refreshSpeedruns_(this.props.eventId); } refreshSpeedruns_(event) { @@ -87,7 +88,7 @@ class ScheduleEditor extends React.Component { function select(state, props) { const { models, drafts, status, singletons } = state; const { speedrun: speedruns, event: events = [] } = models; - const event = events.find(e => e.pk === parseInt(props.match?.params?.event)) || null; + const event = events.find(e => e.pk === parseInt(props.eventId)) || null; const { me } = singletons; return { event, @@ -149,4 +150,9 @@ function dispatch(dispatch) { }; } -export default connect(select, dispatch)(ScheduleEditor); +const Connected = connect(select, dispatch)(ScheduleEditor); + +export default function Wrapped() { + const { eventId } = useParams(); + return ; +} diff --git a/bundles/admin/scheduleEditor/indexSpec.tsx b/bundles/admin/scheduleEditor/indexSpec.tsx index b4c52e186..5ff341790 100644 --- a/bundles/admin/scheduleEditor/indexSpec.tsx +++ b/bundles/admin/scheduleEditor/indexSpec.tsx @@ -1,6 +1,8 @@ import * as React from 'react'; import fetchMock from 'fetch-mock'; import { Provider } from 'react-redux'; +import { Route, Routes } from 'react-router'; +import { StaticRouter } from 'react-router-dom/server'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { render, screen } from '@testing-library/react'; @@ -31,7 +33,11 @@ describe('ScheduleEditor', () => { }); return render( - + + + } /> + + , ); } diff --git a/bundles/processing/App.tsx b/bundles/processing/App.tsx index e85ba76a5..dae346772 100644 --- a/bundles/processing/App.tsx +++ b/bundles/processing/App.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Route, Switch } from 'react-router'; +import { Route, Routes } from 'react-router'; import { useConstants } from '@common/Constants'; import { usePermission } from '@public/api/helpers/auth'; @@ -49,14 +49,14 @@ export default function App() { return ( - + {canChangeDonations && ( <> - - + } /> + } /> )} - + ); } diff --git a/bundles/processing/pages/ProcessDonations.tsx b/bundles/processing/pages/ProcessDonations.tsx index 8136056e7..5df173d91 100644 --- a/bundles/processing/pages/ProcessDonations.tsx +++ b/bundles/processing/pages/ProcessDonations.tsx @@ -96,8 +96,8 @@ export default function ProcessDonations() { const { partition, partitionCount, processingMode } = useProcessingStore(); const process = PROCESSES[processingMode]; - const { data: event } = useQuery(`events.${eventId}`, () => APIClient.getEvent(eventId)); - const donationsQuery = useQuery(`donations.unprocessed.${processingMode}`, () => process.fetch(eventId), { + const { data: event } = useQuery(`events.${eventId}`, () => APIClient.getEvent(eventId!)); + const donationsQuery = useQuery(`donations.unprocessed.${processingMode}`, () => process.fetch(eventId!), { onSuccess: donations => loadDonations(donations), }); diff --git a/bundles/processing/pages/ReadDonations.tsx b/bundles/processing/pages/ReadDonations.tsx index 93bd3d2aa..35ebf11d4 100644 --- a/bundles/processing/pages/ReadDonations.tsx +++ b/bundles/processing/pages/ReadDonations.tsx @@ -145,8 +145,8 @@ export default function ReadDonations() { const params = useParams<{ eventId: string }>(); const { eventId } = params; - const { data: event } = useQuery(`events.${eventId}`, () => APIClient.getEvent(eventId)); - const donationsQuery = useQuery(`donations.unread`, () => APIClient.getUnreadDonations(eventId), { + const { data: event } = useQuery(`events.${eventId}`, () => APIClient.getEvent(eventId!)); + const donationsQuery = useQuery(`donations.unread`, () => APIClient.getUnreadDonations(eventId!), { onSuccess: loadDonations, }); diff --git a/bundles/public/api/index.js b/bundles/public/api/index.js index 9cc818572..d6fa9d032 100644 --- a/bundles/public/api/index.js +++ b/bundles/public/api/index.js @@ -1,5 +1,3 @@ -import { routerMiddleware } from 'connected-react-router'; -import { createBrowserHistory } from 'history'; import { applyMiddleware, createStore } from 'redux'; import thunk from 'redux-thunk'; import { composeWithDevTools } from '@redux-devtools/extension'; @@ -22,13 +20,6 @@ const composeEnhancers = composeWithDevTools({ export { actions }; -export function createTrackerStore({ history } = {}) { - history = history || createBrowserHistory(); - - const store = createStore( - createRootReducer(history), - composeEnhancers(applyMiddleware(freezeReducer, thunk, routerMiddleware(history))), - ); - store.history = history; - return store; +export function createTrackerStore() { + return createStore(createRootReducer(history), composeEnhancers(applyMiddleware(freezeReducer, thunk))); } diff --git a/bundles/public/api/reducers/index.js b/bundles/public/api/reducers/index.js index dd971d17e..80df6a3d2 100644 --- a/bundles/public/api/reducers/index.js +++ b/bundles/public/api/reducers/index.js @@ -1,4 +1,3 @@ -import { connectRouter } from 'connected-react-router'; import { combineReducers } from 'redux'; import drafts from './drafts'; @@ -7,9 +6,8 @@ import models from './models'; import singletons from './singletons'; import status from './status'; -const createRootReducer = history => +const createRootReducer = () => combineReducers({ - router: connectRouter(history), drafts, models, status, diff --git a/bundles/tracker/App.tsx b/bundles/tracker/App.tsx index 37db12811..0f8c6e1df 100644 --- a/bundles/tracker/App.tsx +++ b/bundles/tracker/App.tsx @@ -1,17 +1,34 @@ import * as React from 'react'; -import { Route, Router, Switch } from 'react-router-dom'; +import { useParams } from 'react-router'; +import { BrowserRouter, Route, Routes } from 'react-router-dom'; import { useConstants } from '@common/Constants'; +import Donate from '@tracker/donation/components/Donate'; +import Prize from '@tracker/prizes/components/Prize'; +import Prizes from '@tracker/prizes/components/Prizes'; + import { AnalyticsEvent, setAnalyticsURL, track } from './analytics/Analytics'; import DonateInitializer from './donation/components/DonateInitializer'; -import EventRouter from './events/components/EventRouter'; import NotFound from './router/components/NotFound'; -import { createTrackerHistory, Routes } from './router/RouterUtils'; import { setAPIRoot } from './Endpoints'; +function PrizesRoute() { + const { eventId } = useParams(); + return ; +} + +function PrizeRoute() { + const { prizeId } = useParams(); + return ; +} + +function DonateRoute() { + const { eventId } = useParams(); + return ; +} + const App = (props: React.ComponentProps) => { - const history = React.useMemo(() => createTrackerHistory(props.ROOT_PATH), [props.ROOT_PATH]); const { ANALYTICS_URL, API_ROOT } = useConstants(); const [ready, setReady] = React.useState(false); @@ -27,16 +44,21 @@ const App = (props: React.ComponentProps) => { }); }, []); + const { SWEEPSTAKES_URL } = useConstants(); + return ( <> {ready && ( - - - {/* TODO: Remove `EVENT_DONATE` from here once it gets normalized */} - - - - + + + + {SWEEPSTAKES_URL && } />} + {SWEEPSTAKES_URL && } />} + } /> + + } /> + + )} ); diff --git a/bundles/tracker/donation/__tests__/Donate.spec.tsx b/bundles/tracker/donation/__tests__/Donate.spec.tsx index 7e1540f1f..472181073 100644 --- a/bundles/tracker/donation/__tests__/Donate.spec.tsx +++ b/bundles/tracker/donation/__tests__/Donate.spec.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { MemoryRouter } from 'react-router-dom'; import userEvent from '@testing-library/user-event'; import * as EventDetailsActions from '@tracker/event_details/EventDetailsActions'; @@ -7,7 +8,12 @@ import { createStore, fireEvent, render } from '@tracker/testing/test-utils'; import Donate from '../components/Donate'; const renderDonate = (store?: ReturnType) => { - const rendered = render(, { store }); + const rendered = render( + + + , + { store }, + ); const getAddIncentivesButton = () => rendered.getByTestId('addincentives-button') as HTMLButtonElement; const getSubmitButton = () => rendered.getByTestId('donation-submit') as HTMLButtonElement; const getSubmitBidButton = () => rendered.getByTestId('incentiveBidForm-submitBid') as HTMLButtonElement; diff --git a/bundles/tracker/donation/components/Donate.tsx b/bundles/tracker/donation/components/Donate.tsx index b0fdebad7..9003aa004 100644 --- a/bundles/tracker/donation/components/Donate.tsx +++ b/bundles/tracker/donation/components/Donate.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { useSelector } from 'react-redux'; +import { useLocation } from 'react-router'; import { useConstants } from '@common/Constants'; import { useCachedCallback } from '@public/hooks/useCachedCallback'; @@ -16,7 +17,6 @@ import TextInput from '@uikit/TextInput'; import * as EventDetailsStore from '@tracker/event_details/EventDetailsStore'; import useDispatch from '@tracker/hooks/useDispatch'; -import RouterUtils from '@tracker/router/RouterUtils'; import { StoreState } from '@tracker/Store'; import { AnalyticsEvent, track } from '../../analytics/Analytics'; @@ -37,7 +37,7 @@ const Donate = (props: DonateProps) => { const dispatch = useDispatch(); const { eventId } = props; - const urlHash = RouterUtils.getLocationHash(); + const urlHash = useLocation().hash; React.useEffect(() => { const presetAmount = CurrencyUtils.parseCurrency(urlHash); if (presetAmount != null) { diff --git a/bundles/tracker/events/components/EventRouter.tsx b/bundles/tracker/events/components/EventRouter.tsx deleted file mode 100644 index 58cf18682..000000000 --- a/bundles/tracker/events/components/EventRouter.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import * as React from 'react'; -import { Route, Switch, useRouteMatch } from 'react-router-dom'; - -import { useConstants } from '@common/Constants'; - -import Donate from '@tracker/donation/components/Donate'; -import Prize from '@tracker/prizes/components/Prize'; -import Prizes from '@tracker/prizes/components/Prizes'; -import NotFound from '@tracker/router/components/NotFound'; -import { Routes } from '@tracker/router/RouterUtils'; - -function PrizePage() { - const routeMatch = useRouteMatch<{ prizeId: string }>(); - const { prizeId } = routeMatch.params; - - return ; -} - -const EventRouter = () => { - const routeMatch = useRouteMatch<{ eventId: string }>(); - // TODO: type this better when DonateInitializer doesn't need page-load props - const eventId = routeMatch.params.eventId; - const { SWEEPSTAKES_URL } = useConstants(); - - return ( - - {SWEEPSTAKES_URL && ( - - - - )} - {SWEEPSTAKES_URL && } - - - - - - ); -}; - -export default EventRouter; diff --git a/bundles/tracker/index.tsx b/bundles/tracker/index.tsx index 53e878605..03cdbc901 100644 --- a/bundles/tracker/index.tsx +++ b/bundles/tracker/index.tsx @@ -7,7 +7,6 @@ import ErrorBoundary from '@public/errorBoundary'; import ThemeProvider from '@uikit/ThemeProvider'; import DonateInitializer from './donation/components/DonateInitializer'; -import RouterUtils from './router/RouterUtils'; import AppWrapper from './App'; import { createTrackerStore } from './Store'; diff --git a/bundles/tracker/prizes/components/Prize.tsx b/bundles/tracker/prizes/components/Prize.tsx index cddeaabbc..bc7799542 100644 --- a/bundles/tracker/prizes/components/Prize.tsx +++ b/bundles/tracker/prizes/components/Prize.tsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; +import { useNavigate } from 'react-router'; import { useConstants } from '@common/Constants'; import * as CurrencyUtils from '@public/util/currency'; @@ -15,7 +16,7 @@ import Text from '@uikit/Text'; import * as EventActions from '@tracker/events/EventActions'; import * as EventStore from '@tracker/events/EventStore'; import useDispatch from '@tracker/hooks/useDispatch'; -import RouterUtils, { Routes } from '@tracker/router/RouterUtils'; +import RouterUtils, { Routes as TrackerRoutes } from '@tracker/router/RouterUtils'; import { StoreState } from '@tracker/Store'; import * as PrizeActions from '../PrizeActions'; @@ -111,19 +112,21 @@ const Prize = (props: PrizeProps) => { } }, [dispatch, event, eventId]); + const navigate = useNavigate(); + const handleDonate = useCallback(() => { if (prize == null) return; - RouterUtils.navigateTo(Routes.EVENT_DONATE(prize.eventId), { + RouterUtils.navigateTo(navigate, TrackerRoutes.EVENT_DONATE(prize.eventId), { hash: prize.minimumBid != null ? prize.minimumBid.toFixed(2) : '', forceReload: true, }); - }, [prize]); + }, [navigate, prize]); const handleBack = useCallback(() => { if (prize) { - RouterUtils.navigateTo(Routes.EVENT_PRIZES(prize.eventId)); + RouterUtils.navigateTo(navigate, TrackerRoutes.EVENT_PRIZES(prize.eventId)); } - }, [prize]); + }, [navigate, prize]); if (prize == null) return ( diff --git a/bundles/tracker/prizes/components/PrizeCard.tsx b/bundles/tracker/prizes/components/PrizeCard.tsx index d92af1868..05ba0a800 100644 --- a/bundles/tracker/prizes/components/PrizeCard.tsx +++ b/bundles/tracker/prizes/components/PrizeCard.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useState } from 'react'; import classNames from 'classnames'; import { useSelector } from 'react-redux'; +import { useNavigate } from 'react-router'; import * as CurrencyUtils from '@public/util/currency'; import TimeUtils from '@public/util/TimeUtils'; @@ -33,11 +34,13 @@ const PrizeCard = (props: PrizeCardProps) => { const prize = useSelector((state: StoreState) => PrizeStore.getPrize(state, { prizeId })); + const navigate = useNavigate(); + const handleViewPrize = useCallback(() => { if (prize) { - RouterUtils.navigateTo(Routes.EVENT_PRIZE(prize.eventId, prize.id)); + RouterUtils.navigateTo(navigate, Routes.EVENT_PRIZE(prize.eventId, prize.id)); } - }, [prize]); + }, [navigate, prize]); if (prize == null) { return
    ; diff --git a/bundles/tracker/prizes/components/PrizeCardSpec.tsx b/bundles/tracker/prizes/components/PrizeCardSpec.tsx index cd20ea3aa..2d4030c1e 100644 --- a/bundles/tracker/prizes/components/PrizeCardSpec.tsx +++ b/bundles/tracker/prizes/components/PrizeCardSpec.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { MemoryRouter } from 'react-router-dom'; import { fireEvent } from '@testing-library/react'; import { getFixturePrize } from '../../../../spec/fixtures/Prize'; @@ -25,6 +26,10 @@ describe('PrizeCard', () => { prizeId: '123', }; - return renderWithState(); + return renderWithState( + + + , + ); } }); diff --git a/bundles/tracker/prizes/components/PrizeSpec.tsx b/bundles/tracker/prizes/components/PrizeSpec.tsx index 7fb748674..edcf5266b 100644 --- a/bundles/tracker/prizes/components/PrizeSpec.tsx +++ b/bundles/tracker/prizes/components/PrizeSpec.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { MemoryRouter } from 'react-router-dom'; import { fireEvent } from '@testing-library/react'; import { getFixturePrize } from '../../../../spec/fixtures/Prize'; @@ -25,6 +26,10 @@ describe('Prize', () => { prizeId: '123', }; - return renderWithState(); + return renderWithState( + + + , + ); } }); diff --git a/bundles/tracker/router/RouterUtils.ts b/bundles/tracker/router/RouterUtils.ts index e499d896f..cc40fec9c 100644 --- a/bundles/tracker/router/RouterUtils.ts +++ b/bundles/tracker/router/RouterUtils.ts @@ -1,5 +1,6 @@ -import { createBrowserHistory } from 'history'; +// import { createBrowserHistory } from 'history'; import queryString from 'query-string'; +import { NavigateOptions as NavOptions, useNavigate } from 'react-router'; export const Routes = { EVENT_BASE: (eventId: string | number) => `/events/${eventId}`, @@ -19,52 +20,38 @@ type NavigateOptions = { state?: Record; }; -let history: ReturnType | null = null; - export function createTrackerHistory(rootPath: string) { - history = createBrowserHistory({ basename: rootPath }); - - // Re-apply browser-standard scrolling behavior on route transitions - history.listen((location, action) => { - // If the user is navigating backwards, don't reset scroll. - if (action === 'POP') return; - window.scrollTo(0, 0); - }); - return history; + // history = createBrowserHistory({ basename: rootPath }); + // + // // Re-apply browser-standard scrolling behavior on route transitions + // history.listen((location, action) => { + // // If the user is navigating backwards, don't reset scroll. + // if (action === 'POP') return; + // window.scrollTo(0, 0); + // }); + // return history; } export default { - get history() { - return history; - }, - - getLocation: () => history?.location, - getLocationHash: () => history?.location.hash.slice(1), - - navigateTo(pathname: string, options: NavigateOptions = {}) { - if (!history) { - return; - } - const { replace = false, forceReload = false, query, hash, state } = options; - - const navigate = replace ? history.replace : history.push; - - let fullPath = pathname; + navigateTo( + navigate: ReturnType, + path: string, + options: NavigateOptions = {}, + navOptions: NavOptions = {}, + ) { + const { forceReload = false, query, hash, state } = options; + + let fullPath = path; if (query != null) { fullPath += `?${queryString.stringify(query)}`; } if (hash != null) { fullPath += `#${hash}`; } - - navigate(fullPath, state); + navigate(fullPath, { ...navOptions, state }); if (forceReload) { window.location.reload(); } }, - - isLocalUrl(url: string) { - return !/(?:^[a-z][a-z0-9+.-]*:|\/\/)/.test(url); - }, }; diff --git a/package.json b/package.json index e0a13d1e7..ccdf9de27 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "@fortawesome/free-regular-svg-icons": "^5.11.2", "@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/react-fontawesome": "^0.1.7", - "@loadable/component": "^5.15.3", "@react-dnd/invariant": "^4.0.2", "@redux-devtools/extension": "^3.2.5", "@spyrothon/sparx": "^0.10.2", @@ -32,10 +31,8 @@ "@spyrothon/tokens": "^0.10.2", "axios": "^1.7.4", "classnames": "^2.3.2", - "connected-react-router": "^6.9.3", "css-loader": "^6.7.3", "cssnano": "^6.0.1", - "history": "^4.10.1", "html-webpack-plugin": "^5.5.0", "invariant": "^2.2.4", "keymirror": "^0.1.1", @@ -62,8 +59,8 @@ "react-numeric": "^1.0.0", "react-query": "^3.39.3", "react-redux": "^8.0.5", - "react-router": "^5.1.2", - "react-router-dom": "^5.1.2", + "react-router": "^6.27.0", + "react-router-dom": "^6.27.0", "react-transition-group": "^4.4.5", "react-use-promise": "^0.5.0", "redux": "^4.2.1", @@ -98,8 +95,6 @@ "@types/react-dom": "^18.0.11", "@types/react-highlight-words": "^0.16.4", "@types/react-redux": "^7.1.25", - "@types/react-router": "^5.1.2", - "@types/react-router-dom": "^5.1.2", "@types/react-transition-group": "^4.4.5", "@types/redux-mock-store": "^1.0.3", "@types/validator": "^13.7.14", diff --git a/tracker/ui/urls.py b/tracker/ui/urls.py index ba5e12dd6..3b43b91e2 100644 --- a/tracker/ui/urls.py +++ b/tracker/ui/urls.py @@ -1,11 +1,13 @@ from django.urls import path +from ..views import donateviews from . import views app_name = 'tracker' urlpatterns = [ path('', views.index, name='index'), path('admin/', views.admin_redirect), - path('donate/', views.donate, name='donate'), + path('donate/', donateviews.donate), + path('events//donate', views.donate, name='donate'), path('events/', views.index, name='events'), ] diff --git a/webpack.config.js b/webpack.config.js index 1e289c3cb..cd8a368a1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin' const PROD = process.env.NODE_ENV === 'production'; const SOURCE_MAPS = process.env.SOURCE_MAPS ?? false; const ANALYZE = process.env.ANALYZE ?? false; +const NO_MANIFEST = !!process.env.NO_MANIFEST ?? false; const PROJECT_ROOT = __dirname; console.log(PROD ? 'PRODUCTION BUILD' : 'DEVELOPMENT BUILD'); @@ -168,7 +169,7 @@ module.exports = { }, }, plugins: compact([ - ...generateHTMLWebpackPlugins(), + ...(NO_MANIFEST ? [] : generateHTMLWebpackPlugins()), new MiniCssExtractPlugin({ filename: PROD ? 'tracker-[name]-[contenthash].css' : 'tracker-[name].css', chunkFilename: PROD ? '[id].[contenthash].css' : '[id].css', diff --git a/yarn.lock b/yarn.lock index 915225884..0e5f3bcc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -136,7 +136,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.7, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.22.15 resolution: "@babel/runtime@npm:7.22.15" dependencies: @@ -943,18 +943,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.2": - version: 0.3.3 - resolution: "@jridgewell/gen-mapping@npm:0.3.3" - dependencies: - "@jridgewell/set-array": ^1.0.1 - "@jridgewell/sourcemap-codec": ^1.4.10 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab - languageName: node - linkType: hard - -"@jridgewell/gen-mapping@npm:^0.3.5": +"@jridgewell/gen-mapping@npm:^0.3.2, @jridgewell/gen-mapping@npm:^0.3.5": version: 0.3.5 resolution: "@jridgewell/gen-mapping@npm:0.3.5" dependencies: @@ -965,13 +954,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/resolve-uri@npm:3.1.0": - version: 3.1.0 - resolution: "@jridgewell/resolve-uri@npm:3.1.0" - checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 - languageName: node - linkType: hard - "@jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.2 resolution: "@jridgewell/resolve-uri@npm:3.1.2" @@ -979,13 +961,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.0.1": - version: 1.1.2 - resolution: "@jridgewell/set-array@npm:1.1.2" - checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e - languageName: node - linkType: hard - "@jridgewell/set-array@npm:^1.2.1": version: 1.2.1 resolution: "@jridgewell/set-array@npm:1.2.1" @@ -993,16 +968,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/source-map@npm:^0.3.2": - version: 0.3.3 - resolution: "@jridgewell/source-map@npm:0.3.3" - dependencies: - "@jridgewell/gen-mapping": ^0.3.0 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: ae1302146339667da5cd6541260ecbef46ae06819a60f88da8f58b3e64682f787c09359933d050dea5d2173ea7fa40f40dd4d4e7a8d325c5892cccd99aaf8959 - languageName: node - linkType: hard - "@jridgewell/source-map@npm:^0.3.3": version: 0.3.6 resolution: "@jridgewell/source-map@npm:0.3.6" @@ -1013,38 +978,14 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14": - version: 1.4.14 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" - checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.10": - version: 1.4.15 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" - checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.14": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14": version: 1.5.0 resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.18 - resolution: "@jridgewell/trace-mapping@npm:0.3.18" - dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -1061,19 +1002,6 @@ __metadata: languageName: node linkType: hard -"@loadable/component@npm:^5.15.3": - version: 5.15.3 - resolution: "@loadable/component@npm:5.15.3" - dependencies: - "@babel/runtime": ^7.7.7 - hoist-non-react-statics: ^3.3.1 - react-is: ^16.12.0 - peerDependencies: - react: ^16.3.0 || ^17.0.0 || ^18.0.0 - checksum: 78ac341465f2310db30381bc75e8bf73a33f99af849a6a2d87eb3842da0ba1df265e08045dc4f3fee1d194522a43a030baa91740045b64aad002f159ccce64bf - languageName: node - linkType: hard - "@mapbox/hast-util-table-cell-style@npm:^0.2.0": version: 0.2.0 resolution: "@mapbox/hast-util-table-cell-style@npm:0.2.0" @@ -2691,6 +2619,13 @@ __metadata: languageName: node linkType: hard +"@remix-run/router@npm:1.20.0": + version: 1.20.0 + resolution: "@remix-run/router@npm:1.20.0" + checksum: 6bff41117eabb867b17c89baa727580f0a431368b309cd9a1f69767aafa68ea9cac95ff0eeb86d37c2c8655f5cd7c6283d37ae5e6d93e94f648c6112ddb24ede + languageName: node + linkType: hard + "@sindresorhus/is@npm:^4.0.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" @@ -3319,27 +3254,6 @@ __metadata: languageName: node linkType: hard -"@types/react-router-dom@npm:^5.1.2": - version: 5.3.3 - resolution: "@types/react-router-dom@npm:5.3.3" - dependencies: - "@types/history": ^4.7.11 - "@types/react": "*" - "@types/react-router": "*" - checksum: 28c4ea48909803c414bf5a08502acbb8ba414669b4b43bb51297c05fe5addc4df0b8fd00e0a9d1e3535ec4073ef38aaafac2c4a2b95b787167d113bc059beff3 - languageName: node - linkType: hard - -"@types/react-router@npm:*, @types/react-router@npm:^5.1.2": - version: 5.1.20 - resolution: "@types/react-router@npm:5.1.20" - dependencies: - "@types/history": ^4.7.11 - "@types/react": "*" - checksum: 128764143473a5e9457ddc715436b5d49814b1c214dde48939b9bef23f0e77f52ffcdfa97eb8d3cc27e2c229869c0cdd90f637d887b62f2c9f065a87d6425419 - languageName: node - linkType: hard - "@types/react-transition-group@npm:^4.4.5": version: 4.4.5 resolution: "@types/react-transition-group@npm:4.4.5" @@ -3887,16 +3801,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.4, acorn@npm:^8.5.0, acorn@npm:^8.7.1, acorn@npm:^8.9.0": - version: 8.10.0 - resolution: "acorn@npm:8.10.0" - bin: - acorn: bin/acorn - checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d - languageName: node - linkType: hard - -"acorn@npm:^8.8.2": +"acorn@npm:^8.0.4, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": version: 8.12.1 resolution: "acorn@npm:8.12.1" bin: @@ -4459,21 +4364,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.21.4, browserslist@npm:^4.21.5": - version: 4.21.10 - resolution: "browserslist@npm:4.21.10" - dependencies: - caniuse-lite: ^1.0.30001517 - electron-to-chromium: ^1.4.477 - node-releases: ^2.0.13 - update-browserslist-db: ^1.0.11 - bin: - browserslist: cli.js - checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 - languageName: node - linkType: hard - -"browserslist@npm:^4.21.10": +"browserslist@npm:^4.0.0, browserslist@npm:^4.21.10, browserslist@npm:^4.21.4, browserslist@npm:^4.21.5": version: 4.23.3 resolution: "browserslist@npm:4.23.3" dependencies: @@ -4622,14 +4513,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001517": - version: 1.0.30001528 - resolution: "caniuse-lite@npm:1.0.30001528" - checksum: 7b6a71d41de1ce2b95f5851e7074050b7600157acf02c5701d9650a1faf824e368163f4ede5e269d4ea44fe33e00fe60673cb86f40cac35bd02a9a9a4ef7f162 - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001646": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001646": version: 1.0.30001653 resolution: "caniuse-lite@npm:1.0.30001653" checksum: 289cf06c26a46f3e6460ccd5feffa788ab0ab35d306898c48120c65cfb11959bfa560e9f739393769b4fd01150c69b0747ad3ad5ec3abf3dfafd66df3c59254e @@ -4980,29 +4864,6 @@ __metadata: languageName: node linkType: hard -"connected-react-router@npm:^6.9.3": - version: 6.9.3 - resolution: "connected-react-router@npm:6.9.3" - dependencies: - immutable: ^3.8.1 || ^4.0.0 - lodash.isequalwith: ^4.4.0 - prop-types: ^15.7.2 - seamless-immutable: ^7.1.3 - peerDependencies: - history: ^4.7.2 - react: ^16.4.0 || ^17.0.0 - react-redux: ^6.0.0 || ^7.1.0 - react-router: ^4.3.1 || ^5.0.0 - redux: ^3.6.0 || ^4.0.0 - dependenciesMeta: - immutable: - optional: true - seamless-immutable: - optional: true - checksum: 047a11c2f3c9993087f3cd467789445781320c61f3184e1016e7b05862a275006004867231cc7396c7f213afd2fbce7e8ac0df39ba2cda7502d72a140657f9e7 - languageName: node - linkType: hard - "console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" @@ -5719,7 +5580,6 @@ __metadata: "@fortawesome/free-solid-svg-icons": ^5.11.2 "@fortawesome/react-fontawesome": ^0.1.7 "@gamesdonequick/prettier-config": ^2.2.1 - "@loadable/component": ^5.15.3 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.10 "@react-dnd/invariant": ^4.0.2 "@redux-devtools/extension": ^3.2.5 @@ -5747,8 +5607,6 @@ __metadata: "@types/react-dom": ^18.0.11 "@types/react-highlight-words": ^0.16.4 "@types/react-redux": ^7.1.25 - "@types/react-router": ^5.1.2 - "@types/react-router-dom": ^5.1.2 "@types/react-transition-group": ^4.4.5 "@types/redux-mock-store": ^1.0.3 "@types/validator": ^13.7.14 @@ -5758,7 +5616,6 @@ __metadata: axios-mock-adapter: ^1.21.4 buffer: ^6.0.3 classnames: ^2.3.2 - connected-react-router: ^6.9.3 css-loader: ^6.7.3 cssnano: ^6.0.1 eslint: ^8.48.0 @@ -5768,7 +5625,6 @@ __metadata: esno: ^0.17.0 events: ^3.3.0 fetch-mock: ^9.11.0 - history: ^4.10.1 html-webpack-plugin: ^5.5.0 invariant: ^2.2.4 jasmine-core: ^3.5.0 @@ -5804,8 +5660,8 @@ __metadata: react-query: ^3.39.3 react-redux: ^8.0.5 react-refresh: ^0.14.0 - react-router: ^5.1.2 - react-router-dom: ^5.1.2 + react-router: ^6.27.0 + react-router-dom: ^6.27.0 react-transition-group: ^4.4.5 react-use-promise: ^0.5.0 redux: ^4.2.1 @@ -5866,13 +5722,6 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.477": - version: 1.4.510 - resolution: "electron-to-chromium@npm:1.4.510" - checksum: c129dbd5735876fbd25b541cc6fd138914ba8c2189f0c30e2145b645d79d67fcb22f64dc28801ec847e8e71418f89318bd8f0ab02d464979bec2668a06dc4268 - languageName: node - linkType: hard - "electron-to-chromium@npm:^1.5.4": version: 1.5.13 resolution: "electron-to-chromium@npm:1.5.13" @@ -6228,14 +6077,7 @@ __metadata: languageName: node linkType: hard -"escalade@npm:^3.1.1": - version: 3.1.1 - resolution: "escalade@npm:3.1.1" - checksum: a3e2a99f07acb74b3ad4989c48ca0c3140f69f923e56d0cba0526240ee470b91010f9d39001f2a4a313841d237ede70a729e92125191ba5d21e74b106800b133 - languageName: node - linkType: hard - -"escalade@npm:^3.1.2": +"escalade@npm:^3.1.1, escalade@npm:^3.1.2": version: 3.1.2 resolution: "escalade@npm:3.1.2" checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 @@ -6829,17 +6671,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.0.0": - version: 1.15.2 - resolution: "follow-redirects@npm:1.15.2" - peerDependenciesMeta: - debug: - optional: true - checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190 - languageName: node - linkType: hard - -"follow-redirects@npm:^1.15.6": +"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.15.6": version: 1.15.6 resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: @@ -7316,21 +7148,7 @@ __metadata: languageName: node linkType: hard -"history@npm:^4.10.1, history@npm:^4.9.0": - version: 4.10.1 - resolution: "history@npm:4.10.1" - dependencies: - "@babel/runtime": ^7.1.2 - loose-envify: ^1.2.0 - resolve-pathname: ^3.0.0 - tiny-invariant: ^1.0.2 - tiny-warning: ^1.0.0 - value-equal: ^1.0.1 - checksum: addd84bc4683929bae4400419b5af132ff4e4e9b311a0d4e224579ea8e184a6b80d7f72c55927e4fa117f69076a9e47ce082d8d0b422f1a9ddac7991490ca1d0 - languageName: node - linkType: hard - -"hoist-non-react-statics@npm:^3.1.0, hoist-non-react-statics@npm:^3.3.0, hoist-non-react-statics@npm:^3.3.1, hoist-non-react-statics@npm:^3.3.2": +"hoist-non-react-statics@npm:^3.3.0, hoist-non-react-statics@npm:^3.3.2": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" dependencies: @@ -7565,7 +7383,7 @@ __metadata: languageName: node linkType: hard -"immutable@npm:^3.8.1 || ^4.0.0, immutable@npm:^4.2.2": +"immutable@npm:^4.2.2": version: 4.3.0 resolution: "immutable@npm:4.3.0" checksum: bbd7ea99e2752e053323543d6ff1cc71a4b4614fa6121f321ca766db2bd2092f3f1e0a90784c5431350b7344a4f792fa002eac227062d59b9377b6c09063b58b @@ -8072,13 +7890,6 @@ __metadata: languageName: node linkType: hard -"isarray@npm:0.0.1": - version: 0.0.1 - resolution: "isarray@npm:0.0.1" - checksum: 49191f1425681df4a18c2f0f93db3adb85573bcdd6a4482539d98eac9e705d8961317b01175627e860516a2fc45f8f9302db26e5a380a97a520e272e2a40a8d4 - languageName: node - linkType: hard - "isarray@npm:^2.0.5": version: 2.0.5 resolution: "isarray@npm:2.0.5" @@ -8434,13 +8245,6 @@ __metadata: languageName: node linkType: hard -"lodash.isequalwith@npm:^4.4.0": - version: 4.4.0 - resolution: "lodash.isequalwith@npm:4.4.0" - checksum: 428ba7a57c47ec05e2dd18c03a4b4c45dac524a46af7ce3f412594bfc7be6a5acaa51acf9ea113d0002598e9aafc6e19ee8d20bc28363145fcb4d21808c9039f - languageName: node - linkType: hard - "lodash.isplainobject@npm:^4.0.6": version: 4.0.6 resolution: "lodash.isplainobject@npm:4.0.6" @@ -8503,7 +8307,7 @@ __metadata: languageName: node linkType: hard -"loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0, loose-envify@npm:^1.2.0, loose-envify@npm:^1.3.1, loose-envify@npm:^1.4.0": +"loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" dependencies: @@ -9419,13 +9223,6 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.13": - version: 2.0.13 - resolution: "node-releases@npm:2.0.13" - checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 - languageName: node - linkType: hard - "node-releases@npm:^2.0.18": version: 2.0.18 resolution: "node-releases@npm:2.0.18" @@ -9877,15 +9674,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^1.7.0": - version: 1.8.0 - resolution: "path-to-regexp@npm:1.8.0" - dependencies: - isarray: 0.0.1 - checksum: 709f6f083c0552514ef4780cb2e7e4cf49b0cc89a97439f2b7cc69a608982b7690fb5d1720a7473a59806508fc2dae0be751ba49f495ecf89fd8fbc62abccbcd - languageName: node - linkType: hard - "path-to-regexp@npm:^2.2.1": version: 2.4.0 resolution: "path-to-regexp@npm:2.4.0" @@ -9914,14 +9702,7 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 - languageName: node - linkType: hard - -"picocolors@npm:^1.0.1": +"picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": version: 1.0.1 resolution: "picocolors@npm:1.0.1" checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 @@ -11097,7 +10878,7 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.12.0, react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0": +"react-is@npm:^16.13.1, react-is@npm:^16.7.0": version: 16.13.1 resolution: "react-is@npm:16.13.1" checksum: f7a19ac3496de32ca9ae12aa030f00f14a3d45374f1ceca0af707c831b2a6098ef0d6bdae51bd437b0a306d7f01d4677fcc8de7c0d331eb47ad0f46130e53c5f @@ -11236,39 +11017,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^5.1.2": - version: 5.3.4 - resolution: "react-router-dom@npm:5.3.4" +"react-router-dom@npm:^6.27.0": + version: 6.27.0 + resolution: "react-router-dom@npm:6.27.0" dependencies: - "@babel/runtime": ^7.12.13 - history: ^4.9.0 - loose-envify: ^1.3.1 - prop-types: ^15.6.2 - react-router: 5.3.4 - tiny-invariant: ^1.0.2 - tiny-warning: ^1.0.0 + "@remix-run/router": 1.20.0 + react-router: 6.27.0 peerDependencies: - react: ">=15" - checksum: b86a6f2f5222f041e38adf4e4b32c7643d6735a1a915ef25855b2db285fd059d72ba8d62e5bcd5d822b8ef9520a80453209e55077f5a90d0f72e908979b8f535 + react: ">=16.8" + react-dom: ">=16.8" + checksum: de3dcc56297a2879a0e3997fa34ba0f3e1b9986a2ad3ef7991f913902ecf38da0282c98f7834f344ce2d881dbab0a382201a57e9f9ef5e9816febdb26dc038b7 languageName: node linkType: hard -"react-router@npm:5.3.4, react-router@npm:^5.1.2": - version: 5.3.4 - resolution: "react-router@npm:5.3.4" +"react-router@npm:6.27.0, react-router@npm:^6.27.0": + version: 6.27.0 + resolution: "react-router@npm:6.27.0" dependencies: - "@babel/runtime": ^7.12.13 - history: ^4.9.0 - hoist-non-react-statics: ^3.1.0 - loose-envify: ^1.3.1 - path-to-regexp: ^1.7.0 - prop-types: ^15.6.2 - react-is: ^16.6.0 - tiny-invariant: ^1.0.2 - tiny-warning: ^1.0.0 + "@remix-run/router": 1.20.0 peerDependencies: - react: ">=15" - checksum: 892d4e274a23bf4f39abc2efca54472fb646d3aed4b584020cf49654d2f50d09a2bacebe7c92b4ec7cb8925077376dfcd0664bad6442a73604397cefec9f01f9 + react: ">=16.8" + checksum: d22eedc33bcb11891b431655f90eed2d52c2fb3165ad11ca625f62970caf59c4859e6b1a3f92e78902b31ff1a8b2482ebf97ddebb82e9687d1f98730c14e04e6 languageName: node linkType: hard @@ -11585,13 +11354,6 @@ __metadata: languageName: node linkType: hard -"resolve-pathname@npm:^3.0.0": - version: 3.0.0 - resolution: "resolve-pathname@npm:3.0.0" - checksum: 6147241ba42c423dbe83cb067a2b4af4f60908c3af57e1ea567729cc71416c089737fe2a73e9e79e7a60f00f66c91e4b45ad0d37cd4be2d43fec44963ef14368 - languageName: node - linkType: hard - "resolve-pkg-maps@npm:^1.0.0": version: 1.0.0 resolution: "resolve-pkg-maps@npm:1.0.0" @@ -11768,18 +11530,7 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1": - version: 3.1.2 - resolution: "schema-utils@npm:3.1.2" - dependencies: - "@types/json-schema": ^7.0.8 - ajv: ^6.12.5 - ajv-keywords: ^3.5.2 - checksum: 39683edfe3beff018cdb1ae4fa296fc55cea13a080aa2b4d9351895cd64b22ba4d87e2e548c2a2ac1bc76e60980670adb0f413a58104479f1a0c12e5663cb8ca - languageName: node - linkType: hard - -"schema-utils@npm:^3.2.0": +"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" dependencies: @@ -11802,13 +11553,6 @@ __metadata: languageName: node linkType: hard -"seamless-immutable@npm:^7.1.3": - version: 7.1.4 - resolution: "seamless-immutable@npm:7.1.4" - checksum: f65c1dc12e460265ccc4b164085b807570f9fb8a619cd3c216fc7ed933fb09c57a24a7df1b638dc9bd6367d8d69c2f00b5370b0c0996b4046242539096d2d0c6 - languageName: node - linkType: hard - "select-hose@npm:^2.0.0": version: 2.0.0 resolution: "select-hose@npm:2.0.0" @@ -12558,21 +12302,7 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.10.0": - version: 5.16.9 - resolution: "terser@npm:5.16.9" - dependencies: - "@jridgewell/source-map": ^0.3.2 - acorn: ^8.5.0 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: b373693ee01ce08cc9b9595d57df889acbbc899d929a7fe53662330ce954d53145582f6715c9cc4839d555f5769a28fbeb203155b54e3a9c6c646db292002edd - languageName: node - linkType: hard - -"terser@npm:^5.26.0": +"terser@npm:^5.10.0, terser@npm:^5.26.0": version: 5.31.6 resolution: "terser@npm:5.31.6" dependencies: @@ -12607,20 +12337,6 @@ __metadata: languageName: node linkType: hard -"tiny-invariant@npm:^1.0.2": - version: 1.3.1 - resolution: "tiny-invariant@npm:1.3.1" - checksum: 872dbd1ff20a21303a2fd20ce3a15602cfa7fcf9b228bd694a52e2938224313b5385a1078cb667ed7375d1612194feaca81c4ecbe93121ca1baebe344de4f84c - languageName: node - linkType: hard - -"tiny-warning@npm:^1.0.0": - version: 1.0.3 - resolution: "tiny-warning@npm:1.0.3" - checksum: da62c4acac565902f0624b123eed6dd3509bc9a8d30c06e017104bedcf5d35810da8ff72864400ad19c5c7806fc0a8323c68baf3e326af7cb7d969f846100d71 - languageName: node - linkType: hard - "tmp@npm:^0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" @@ -13107,20 +12823,6 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.11": - version: 1.0.11 - resolution: "update-browserslist-db@npm:1.0.11" - dependencies: - escalade: ^3.1.1 - picocolors: ^1.0.0 - peerDependencies: - browserslist: ">= 4.21.0" - bin: - update-browserslist-db: cli.js - checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 - languageName: node - linkType: hard - "update-browserslist-db@npm:^1.1.0": version: 1.1.0 resolution: "update-browserslist-db@npm:1.1.0" @@ -13226,13 +12928,6 @@ __metadata: languageName: node linkType: hard -"value-equal@npm:^1.0.1": - version: 1.0.1 - resolution: "value-equal@npm:1.0.1" - checksum: bb7ae1facc76b5cf8071aeb6c13d284d023fdb370478d10a5d64508e0e6e53bb459c4bbe34258df29d82e6f561f874f0105eba38de0e61fe9edd0bdce07a77a2 - languageName: node - linkType: hard - "vary@npm:^1, vary@npm:~1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2"