Skip to content

Commit 8257a8d

Browse files
authored
Merge pull request #38 from lambda-curry/LC-177-migrate-react-router
LC-177: Migrate LambdaCurry/forms to latest React Router and React version
2 parents 1230d08 + 0cfe04d commit 8257a8d

File tree

11 files changed

+767
-3254
lines changed

11 files changed

+767
-3254
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,7 @@ dist
179179
.turbo
180180
*storybook.log
181181

182-
storybook-static
182+
storybook-static
183+
184+
# React Router v7
185+
.react-router/

apps/docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"storybook": "^8.4.7"
2121
},
2222
"devDependencies": {
23-
"@remix-run/dev": "^2.15.1",
24-
"@remix-run/testing": "^2.15.1",
23+
"@react-router/dev": "^7.0.0",
2524
"@storybook/test-runner": "^0.20.1",
2625
"@storybook/testing-library": "^0.2.2",
2726
"@types/react": "^19.0.0",
@@ -30,6 +29,8 @@
3029
"autoprefixer": "^10.4.20",
3130
"postcss": "^8.4.49",
3231
"react": "^19.0.0",
32+
"react-router": "^7.0.0",
33+
"react-router-dom": "^7.0.0",
3334
"tailwindcss": "^3.4.17",
3435
"typescript": "^5.7.2",
3536
"vite": "^5.4.11",

apps/docs/src/lib/storybook/remix-stub.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ActionFunction, LinksFunction, LoaderFunction, MetaFunction } from '@remix-run/node';
2-
import { createRemixStub } from '@remix-run/testing';
1+
import type { ActionFunction, LinksFunction, LoaderFunction, MetaFunction } from 'react-router';
2+
import { createRemixStub } from '@react-router/testing';
33
import type { Decorator } from '@storybook/react';
44
import type { ComponentType } from 'react';
55
import type { IndexRouteObject, NonIndexRouteObject } from 'react-router-dom';

apps/docs/src/remix-hook-form/checkbox.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { zodResolver } from '@hookform/resolvers/zod';
22
import { Checkbox } from '@lambdacurry/forms/remix-hook-form/checkbox';
33
import { Button } from '@lambdacurry/forms/ui/button';
4-
import type { ActionFunctionArgs } from '@remix-run/node';
5-
import { useFetcher } from '@remix-run/react';
4+
import type { ActionFunctionArgs } from 'react-router';
5+
import { useFetcher } from 'react-router-dom';
66
import type { Meta, StoryContext, StoryObj } from '@storybook/react';
77
import { expect, userEvent } from '@storybook/test';
88
import type {} from '@testing-library/dom';

packages/components/app/routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { type RouteConfig } from "@react-router/dev/routes";
2+
import { flatRoutes } from "@react-router/fs-routes";
3+
4+
export default flatRoutes() satisfies RouteConfig;

packages/components/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"type-check": "tsc --noEmit"
3636
},
3737
"peerDependencies": {
38-
"react": "^18.0.0",
38+
"react": "^19.0.0",
3939
"remix-hook-form": "5.1.1"
4040
},
4141
"dependencies": {
@@ -53,9 +53,7 @@
5353
"@radix-ui/react-slot": "^1.1.1",
5454
"@radix-ui/react-switch": "^1.1.2",
5555
"@radix-ui/react-tooltip": "^1.1.6",
56-
"@remix-run/node": "^2.15.1",
57-
"@remix-run/react": "^2.15.1",
58-
"@remix-run/serve": "^2.15.1",
56+
"@react-router/node": "^7.0.0",
5957
"class-variance-authority": "^0.7.1",
6058
"clsx": "^2.1.1",
6159
"date-fns": "^4.1.0",
@@ -64,15 +62,16 @@
6462
"next-themes": "^0.4.4",
6563
"react-day-picker": "9.4.4",
6664
"react-hook-form": "^7.53.1",
65+
"react-router": "^7.0.0",
66+
"react-router-dom": "^7.0.0",
6767
"remix-hook-form": "5.1.1",
6868
"sonner": "^1.7.1",
6969
"tailwind-merge": "^2.5.5",
7070
"tailwindcss-animate": "^1.0.7",
7171
"zod": "^3.24.1"
7272
},
7373
"devDependencies": {
74-
"@remix-run/dev": "^2.15.1",
75-
"@remix-run/testing": "^2.15.1",
74+
"@react-router/dev": "^7.0.0",
7675
"@types/glob": "^8.1.0",
7776
"@types/react": "^19.0.0",
7877
"@typescript-eslint/eslint-plugin": "^6.21.0",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { Config } from "@react-router/dev/config";
2+
3+
export default {
4+
ssr: true,
5+
} satisfies Config;

packages/components/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
"jsx": "react-jsx",
1515
"strict": true,
1616
"esModuleInterop": true,
17-
"moduleResolution": "bundler"
17+
"moduleResolution": "bundler",
18+
"types": ["@react-router/node", "vite/client"],
19+
"rootDirs": [".", "./.react-router/types"]
1820
},
19-
"include": ["src"],
21+
"include": ["src", ".react-router/types/**/*"],
2022
"exclude": ["**/*.stories.tsx", "**/*.test.tsx", "node_modules", "dist"]
2123
}

packages/components/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export default defineConfig({
5353
'@radix-ui/react-slot',
5454
'@radix-ui/react-switch',
5555
'@radix-ui/react-tooltip',
56-
'@remix-run/node',
57-
'@remix-run/react',
58-
'@remix-run/serve',
56+
'react-router',
57+
'react-router-dom',
58+
'@react-router/node',
5959
'class-variance-authority',
6060
'clsx',
6161
'date-fns',

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"module": "ESNext",
2121
"lib": ["ES2020", "DOM", "DOM.Iterable"],
2222
"jsx": "react-jsx",
23-
"resolveJsonModule": true
23+
"resolveJsonModule": true,
24+
"types": ["@react-router/node", "vite/client"]
2425
},
2526
"exclude": ["node_modules"]
2627
}

0 commit comments

Comments
 (0)