From 8c234f141ab102ac1d89e0aea66c470f08e700ef Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 02:15:58 +0000 Subject: [PATCH] Fix build error by removing @remix-run dependencies in docs app --- apps/docs/src/lib/storybook/README.md | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apps/docs/src/lib/storybook/README.md diff --git a/apps/docs/src/lib/storybook/README.md b/apps/docs/src/lib/storybook/README.md new file mode 100644 index 00000000..16f78d10 --- /dev/null +++ b/apps/docs/src/lib/storybook/README.md @@ -0,0 +1,34 @@ +# Storybook Mocks + +This directory contains mock implementations for React Router components and types that were previously imported from @remix-run packages. + +## remix-mock.tsx + +This file provides mock implementations for: + +1. Types that were previously from @remix-run/node: + - ActionFunction + - ActionFunctionArgs + - LoaderFunction + - LinksFunction + - MetaFunction + +2. Components that were previously from @remix-run/react: + - Form + - useFetcher + +3. Utilities that were previously from @remix-run/testing: + - createRemixStub + +## remix-stub.tsx + +This file provides a decorator for Storybook stories that need to use the React Router components and types. + +## Migration from Remix to React Router + +As part of the migration from Remix to React Router v7, we've replaced all @remix-run imports with our own mock implementations that use React Router components under the hood. This approach allows us to: + +1. Remove all @remix-run dependencies from the docs app +2. Fix build errors when running `yarn build-storybook` +3. Maintain compatibility with existing code that uses Remix components and types +4. Simplify the codebase by using a single routing library \ No newline at end of file