-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Keep reference equality when possible in update() #4968
Conversation
I'm getting linting errors in a bunch of test files I haven't touched - is master failing these? |
Would this change be better against 0.13-stable? |
If you rebase, the lint errors should be fixed. |
For $set and $apply it is cheap and easy to check whether the new value will be identical (===) to the old value and create a new object only when this is not the case. This will reduce excessive renders when using the pureRenderMixin. The same should be possible for for merge, but is more complicated so is not attempted here.
Thanks @spicyj, I think that fixed it. |
FYI, this tool is deprecated in favor of immutable-js. I'm don't think we'll keep maintaining this repo. We can take this after we've cut our branch. However, if you want to keep using this tool I suggest you fork it and release your own npm package. |
Might as well, can look at forking it next week. |
@sebmarkbage Are we ready to merge this, or do we just want to deprecate it and let @davidmason take the code from here? |
Hi, was wondering if I could help here. |
Ping @sebmarkbage. Are we ready to merge this, or do we just want to deprecate it and let @davidmason take the code from here? |
@jimfb Feel free to merge this if it looks good to you. |
@davidmason updated the pull request. |
Thanks for contributing, @davidmason! I merged your PR locally but then tried to refactor it to avoid function allocations and the need to call I submitted it in #6353 and kept all your commits attributed to you. I am keeping this PR open so when/if #6353 gets merged, this PR should appear merged as well (if I understand GitHub correctly 😅 ). Please check out #6353 and leave a note if I missed something. And thanks for getting this ball rolling! |
Cool, thanks for keeping this going :) |
@davidmason updated the pull request. |
I’m going to close this for the same reasons as #6353 (comment). |
@davidmason updated the pull request. |
For $set and $apply it is cheap and easy to check whether the new value will
be identical (===) to the old value and create a new object only when this is not
the case. This will reduce excessive renders when using the pureRenderMixin.
The same should be possible for for merge, but is more complicated so is not
attempted here.
Addresses #1923