You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the relay.config.js and the configuration object that is passed to RelayCompilerWebpackPlugin has some overlap, but is also inconsistent.
For example you'll find both schema, src, exclude, include, extensions and artifactDirectory at the top level of the configuration object, so it would only be natural to assume that you could pass the whole configuration object from relay.config.js into RelayCompilerWebpackPlugin.
However if you want to eg. turn on noFutureProofEnums, you have to pass it into the nested "config" object.
When adopting this plugin in our code, suddenly we had "%future value added" all over the place, and at first we assumed it was because of some updated dependency and undocumented change, so we first adjusted our code.
I think this can cause others some headaches as well, until they find out about this. So I think either this should be changed (would be best as we can just import relay.config.js and have it in 1 place) or a note about this should be added to the docs, or at least the config object should be partially typed and not as any as it is now.
What do you think?
The text was updated successfully, but these errors were encountered:
@sorenhoyer that all makes sense. I think all values should probably be moved to the config sub object (leaving room for other plugin specific, non-relay.config.js related settings). This will break a bunch of things for people so we'd need a major version bump.
I haven't been working on relay projects recently so don't have the inclination to do this myself. Happy to accept PRs for it from anyone interested.
Currently the relay.config.js and the configuration object that is passed to RelayCompilerWebpackPlugin has some overlap, but is also inconsistent.
For example you'll find both schema, src, exclude, include, extensions and artifactDirectory at the top level of the configuration object, so it would only be natural to assume that you could pass the whole configuration object from relay.config.js into RelayCompilerWebpackPlugin.
However if you want to eg. turn on noFutureProofEnums, you have to pass it into the nested "config" object.
When adopting this plugin in our code, suddenly we had "%future value added" all over the place, and at first we assumed it was because of some updated dependency and undocumented change, so we first adjusted our code.
I think this can cause others some headaches as well, until they find out about this. So I think either this should be changed (would be best as we can just import relay.config.js and have it in 1 place) or a note about this should be added to the docs, or at least the config object should be partially typed and not as any as it is now.
What do you think?
The text was updated successfully, but these errors were encountered: