3 ms·
I mostly agree with you. Unfortunately, many React apps use Relay (another Meta product) and it opens up a world of “magic” that is sometimes a real pain to re
by softfalcon 3y ago
I mostly agree with you.
Unfortunately, many React apps use Relay (another Meta product) and it opens up a world of “magic” that is sometimes a real pain to reason about.
- satvikpendem 3y agoWhat do you mean by "many?" While I like Relay, I've almost never seen Relay used in the wild. It's sad as it's quite an elegant concept; just as you define your props for your React component, you define your "props" coming from the server as well, through the GraphQL notation. I've been looking at ways to combine both concepts so that there is no client- or server-side state at all, it's all just state, from a cache that determines whether to refetch from the server or to keep the state local.
- softfalcon 3y agoMaybe it's isolated to me and my work here on this repo: https://github.com/coralproject/talk https://github.com/coralproject/talk I agree that Relay CAN be simple, but it isn't for what we do. Have a look at this ReplyListContainer and its nested Relay logic. I didn't originally write this, but I can see what they were trying to do and how Relay made it difficult for them. Your thoughts are welcome, I won't judge you for being critical of our code and welcome any other Relay dev's opinions. https://github.com/coralproject/talk/blob/develop/client/src/core/client/stream/tabs/Comments/ReplyList/ReplyListContainer.tsx https://github.com/coralproject/talk/blob/develop/client/src...
- kabes 3y agoRelay tries to solve the problem of: let a component define its (server) data dependencies. It indeed does this with more magic. But it's not exactly the same problem and you can't really fault react for it. It's also a problem other frameworks don't try to solve.