-
Notifications
You must be signed in to change notification settings - Fork 56
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
Bug: Set compares by reference not value #50
Comments
- Update library to include ES.next support for `Map`, `Set`, `ArrayBuffer`. Part of #36 - Update to `[email protected]` with modified support for ES.next data types. - Upgrade lots of `devDependenices` - Use `fast-deep-equal` tests directly in our correctness tests. - Update CI to modern Node.js versions. - **Note**: There's a bug / limitation of `Set` comparisons whereby objects are compared by reference not value. Tracked at #50 . In our `yarn benchmark`, `lodash.isEqual` gets test differences because it correctly handles those.
Now tracked upstream with a potential bugfix: epoberezkin/fast-deep-equal#50 |
Looking at the solution comment on the related issue linked by @ryan-roemer above ^, it appears we can solve this issue by requiring Is this something we would be willing to change? It seems like there are going to be larger implications updating this dependency, but I don't know that I can immediately identify what they'll be. cc @chrisbolin |
good catch, @kale-stew! I say we don't take it on yet, but that's a path we could go down |
@chrisbolin @kale-stew -- Upstream FDE AFAICT incorrectly closed the issue. Their current |
And as our general note our source already tracks |
Do we have to way for |
## Summary: This PR applies the patch from FormidableLabs#50 to fix an issue with nested Sets not being handled correctly. Issue: XXX-XXXX ## Test plan: - yarn - yarn test Author: kevinbarabash Reviewers: jeresig Required Reviewers: Approved By: jeresig Checks: Pull Request URL: #1
Upstream
fast-deep-equal
can't handleequal(new Set(["1", {}]), new Set(["1", {}]))
because it compares by referencesetA.has(setBElement)
.Note that when running the correctness tests during
yarn benchmark
we get differences withlodash.isEqual
which is correct:Here's a WIP diff against https://github.com/FormidableLabs/react-fast-compare/tree/experiment/es6 branch that could fix that:
Could look to open either upstream or in our project.
The text was updated successfully, but these errors were encountered: