Skip to content
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

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Update Remix Instructions #9329

merged 3 commits into from
Oct 5, 2023

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Oct 4, 2023

Fixes #9308

@djhi djhi added the RFR Ready For Review label Oct 4, 2023
@vercel
Copy link

vercel bot commented Oct 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-admin-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2023 3:11pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
react-admin ⬜️ Ignored (Inspect) Visit Preview Oct 4, 2023 3:11pm

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
Copy link
Member

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

@fzaninotto fzaninotto merged commit c66e5c1 into master Oct 5, 2023
6 checks passed
@fzaninotto fzaninotto deleted the update-remix-doc branch October 5, 2023 08:43
@fzaninotto fzaninotto added this to the 4.14.5 milestone Oct 5, 2023
// 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Contributor

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({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const dataProvider = jsonServerProvider({
const dataProvider = postgrestRestProvider({

@slax57 slax57 mentioned this pull request Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when building app according to Remix v2 Integration Guide
3 participants