Skip to content
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

Add config support for babel-plugin-relay/macro #2646

Closed
wants to merge 1 commit into from

Conversation

sgwilym
Copy link
Contributor

@sgwilym sgwilym commented Feb 14, 2019

Allows configuration options (e.g. artifactDirectory, schema) to be passed to usages of babel-plugin-relay/macro using experimental support in babel-macros. The options can be specified in any of the possible ways listed in the following URL: https://github.com/kentcdodds/babel-plugin-macros/blob/master/other/docs/author.md#config-experimental

Notably allows more complex configurations in projects created with create-react-app. In my case, I'd like to use an un-ejected CRA project with relay-compiler-language-typescript.

@sibelius
Copy link
Contributor

can you also add an enable of the usage of this on docs?

@sgwilym
Copy link
Contributor Author

sgwilym commented Feb 14, 2019

@sibelius Added docs.

@kassens
Copy link
Member

kassens commented Mar 4, 2019

Thank you!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kassens is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hughevans
Copy link

@sgwilym Do you have an example of an un-ejected CRA working with relay-compiler-language-typescript?

@sgwilym
Copy link
Contributor Author

sgwilym commented Mar 25, 2019

@hughevans I don't, but with the next release it should be straightforward. The only thing you should need to add is a config for babel-plugin-relay/macro, e.g. in package.json:

"babelMacros": {
    "relay": {
      "artifactDirectory": "./src/__generated__"
    }
  }

(and your relay-compiler command should also have the --language typescript and --artifactDirectory ./src/__generated__ flags).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants