-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Remix Instructions #9329
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
docs/Remix.md
Outdated
@@ -7,7 +7,7 @@ title: "Remix Integration" | |||
|
|||
[Remix](https://remix.run/) is a Node.js framework for server-side-rendered React apps. But even if react-admin is designed to build Single-Page Applications, Remix and react-admin integrate seamlessly. | |||
|
|||
## Setting Up Remix | |||
### Setting Up Remix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are all subsections level 3 ? they should all be level 2
// in app/components/App.tsx | ||
import { Admin, Resource, ListGuesser } from "react-admin"; | ||
import jsonServerProvider from "ra-data-json-server"; | ||
Finally, update your `remix.config.ts` to add `ra-data-json-server` to the `serverDependenciesToBundle` array: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, update your `remix.config.ts` to add `ra-data-json-server` to the `serverDependenciesToBundle` array: | |
Finally, update your `remix.config.js` to add `ra-data-json-server` to the `serverDependenciesToBundle` array: |
For me it's remix.config.js
at least 🤷
// assetsBuildDirectory: "public/build", | ||
// publicPath: "/build/", | ||
// serverBuildPath: "build/index.js", | ||
}; | ||
``` | ||
|
||
Now the admin renders at `http://localhost:3000/admin`, and you can use the Remix routing system to add more pages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to mention somewhere to run npm run dev
``` | ||
|
||
That's it! Now Remix both renders the admin app and serves as a proxy to the Supabase API. You can test the app by visiting `http://localhost:3000/admin`, and the API Proxy by visiting `http://localhost:3000/admin/api/posts`. | ||
Update your `remix.config.ts` to add `@raphiniert/ra-data-postgrest` to the `serverDependenciesToBundle` array: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update your `remix.config.ts` to add `@raphiniert/ra-data-postgrest` to the `serverDependenciesToBundle` array: | |
Update your `remix.config.js` to add `@raphiniert/ra-data-postgrest` to the `serverDependenciesToBundle` array: |
import styles from "~/styles/app.css"; | ||
import { Admin, Resource, ListGuesser, fetchUtils } from "react-admin"; | ||
import postgrestRestProvider, { | ||
IDataProviderConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDataProviderConfig
is unused
'Authorization': `Bearer ${process.env.SUPABASE_SERVICE_ROLE}`, | ||
} | ||
}); | ||
const dataProvider = jsonServerProvider({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const dataProvider = jsonServerProvider({ | |
const dataProvider = postgrestRestProvider({ |
Fixes #9308