Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve memoize problems in withColors #6736

Merged
merged 1 commit into from
May 14, 2018

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented May 14, 2018

The current implementation contains a memory leak (direct usage of [] in get). Besides that, we were keeping references to old setAttributes of a component even when the component was removed. Props to @aduth for noticing these problems.
Lodash memoize has also replaced with memize.

This solution is complex and it seems the best long-term solution is changing the API. I have plans to change it and simplify its logic, but even changing it, we will support this version for 2 versions (before we can deprecate it) so I feel like we should solve the current problems the code contains even if the current solution is not the final one.

Another option is just reverting #6686 but that would bring back the rerender problem.

The current implementation. contained a memory leak (in the direct usage of [] in get). Besides that we were keeping references to setAttributes of a component even when the component was removed.
Lodash memoize has also replaced with memize.
@jorgefilipecosta jorgefilipecosta self-assigned this May 14, 2018
@jorgefilipecosta jorgefilipecosta changed the title Solve memoize problems withColors. Solve memoize problems in withColors May 14, 2018
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jorgefilipecosta jorgefilipecosta merged commit be88c3c into master May 14, 2018
@jorgefilipecosta jorgefilipecosta deleted the fix/solved-memoize-problems-with-colors branch May 14, 2018 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants