You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: Add support for ES.next Set, Map, ArrayBuffer (#51)
- Update library to include ES.next support for `Map`, `Set`, `ArrayBuffer`. Part of #36
- Update to `fast-deep-equal@3.1.1` 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.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ This package is a fork of [fast-deep-equal](https://github.com/epoberezkin/fast-
10
10
We encourage pull requests concerning:
11
11
12
12
* React features not handled in this library
13
-
* Integrating updates from fast-deep-equal
14
-
* Integrating tests from fast-deep-equal
13
+
* Integrating updates from `fast-deep-equal`. This unfortunately, now requires more manual work to use the comment blocks in `index.js` to figure out what to paste and where.
14
+
* Integrating tests from `fast-deep-equal`. This usually entails upgrading the `git`-based dependencies of `fast-deep-equal-git` and `npm`-published package of `fast-deep-equal` in `package.json:devDependencies`.
15
15
* Bugs in this library
16
16
* New tests for React
17
17
* Documentation
@@ -65,7 +65,7 @@ $ yarn run test-node --watch
65
65
66
66
The same tests are then imported and built with `webpack` to a test bundle that
67
67
can be run in arbitrary browsers. So far in CI, we execute the tests in headless
68
-
Chrome on Linux in Travis and IE9-emulated IE11 in Appveyor.
68
+
Chrome on Linux in Travis and IE11 in Appveyor.
69
69
70
70
To run the browser tests on your machine (note: you must already have the
71
71
browser you're running installed):
@@ -76,7 +76,7 @@ $ yarn run test-browser
76
76
# Example: real Chrome + Firefox + Safari
77
77
$ yarn run test-browser --browsers Chrome,Firefox,Safari
78
78
79
-
#IE9 emulation (on Windows)
79
+
#IE11 (on Windows)
80
80
$ yarn run test-browser-ie
81
81
```
82
82
@@ -94,6 +94,21 @@ $ yarn run test-ts
94
94
$ yarn run eslint
95
95
```
96
96
97
+
### Size
98
+
99
+
You can check how we do with minification + compression with:
100
+
101
+
```sh
102
+
# Show minified output
103
+
$ yarn -s compress
104
+
105
+
# Display minified + gzip'ed size in bytes.
106
+
$ yarn size-min-gz
107
+
687
108
+
```
109
+
110
+
**Note**: If the min+gz size increases, please note it in the README. If it is a significant increase, please flag to your reviewers and have a discussion about whether or not the size addition is justified.
111
+
97
112
## Before submitting a PR...
98
113
99
114
Before you go ahead and submit a PR, make sure that you have done the following:
@@ -103,9 +118,9 @@ $ yarn run test
103
118
$ yarn run benchmark
104
119
```
105
120
106
-
Everything must be correct / pass checks. You should also check the benchmark
107
-
stats and make sure that we don't have any significant performance regressions
108
-
(check out `master`for a baseline comparison on _your_ machine).
121
+
1.Everything must be correct / pass checks.
122
+
2. You should also check the benchmark stats and make sure that we don't have any significant performance regressions (check out `master` for a baseline comparison on _your_ machine).
123
+
- Please **do** update the README benchmark numbers for changes in your PR so that we have much easier discussion points _and_ our users get up-to-date information.
* deeply compares any value (besides objects with circular references)
33
33
* handles React-specific circular references, like elements
34
34
* checks equality Date and RegExp objects
35
-
* should be just as fast as [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal)for general use, and faster for React use
36
-
* small: under 600 bytes minified+gzipped
35
+
* should as fast as [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal)via a single unified library, and with added guardrails for circular references.
36
+
* small: under 700 bytes minified+gzipped
37
37
38
38
## Usage
39
39
@@ -86,11 +86,11 @@ simply because there are more tests in each operation.
86
86
### Generic Data
87
87
88
88
```
89
-
react-fast-compare x 207,503 ops/sec ±0.54% (92 runs sampled)
90
-
fast-deep-equal x 195,006 ops/sec ±0.70% (91 runs sampled)
91
-
lodash.isEqual x 43,778 ops/sec ±0.55% (91 runs sampled)
92
-
nano-equal x 198,036 ops/sec ±0.37% (95 runs sampled)
93
-
shallow-equal-fuzzy x 173,023 ops/sec ±0.59% (95 runs sampled)
89
+
react-fast-compare x 157,863 ops/sec ±0.54% (94 runs sampled)
90
+
fast-deep-equal x 149,877 ops/sec ±0.76% (93 runs sampled)
91
+
lodash.isEqual x 33,298 ops/sec ±0.70% (93 runs sampled)
92
+
nano-equal x 144,836 ops/sec ±0.51% (94 runs sampled)
93
+
shallow-equal-fuzzy x 110,192 ops/sec ±0.57% (95 runs sampled)
94
94
fastest: react-fast-compare
95
95
```
96
96
@@ -101,16 +101,14 @@ tests; any difference is just noise. `react-fast-compare` won't be faster than
101
101
### React and Generic Data
102
102
103
103
```
104
-
react-fast-compare x 187,628 ops/sec ±0.58% (93 runs sampled)
105
-
fast-deep-equal x 477 ops/sec ±0.55% (91 runs sampled)
106
-
lodash.isEqual x 35,100 ops/sec ±0.16% (95 runs sampled)
107
-
nano-equal x 468 ops/sec ±0.53% (94 runs sampled)
108
-
shallow-equal-fuzzy x 684 ops/sec ±0.43% (92 runs sampled)
109
-
fastest: react-fast-compare
104
+
react-fast-compare x 64,102 ops/sec ±0.36% (94 runs sampled)
105
+
fast-deep-equal x 63,844 ops/sec ±0.43% (94 runs sampled)
106
+
lodash.isEqual x 6,243 ops/sec ±0.72% (90 runs sampled)
107
+
fastest: react-fast-compare,fast-deep-equal
110
108
```
111
109
112
-
Three of these packages cannot handle comparing React elements (which are
113
-
circular): `fast-deep-equal`, `nano-equal`, and `shallow-equal-fuzzy`.
110
+
Two of these packages cannot handle comparing React elements (which are
111
+
circular): `nano-equal` and `shallow-equal-fuzzy`.
114
112
115
113
### Running Benchmarks
116
114
@@ -121,7 +119,12 @@ $ yarn run benchmark
121
119
122
120
## fast-deep-equal Versioning
123
121
124
-
react-fast-compare@2 tracks fast-deep-equal@2.0.1
122
+
react-fast-compare@3 tracks fast-deep-equal@3.1.1
123
+
124
+
Now that `fast-deep-equal` has separate es5, es6, and es6 + React entry points, the main differences with this library are:
125
+
126
+
*`try/catch` guardrails for stack overflows from undetected circular references.
127
+
* A single unified entry point for **all** uses. No matter what your target application is, `import equal fro 'react-fast-compare'` just works.
125
128
126
129
## License
127
130
@@ -133,7 +136,7 @@ Please see our [contributions guide](./CONTRIBUTING.md).
133
136
134
137
## Maintenance Status
135
138
136
-
**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
139
+
**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
0 commit comments