Rust compiler: purging non-Relay files from __generated__ folders
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I have a feature request (or proposal/discussion) for the new Rust compiler. I noticed that the new compiler always deletes the whole content of `__generated__` folder. It's even explained here: https://github.com/facebook/relay/blob/63c4e99687c26a9e05b42e6e68aa55782a45a135/compiler/crates/relay-compiler/src/config.rs#L667-L672
I see the `__generated__` folder to be a nice convention together with `__tests__`, `__fixtures__` and so on. Nothing screams from it "Relay" (but rather "it's generated content"). So I used this pattern for some other use-cases where I generate some kind of non-Relay content into `__generated__`. This obviously brings some troubles now since Relay Rust compiler purges these files (even though it has nothing to do with Relay and there are no Relay artifacts).
What is the recommended strategy here? Or perhaps, would you please reconsider this behavior? Some other solutions could be:
- target only `*.graphql.js` (or new `*.relay.js`) files under `__generated__/…`
- have the possibility to put Relay artifacts under `__generated__/relay/…`
- have the possibility to keep subfolders like `__generated__/something-different/…`
Have you encountered this situation inside Facebook? How did you solve it?
Thanks! 😎
Contributor guide
Assessment
This issue has not been assessed yet.