-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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 support does not work with multiple artifact directories #64890
Relay support does not work with multiple artifact directories #64890
Comments
What's the expected "fix"? Should the relay plugin accept multiple artifact paths? |
yeah I think having the relay plugin allow for some multiple artifact paths would work. alternatively, some way to provide a function to generate the artifact path though i'm not sure if this is possible given the relay plugin is written in rust (and probably would be much slower) the ideal solution would be parsing the relay config, and determining the expected artifact path from that. |
hey, how does this work now? was looking through https://github.com/swc-project/plugins/commits/main/packages/relay for some example usage but couldn't find any |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Oops this is not fixed |
swc-project/plugins#318 adds multi-project support to |
whoa awesome, looks like a lot of work so thanks a ton! is there any way to use this with older next versions? or is upgrading just the best way? (in case, maybe the swc plugin api changed?) |
One plugin API is added and it's documented at https://github.com/swc-project/plugins/tree/aff55e5c6e1aceb18cfab49addb946f573fd13a4/packages/relay#example You may configure |
Reopening as it's reverted |
### Description Update swc crates ### Testing Instructions See [next.js counterpart](vercel/next.js#67378) - Closes vercel/next.js#64890 - Closes vercel/next.js#63104
# Turbopack * vercel/turborepo#8686 <!-- Tobias Koppers - improve performance of the graph aggregation --> * vercel/turborepo#8694 <!-- Benjamin Woodruff - Replace `unreachable` with `bail` in `finalize_css` --> * vercel/turborepo#8661 <!-- Benjamin Woodruff - Create a minimum viable `ResolvedVc` type --> * vercel/turborepo#8662 <!-- Benjamin Woodruff - Add a minimum viable ResolvedValue marker trait --> * vercel/turborepo#8678 <!-- Benjamin Woodruff - Add derive macro for ResolvedValue --> * vercel/turborepo#8715 <!-- Benjamin Woodruff - Switch RcStr from std::sync::Arc to triomphe::Arc --> * vercel/turborepo#8699 <!-- Donny/강동윤 - perf: Merge multiple `EsmBinding` --> * vercel/turborepo#8720 <!-- Benjamin Woodruff - Add support for `#[turbo_tasks::value(resolved)]` and `#[turbo_tasks::value_trait(resolved)]` --> * vercel/turborepo#8706 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.96.9` --> ### What? Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 ### Why? To keep in sync ### How? - Closes #64890 - Closes #63104
### Description Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 - Closes #64890 - Closes #63104 ### Testing Instructions See #67378
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
### Description Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 - Closes #64890 - Closes #63104 ### Testing Instructions See #67378
### Description Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 - Closes #64890 - Closes #63104 ### Testing Instructions See #67378
### Description Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 - Closes #64890 - Closes #63104 ### Testing Instructions See #67378
* vercel/turborepo#8686 <!-- Tobias Koppers - improve performance of the graph aggregation --> * vercel/turborepo#8694 <!-- Benjamin Woodruff - Replace `unreachable` with `bail` in `finalize_css` --> * vercel/turborepo#8661 <!-- Benjamin Woodruff - Create a minimum viable `ResolvedVc` type --> * vercel/turborepo#8662 <!-- Benjamin Woodruff - Add a minimum viable ResolvedValue marker trait --> * vercel/turborepo#8678 <!-- Benjamin Woodruff - Add derive macro for ResolvedValue --> * vercel/turborepo#8715 <!-- Benjamin Woodruff - Switch RcStr from std::sync::Arc to triomphe::Arc --> * vercel/turborepo#8699 <!-- Donny/강동윤 - perf: Merge multiple `EsmBinding` --> * vercel/turborepo#8720 <!-- Benjamin Woodruff - Add support for `#[turbo_tasks::value(resolved)]` and `#[turbo_tasks::value_trait(resolved)]` --> * vercel/turborepo#8706 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.96.9` --> Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 To keep in sync - Closes #64890 - Closes #63104
* vercel/turborepo#8686 <!-- Tobias Koppers - improve performance of the graph aggregation --> * vercel/turborepo#8694 <!-- Benjamin Woodruff - Replace `unreachable` with `bail` in `finalize_css` --> * vercel/turborepo#8661 <!-- Benjamin Woodruff - Create a minimum viable `ResolvedVc` type --> * vercel/turborepo#8662 <!-- Benjamin Woodruff - Add a minimum viable ResolvedValue marker trait --> * vercel/turborepo#8678 <!-- Benjamin Woodruff - Add derive macro for ResolvedValue --> * vercel/turborepo#8715 <!-- Benjamin Woodruff - Switch RcStr from std::sync::Arc to triomphe::Arc --> * vercel/turborepo#8699 <!-- Donny/강동윤 - perf: Merge multiple `EsmBinding` --> * vercel/turborepo#8720 <!-- Benjamin Woodruff - Add support for `#[turbo_tasks::value(resolved)]` and `#[turbo_tasks::value_trait(resolved)]` --> * vercel/turborepo#8706 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.96.9` --> Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 To keep in sync - Closes #64890 - Closes #63104
* vercel/turborepo#8686 <!-- Tobias Koppers - improve performance of the graph aggregation --> * vercel/turborepo#8694 <!-- Benjamin Woodruff - Replace `unreachable` with `bail` in `finalize_css` --> * vercel/turborepo#8661 <!-- Benjamin Woodruff - Create a minimum viable `ResolvedVc` type --> * vercel/turborepo#8662 <!-- Benjamin Woodruff - Add a minimum viable ResolvedValue marker trait --> * vercel/turborepo#8678 <!-- Benjamin Woodruff - Add derive macro for ResolvedValue --> * vercel/turborepo#8715 <!-- Benjamin Woodruff - Switch RcStr from std::sync::Arc to triomphe::Arc --> * vercel/turborepo#8699 <!-- Donny/강동윤 - perf: Merge multiple `EsmBinding` --> * vercel/turborepo#8720 <!-- Benjamin Woodruff - Add support for `#[turbo_tasks::value(resolved)]` and `#[turbo_tasks::value_trait(resolved)]` --> * vercel/turborepo#8706 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.96.9` --> Update SWC crates to swc-project/swc@226617e and swc-project/plugins@b7658c3 To keep in sync - Closes #64890 - Closes #63104
Link to the code that reproduces this issue
https://github.com/mmmulani/relay-multi/tree/main
To Reproduce
Note: The linked github repo has a workaround in place.
This issue is about using Relay's multi-project configuration to have graphQL queries in different "projects" where one project can reference another. The most common example of this is something like a "web" folder that uses graphQL fragments in a "shared" folder.
This is
shared/
that uses graphQL, e.g. TestComponent.tsx with:shared/TestComponent
insideweb-app/
Current vs. Expected behavior
Current behaviour: the import fails as the Relay SWC plugin expects the Relay generated graphQL file to live in
web-app/__generated__
rather thanshared/__generated__
Module not found: Can't resolve '/relay-multi/web-app/./__generated__/TestComponent_country.graphql.ts'
You would expect there to be some way to specify the multi project config inside the
next.config.js
file so that the plugin knows to look inshared/__generated__
rather thanweb-app/__generated__
.Workaround
You can workaround this by modifying module resolution in next.config.js with:
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 21.6.2 npm: 10.2.4 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.2.2 // Latest available version is detected (14.2.2). eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.4.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
SWC
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
No response
PACK-2986
The text was updated successfully, but these errors were encountered: