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

RFC: Remix Support #88

Open
RichiCoder1 opened this issue Dec 11, 2023 · 2 comments
Open

RFC: Remix Support #88

RichiCoder1 opened this issue Dec 11, 2023 · 2 comments
Labels
RFC A discussion about a future feature

Comments

@RichiCoder1
Copy link

Summary

Official request for Remix support.

Proposed Solution

In theory Next.js API Routes are analogous to Resource Routes and Service Side Props to Loaders so a lot of the concepts already present should translate.

@RichiCoder1 RichiCoder1 added the RFC A discussion about a future feature label Dec 11, 2023
@JoviDeCroock
Copy link
Member

JoviDeCroock commented Dec 11, 2023

Hey,

That's a great suggestion 🙌 , I do think with Remix moving to vite this could become pretty convenient as we have already explored vite in #79. We can use import.meta.glob to add the schema-types declared in the types/ directory and create a way to initialise the resource route.

The exploration after that would be how it look on the client-side, I personally don't have too much experience with Remix so I'm going to have to do some reading at first before I can participate in discussing how this API surface looks.

For generating the client-side types I reckon that we can hook into the vite plugin lifecycle to boot the code-generator.

EDIT: when looking into this I would probably build support out for vite, it looks like there aren't many folks running GraphQL servers/... in resource-routes. Will need to check how their signature works. That being said with the standalone we might be able to do fuse build --watch and import that output in the service-route given a custom adapter that exports loader/action for remix 😅 or use fuse dev and call out to the endpoint generated by that, that way they can be deployed independently and it will be easier to scale to multiple devices.

@RichiCoder1
Copy link
Author

Yup, Remix moving to vite is a massive enabler for automatic generation (and also other non-remix projects). I've been using this vite graphql codegen plugin with Pothos in a side project and it works pretty well. So would love to drop all that glue for an opinionated solution! As a bonus, Remix is considering RSC so should align on that goal eventually too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC A discussion about a future feature
Projects
None yet
Development

No branches or pull requests

2 participants