-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement isEqual without pulling in massive lodash.isequal.
Follow-up to #4915. I have kept the tests from that PR, just not the lodash-based implementation of isEqual. The lodash.isequal package has a ton of extra features we don't need, and weighs in at a whopping 10KB minified (3.8KB after gzip). Very little of that machinery is really necessary to fix #4824. I extracted this functionality into a separate npm package called @wry/equality, so that we have the flexibility to depend on the same logic in other packages without importing apollo-utilities.
- Loading branch information
Showing
4 changed files
with
17 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
import isEqualLodash from 'lodash.isequal'; | ||
|
||
/** | ||
* Performs a deep equality check on two JavaScript values. | ||
*/ | ||
export function isEqual(a: any, b: any): boolean { | ||
return isEqualLodash(a, b); | ||
} | ||
export { equal as isEqual } from '@wry/equality'; |