Uh oh!
There was an error while loading. Please reload this page.
babel-preset-react-app: add babel-plugin-relay - #2343
Conversation
Adds support for Relay Modern. relay-compiler, relay-runtime, and react-relay are all "peer" dependencies, including the script to run relay compiler. This at least unblocks CRA from being able to develop Relay Modern. https://facebook.github.io/relay/docs/babel-plugin-relay.htmlhttps://facebook.github.io/relay/docs/relay-compiler.html
gaearon
commented
May 23, 2017
Hmm. This doesn't look complicated. Any caveats? |
Caveats.
I have tested this by directly adding this change within my |
gaearon
commented
May 24, 2017
Does it break any other graphql solutions, like Apollo? |
gaearon
commented
May 26, 2017
Can we make a PR to Babel plugin to enforce import/require name? |
wtgtybhertgeghgtwtg
commented
Jun 2, 2017
It looks like the plugin and runtime are designed to be used verbatim, so I'm not sure if that would be an option. |
arvigeus
commented
Jun 5, 2017
What about reading package.json and looking for packages like relay-compiler and react-relay in order to use this plugin? No wasted cycles, no need to worry about Apollo (I think) |
wtgtybhertgeghgtwtg
commented
Jun 14, 2017
I don't see an issue for this on the Relay repo and apparently package detection is non-trivial; is there a plan to move forward with this? |
maletor
commented
Jun 20, 2017
I hope so. Is CRA doing package detection anywhere else at the moment? I would have preferred to keep this as a one line ish change. |
k15a
commented
Jun 20, 2017
There is |
gaearon
commented
Jun 27, 2017
We need some plan for a bunch of optional dependencies people want: Sass, Relay, TypeScript. These are all in principle possible to support but we don't want to either create a second plugin system (which webpack already "is") nor to increase default download size. If you figure out a creative way out of this problem I'd love to know! |
maletor
commented
Jun 29, 2017
This should probably be merged without that system. It's pretty innocuous. |
maletor
commented
Aug 17, 2017
Ping @gaearon |
I'm not sure whether I've just done something stupid, but attempting to apply the same monkey-patch to my own copy of the Would definitely like to see proper relay modern support in CRA, the majority of the reason I went with CRA was because I thought it would save me from all this. |
lpalmes
commented
Sep 19, 2017
react-scripts-dangerous
commented
Sep 20, 2017
Hello! I'm a bot that helps facilitate testing pull requests. Your pull request (commit 56d72ae) has been released on npm for testing purposes. npm i react-scripts-dangerous@1.0.6-56d72ae.0
# or
yarn add react-scripts-dangerous@1.0.6-56d72ae.0
# or
create-react-app --scripts-version=react-scripts-dangerous@1.0.6-56d72ae.0 folder/Note that the package has not been reviewed or vetted by the maintainers. Only install it at your own risk! Thanks for your contribution! |
I get the following error after creating a new react app, running I don't know if it's somehow related, but it seems that exactly the same error happened in another pull request introducing different feature: #2714 |
dhmacs
commented
Dec 15, 2017
Any update on this? |
steobrien
commented
Aug 13, 2018
Since #3909 has landed, I believe this change – i.e. simply adding |
kassens
commented
Aug 14, 2018
With the next Relay release (after 1.6.2) and 2.0 of react-scripts, you'll be able to do I don't think there needs to be a direct dependency? |
shaneosullivan
commented
Aug 14, 2018
Thanks @kassens that's great news! Is there any ETA on the Relay release? Or even a days/weeks/months estimate? |
gaearon
commented
Aug 14, 2018
Closing per #2343 (comment). |
kassens
commented
Aug 15, 2018
@shaneosullivan let me try to do an RC this week, so we can test this easily! |
shaneosullivan
commented
Aug 15, 2018
Awesome, thanks @kassens! Some additional updates to docs and examples would be a huge help too, the current ones on master are fairly confusing |
fernandocalsa
commented
Aug 28, 2018
Is there anything we can help to speed this up? testing or writing documentation... I have been searching for it for long time |
jeffreypriebe
commented
Sep 22, 2018
Example of RC usage (expanding from @kassens comments from Aug 14, his example repo): (For anyone else finding this thread and wanting an example.) |
Adds support for Relay Modern. relay-compiler, relay-runtime, and
react-relay are all "peer" dependencies, including the script to run
relay compiler. This at least unblocks CRA from being able to develop
Relay Modern.
https://facebook.github.io/relay/docs/babel-plugin-relay.html
https://facebook.github.io/relay/docs/relay-compiler.html
#2001 (comment)
Because Relay Modern does not require a schema for babel, this makes the integration process so much easier. Hopefully we can get this merged, but if you think it would be blocked by needing documentation, let me know what a general idea of what you're looking for and we can get that added as well.