From 9a660abb79f0517af7880e1ee53e7d8e1307f504 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:06:50 +0100 Subject: [PATCH 1/4] remove wrapUseRoutesV7 this was left in by mistake --- app/root.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 5fdd9ff3..2be10b0e 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,4 +1,3 @@ -import { wrapUseRoutesV7 } from '@sentry/react' import { useRef } from 'react' import { data, @@ -270,7 +269,7 @@ function AppWithProviders() { ) } -export default wrapUseRoutesV7(AppWithProviders) +export default AppWithProviders function UserDropdown() { const user = useUser() From 64f9fe22f172abc012c652f221d15ac21077e111 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:08:28 +0100 Subject: [PATCH 2/4] add back future flags this was left out by mistake --- react-router.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/react-router.config.ts b/react-router.config.ts index e44bb40f..9d4a2e92 100644 --- a/react-router.config.ts +++ b/react-router.config.ts @@ -2,4 +2,8 @@ import { type Config } from '@react-router/dev/config' export default { // Defaults to true. Set to false to enable SPA for all routes. ssr: true, + + future: { + unstable_optimizeDeps: true, + }, } satisfies Config From 543a381113502df3c09230907f4281e98d0577a9 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:12:56 +0100 Subject: [PATCH 3/4] eslint ignore react-routre generated files it creates a lot of noice in linting --- eslint.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index 5fa72f28..eede0cf7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,4 +8,7 @@ export default [ files: ['**/tests/**/*.ts'], rules: { 'react-hooks/rules-of-hooks': 'off' }, }, + { + ignores: ['.react-router/*'], + }, ] From 4265284785bae35cd31a3cf2d6dd4cbeaea07934 Mon Sep 17 00:00:00 2001 From: Samuel Jensen <44519206+nichtsam@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:13:24 +0100 Subject: [PATCH 4/4] lint --- app/components/progress-bar.tsx | 2 +- app/utils/client-hints.tsx | 2 +- app/utils/misc.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/progress-bar.tsx b/app/components/progress-bar.tsx index 6e7c5915..d493f709 100644 --- a/app/components/progress-bar.tsx +++ b/app/components/progress-bar.tsx @@ -1,5 +1,5 @@ -import { useNavigation } from 'react-router' import { useEffect, useRef, useState } from 'react' +import { useNavigation } from 'react-router' import { useSpinDelay } from 'spin-delay' import { cn } from '#app/utils/misc.tsx' import { Icon } from './ui/icon.tsx' diff --git a/app/utils/client-hints.tsx b/app/utils/client-hints.tsx index baf72d78..560f35af 100644 --- a/app/utils/client-hints.tsx +++ b/app/utils/client-hints.tsx @@ -8,8 +8,8 @@ import { subscribeToSchemeChange, } from '@epic-web/client-hints/color-scheme' import { clientHint as timeZoneHint } from '@epic-web/client-hints/time-zone' -import { useRevalidator } from 'react-router' import * as React from 'react' +import { useRevalidator } from 'react-router' import { useOptionalRequestInfo, useRequestInfo } from './request-info.ts' const hintsUtils = getHintUtils({ diff --git a/app/utils/misc.tsx b/app/utils/misc.tsx index e3ad6c6b..03567675 100644 --- a/app/utils/misc.tsx +++ b/app/utils/misc.tsx @@ -1,6 +1,6 @@ -import { useFormAction, useNavigation } from 'react-router' import { clsx, type ClassValue } from 'clsx' import { useEffect, useMemo, useRef, useState } from 'react' +import { useFormAction, useNavigation } from 'react-router' import { useSpinDelay } from 'spin-delay' import { extendTailwindMerge } from 'tailwind-merge' import { extendedTheme } from './extended-theme.ts'