facebook / facebook/relay

Rust compiler: purging non-Relay files from __generated__ folders

Open
#3,438 6 comments 0 reactions 0 assignees View on GitHub
bug rust
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.