-
Notifications
You must be signed in to change notification settings - Fork 432
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
Relay example with Next.js v13 #241
Conversation
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.
I think that don't need to commit __generated__
folder.
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.
Can you remove __generated__
folder?
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.
Cool!
Is it possible to use Turbopack?
It should be possible |
Thanks for creating this demo @alunyov! I've tried to run your branch and also a project from my work with NextJS 13 and Relay and I'm getting the following error:
I'm using Node v16.8.0 |
I see, @araujobarret - I need to update the PR to include To unblock yourself, just create a |
I see, thanks for the fast reply! I was wondering if it was necessary since the new appDir stuff doesn't require |
Fixes: relayjs/relay-examples#241 (comment) **Context:** Current relay transformer requires `pages_dir` in its entry point: https://github.com/vercel/next.js/blob/ecfd2f4cd6a1c3f6bc3cd1cca6b62a3cb705a4e2/packages/next-swc/crates/core/src/relay.rs#L184 But consider the case that `pages_dir` is not provided because the page system is built entirely in the app directory introduced from Next.js 13. In this case, transformer causes unconditional panics even though there's nothing wrong with it. This PR removes panic in entry point and changes the type of `pages_dir` into `Option<T>` so that keeps [build stability for existing page system](https://github.com/vercel/next.js/blob/ecfd2f4cd6a1c3f6bc3cd1cca6b62a3cb705a4e2/packages/next-swc/crates/core/src/relay.rs#L157-L160) even if `pages_dir` is not provided.
do you have an idea how to create a boilerplate for reactRelayContainer? I don't know if I like the idea of having to define an environment and container for each page wouldn't it be ideal to define a container in the layout next feature? and use for the whole application? maybe adapt it https://github.com/sibelius/relay-workshop/blob/main/apps/next-app/src/relay/ReactRelayContainer.tsx |
This example is a simplified version of the Issue Tracker Example, and it demonstrates a possible Relay integration with the Next.js v13 and React Server Components.
Additionally, this example is using parts of the
data-driven-dependecies
example, mainly to setup Next.js integration. However, the code that is related to the server preloading is much simpler now.cc @voideanvalue I would love your feedback on this, as you've been actively looking into these.