Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: Only hold on to props that are fragment references (and not prop…
…s from product) Summary: The purpose of this commit is to mitigate the impact of memory leaks produced by RelayModernFragmentSpecResolver when running in React Concurrent Mode. Specifically, with the fragment spec resolver, we subscribe to the Relay store when a resolver is constructed, which occurs during render. Since in Concurrent Mode render can occur many times without ever committing, this leaves open the possibility of dangling resolvers with subscriptions that never get cleaned up. This commit doesn't fix that specific issue, but makes it so we hold on to a lot less memory by not holding on to props passed to product code that aren't fragment references. Often times these props can reference parts of the React tree, causing us to hold on to a lot of memory that won't get cleaned up. Note that the preferred way of running Relay in concurrent mode is to use Relay Hooks, which are concurrent safe. Reviewed By: bgirard, steveluscher Differential Revision: D18975901 fbshipit-source-id: bbb35bb1796509ce2ac3fce95b1bb3a87f35bff7
- Loading branch information