4 ms·
Really good summary of some of the problems. There is a deeper issue which is that unless your developers understand React best practices really, really well Re
by mamp 10y ago
Really good summary of some of the problems. There is a deeper issue which is that unless your developers understand React best practices really, really well Relay provides opportunities to screw up in a pretty big way. It goes against the 'developer experience' priorities that React was designed around. It's hard to understand and promotes some bad practices for complex applications e.g. binding domain concerns to each component rather than encouraging presentation components. Relay's constraints mean it's hard to control the way the application updates and responds to users. I'm not saying it can't be done but it requires way too much detailed knowledge of the quirks. From an agile perspective it also couples the front end and back end development too tightly.
We have since moved to Redux and are going to back out Relay from the application we used it in. With all of Redux's issues (ceremony, boilerplate, etc) it provides a standard model for us to reason about, and a decoupling of data retrieval from presentation.
- tiglionabbit 10y ago> binding domain concerns to each component rather than encouraging presentation components. Quite the opposite. Relay allows you to write proper presentation components and then wrap them in data-provider components. This is a step toward isolation of presentation and data management. If you could move all methods that actually manipulate the data up out of the presentation components and into their wrappers, that's even better. Unfortunately, the parent component has to reference the wrapper instead of the wrapped component, so you get this alternation between presentation and data management. But at least the leaf nodes can be considered reusable presentation components with no coupling to the data layer. Anyway, everyone is doing this these days. Check out: * https://github.com/mobxjs/mobx https://github.com/mobxjs/mobx * https://github.com/ekosz/atreyu https://github.com/ekosz/atreyu