blaze-react
blaze-react copied to clipboard
Correctly retain callbacks for event handlers
Currently, we create event handler callbacks using the AlwaysRetain
flag, which is a memory leak. Ideally, we'd change ReactJS such that it exposes the list of live callbacks to us. Then, we could register them with the GHCJS GC and create the callbacks with a NoRetain
flag.
@meiersi Do you have a plan in place to implement this? If this will require coordination with the React devs, I'd love to get that ball rolling - I'd like to use this library for some work soon :).
Hi @cstrahan, I was planning to first just fork ReactJS and see how I can expose their eventhandler references to an outside component. It shouldn't be too difficult, as they already use a central map to map react-id's back to event-handler closures. Once this works, I'd package up the work as a pull request to make sure the solution doesn't bitrot. However, I don't have concrete plans for when to work on this; i.e., if you need it soon, then you'll probably have to take a stab at it by yourself.