-
Notifications
You must be signed in to change notification settings - Fork 87
[Relay] Support for Relay GraphQL needed. #45
Comments
This will probably be solved by #26 when it's implemented. Can you please say whether it works with React Hot Loader? |
@gaearon It didn't work for me. I hope your big rewrite for babel 6 compatibility will fix this issue too. |
As a quick hack, I changed function getDisplayName(node) {
if (node.arguments[0].properties) {
const property = find(node.arguments[0].properties, node => node.key.name === 'displayName');
return property && property.value.value;
} else {
return node.arguments[0].name;
}
} And I updated my babel plugin config with the following: [
"react-transform",
{
"transforms": [
{
"transform": "react-transform-hmr",
"imports": [
"react"
],
"locals": [
"module"
]
}
],
"factoryMethods": ["React.createClass", "Relay.createContainer"]
}
] This makes it so hotloading will work when using Relay. It won't reload your fragments and re-fetch data... But it enables you to at least iterate on components, so I'd view it as an improvement. |
I’m curious whether the approach from reduxjs/redux#1455 might help here. Namely, just nuke your components and mount new versions of them without React Transform altogether. |
Thanks again for raising this.
I don’t plan to personally work on this in near term but I don’t see why it couldn’t be made to work given some effort.
I’m rather confused. Babel plugin should find the inner component and force its re-rendering on changes regardless of whether it is wrapped in a Relay container or anything else. Is this not the case? Would you like to investigate why? |
Hello
It would be great if the hot-middleware could update a component when its Relay GraphQL Query changes. At the moment it is not aware of it and forces the developer to manually do a full page reload which destroys his current application state.
In this example
We should be able to make a change to the Query and the hot-middleware should update the component.
Hope it will be easy for you to add this feature - it would improve React development hugely.
Thank you
The text was updated successfully, but these errors were encountered: