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

Monorepo, Turborepo/Yarn Workspaces etc Support #427

Closed
mickdelaney opened this issue Aug 14, 2022 · 7 comments
Closed

Monorepo, Turborepo/Yarn Workspaces etc Support #427

mickdelaney opened this issue Aug 14, 2022 · 7 comments

Comments

@mickdelaney
Copy link

Hi,
Would it be possible to use this plugin in a monorepo setup ?
Where we had an App containing graphql + Packages containing graphql ?
Regards

@tobias-tengler
Copy link
Collaborator

tobias-tengler commented Aug 14, 2022

I haven't tried it yet, but packages containing graphql tagged literals should be correctly transformed by this plugin.

If you start a new project, just be aware that the plugin currently doesn't support Vite 3. I have already created a PR to add support, but it has yet to be merged: #424

If you want to go ahead with Vite 3, you can install the package from my branch directly for now:

yarn add vite-plugin-relay@https://github.com/tobias-tengler/vite-plugin-relay#tte/fix-plugin

The concrete installation instructions are here

@mickdelaney
Copy link
Author

@oscartbeaumont
i've added an example using turborepo + vite + relay + vite-plugin-relay

i've personally ended up (in a large monrepo) using tsup + babel for packages, but i've lost HMR as a result.
so would be great to get an idea how to make this work.

@mickdelaney
Copy link
Author

There's a vite 2x version here
mickdelaney/vite-relay-monorepo#1
but i've not seen any difference

@oscartbeaumont
Copy link
Owner

I am not using Relay in any projects currently so this plugin has been very low on my list of priorities. @tobias-tengler has done some great stuff to upgrade it which I just release to pnpm so give it a shot.

@mickdelaney
Copy link
Author

@oscartbeaumont thanks.

for anyone else coming here in a similar situation, this setup works by manually plugging in esbuild-babel into packages

https://github.com/mickdelaney/relay-recoil-post

@mickdelaney
Copy link
Author

@tobias-tengler if you have some time next week i'd love to know how I can help out here.
i'm also using this with Hotchocolate btw ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants