-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[RFC] Allow for more complex configuration of relay-compiler / babel plugin #2518
Comments
cc @alunyov |
consuming a user babel config in js is pretty easy you can just import like a normal |
@alloy Is the "language" option already supported? If not how would that work? Should it compile on the fly? |
@alloy I have been using the In any case I'm for extending the config as you're proposing here |
Ok, retracting some of that last comment. It appears that |
Oh I see. No currently it remains a two-step process. |
Initially I was skeptical of this - configuration can quickly get out of hand especially if configuration values can come from too many different places (environment variables, command line args, etc). I think we can follow metro's approach (the
Re implementation, it would be great to have this as a standalone package. Before sending a PR, I think the first step is to write up a quick sketch of what the API would be and an overview of the implementation, list out some test cases. We can review that before proceeding with coding. |
Do you mean in the same way how |
Yeah, in this repo as a sibling package to relay-compiler/ |
I'm going to start with PRs to make all features available through the CLI first, as that needs to get done anyways. |
I believe this is related: #2702 |
@josephsavona I noticed that we have camelCase and kebab-case options currently. camelCase would make consistency between CLI and JS configuration easier and probably more natural, but kebab-case is ofc more natural to CLIs. Should we choose one case and, if so, which one? |
Summary: Closes #2162. In preparation of #2518, as requested by josephsavona we should have CLI versions of each possible argument, hereby CLI support for custom scalars. I ended up going with the dot-notation syntax of yargs, which seems a little foreign (to me), but it comes builtin with yargs. Let me know what you think. E.g. ``` $ relay-compiler --customScalars.URL=String --customScalars.Date=String ``` Pull Request resolved: #2745 Reviewed By: kassens Differential Revision: D15724870 Pulled By: jstejada fbshipit-source-id: 62d7a8766064c9355dad07ae7a94251fa4d047b6
While I’m not a fan of lots of configuration –and thus think that where possible we should have generally applicable defaults, such as with persisted queries– I’m starting to feel like relay-compiler + the babel plugin could do with a more advanced way of configuration, in the form of an evaluated JS config module:
Persisted queries #2354 (comment), 0Persisted queries #2354 (comment), and RFC: Teach compiler
--persist
option #1846)The text was updated successfully, but these errors were encountered: