Skip to content

Commit 21f7b89

Browse files
committed
Update comparison.md
1 parent 1427b1e commit 21f7b89

File tree

1 file changed

+49
-46
lines changed

1 file changed

+49
-46
lines changed

docs/src/pages/comparison.md

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,53 @@ Feature/Capability Key:
1212
- 🔶 Supported and documented, but requires extra user-code to implement
1313
- 🛑 Not officially supported or documented.
1414

15-
| | React Query | SWR [_(Website)_][swr] | Apollo Client [_(Website)_][apollo] | RTK-Query [_(Website)_][rtk-query] |
16-
| -------------------------------------------------- | ---------------------------------------- | -------------------------- | ------------------------------------- | ------------------------------------ |
17-
| Github Repo / Stars | [![][stars-react-query]][gh-react-query] | [![][stars-swr]][gh-swr] | [![][stars-apollo]][gh-apollo] | [![][stars-rtk-query]][gh-rtk-query] |
18-
| Platform Requirements | React | React | React, GraphQL | Redux |
19-
| Their Comparison | | (none) | (none) | [Comparison][rtk-query-comparison] |
20-
| Supported Query Syntax | Promise, REST, GraphQL | Promise, REST, GraphQL | GraphQL | Promise, REST, GraphQL |
21-
| Supported Frameworks | React | React | React + Others | Any |
22-
| Supported Query Keys | JSON | JSON | GraphQL Query | JSON |
23-
| Query Key Change Detection | Deep Compare (Stable Serialization) | Referential Equality (===) | Deep Compare (Unstable Serialization) | Referential Equality (===) |
24-
| Query Data Memoization Level | Query + Structural Sharing | Query | Query + Entity + Structural Sharing | Query |
25-
| Bundle Size | [![][bp-react-query]][bpl-react-query] | [![][bp-swr]][bpl-swr] | [![][bp-apollo]][bpl-apollo] | [![][bp-rtk-query]][bpl-rtk-query] |
26-
| API Definition | On-Use, Declarative | On-Use | GraphQL Schema | Declarative |
27-
| Queries |||||
28-
| Caching |||||
29-
| Devtools || 🟡 |||
30-
| Polling/Intervals |||||
31-
| Parallel Queries |||||
32-
| Dependent Queries |||||
33-
| Paginated Queries |||||
34-
| Infinite Queries |||| 🛑 |
35-
| Bi-directional Infinite Queries || 🔶 | 🔶 | 🛑 |
36-
| Infinite Query Refetching ||| 🛑 | 🛑 |
37-
| Lagged Query Data<sup>1</sup> || 🛑 | 🛑 ||
38-
| Selectors || 🛑 |||
39-
| Initial Data |||||
40-
| Scroll Recovery |||||
41-
| Cache Manipulation |||||
42-
| Outdated Query Dismissal |||||
43-
| Render Optimization<sup>2</sup> || 🛑 | 🛑 ||
44-
| Auto Garbage Collection || 🛑 | 🛑 ||
45-
| Mutation Hooks || 🟡 |||
46-
| Offline Mutation Support || 🛑 | 🟡 | 🛑 |
47-
| Prefetching APIs || 🔶 |||
48-
| Query Cancellation || 🛑 | 🛑 | 🛑 |
49-
| Partial Query Matching<sup>3</sup> || 🛑 | 🛑 ||
50-
| Stale While Revalidate |||||
51-
| Stale Time Configuration || 🛑 | 🛑 ||
52-
| Pre-usage Query/Mutation Configuration<sup>4</sup> || 🛑 | 🛑 ||
53-
| Window Focus Refetching ||| 🛑 | 🔶 |
54-
| Network Status Refetching |||| 🔶 |
55-
| General Cache Dehydration/Rehydration || 🛑 |||
56-
| Offline Caching | ✅ (Experimental) | 🛑 || 🔶 |
57-
| React Suspense (Experimental) ||| 🛑 | 🛑 |
58-
| Abstracted/Agnostic Core || 🛑 |||
59-
| Automatic Refetch after Mutation<sup>5</sup> | 🔶 | 🔶 |||
60-
| Normalized Caching<sup>6</sup> | 🛑 | 🛑 || 🛑 |
15+
| | React Query | SWR [_(Website)_][swr] | Apollo Client [_(Website)_][apollo] | RTK-Query [_(Website)_][rtk-query] |
16+
| -------------------------------------------------- | ---------------------------------------- | --------------------------- | ------------------------------------- | ------------------------------------ |
17+
| Github Repo / Stars | [![][stars-react-query]][gh-react-query] | [![][stars-swr]][gh-swr] | [![][stars-apollo]][gh-apollo] | [![][stars-rtk-query]][gh-rtk-query] |
18+
| Platform Requirements | React | React | React, GraphQL | Redux |
19+
| Their Comparison | | (none) | (none) | [Comparison][rtk-query-comparison] |
20+
| Supported Query Syntax | Promise, REST, GraphQL | Promise, REST, GraphQL | GraphQL | Promise, REST, GraphQL |
21+
| Supported Frameworks | React | React | React + Others | Any |
22+
| Supported Query Keys | JSON | JSON | GraphQL Query | JSON |
23+
| Query Key Change Detection | Deep Compare (Stable Serialization) | Shallow Compare | Deep Compare (Unstable Serialization) | Referential Equality (===) |
24+
| Query Data Change Detection | Deep Comparison + Structural Sharing | Deep Compare (via `dequal`) | Deep Compare (Unstable Serialization) | Referential Equality (===) |
25+
| Query Data Memoization Level | Query + Structural Sharing | Query | Query + Entity + Structural Sharing | Query |
26+
| Bundle Size | [![][bp-react-query]][bpl-react-query] | [![][bp-swr]][bpl-swr] | [![][bp-apollo]][bpl-apollo] | [![][bp-rtk-query]][bpl-rtk-query] |
27+
| API Definition | On-Use, Declarative | On-Use | GraphQL Schema | Declarative |
28+
| Queries |||||
29+
| Caching |||||
30+
| Devtools || 🟡 |||
31+
| Polling/Intervals |||||
32+
| Parallel Queries |||||
33+
| Dependent Queries |||||
34+
| Paginated Queries |||||
35+
| Infinite Queries |||| 🛑 |
36+
| Bi-directional Infinite Queries || 🔶 | 🔶 | 🛑 |
37+
| Infinite Query Refetching ||| 🛑 | 🛑 |
38+
| Lagged Query Data<sup>1</sup> || 🔶 | 🛑 ||
39+
| Selectors || 🛑 |||
40+
| Initial Data |||||
41+
| Scroll Recovery |||||
42+
| Cache Manipulation |||||
43+
| Outdated Query Dismissal |||||
44+
| Render Batching & Optimization<sup>2</sup> || 🛑 | 🛑 ||
45+
| Auto Garbage Collection || 🛑 | 🛑 ||
46+
| Mutation Hooks || 🟡 |||
47+
| Offline Mutation Support || 🛑 | 🟡 | 🛑 |
48+
| Prefetching APIs || 🔶 |||
49+
| Query Cancellation || 🛑 | 🛑 | 🛑 |
50+
| Partial Query Matching<sup>3</sup> || 🛑 | 🛑 ||
51+
| Stale While Revalidate |||||
52+
| Stale Time Configuration<sup>7</sup> || 🛑 | 🛑 ||
53+
| Pre-usage Query/Mutation Configuration<sup>4</sup> || 🛑 | 🛑 ||
54+
| Window Focus Refetching ||| 🛑 | 🔶 |
55+
| Network Status Refetching |||| 🔶 |
56+
| General Cache Dehydration/Rehydration || 🛑 |||
57+
| Offline Caching | ✅ (Experimental) | 🛑 || 🔶 |
58+
| React Suspense (Experimental) ||| 🛑 | 🛑 |
59+
| Abstracted/Agnostic Core || 🛑 |||
60+
| Automatic Refetch after Mutation<sup>5</sup> | 🔶 | 🔶 |||
61+
| Normalized Caching<sup>6</sup> | 🛑 | 🛑 || 🛑 |
6162

6263
### Notes
6364

@@ -73,6 +74,8 @@ Feature/Capability Key:
7374
7475
> **<sup>6</sup> Normalized Caching** - React Query, SWR and RTK-Query do not currently support automatic-normalized caching which describes storing entities in a flat architecture to avoid some high-level data duplication.
7576
77+
> **<sup>6</sup> SWR's Immutable Mode** - SWR ships with an "immutable" mode that does allow you to only fetch a query once for the life of the cache, but it still does not have the concept of stale-time or conditional auto-revalidation
78+
7679
<!-- -->
7780

7881
[bpl-react-query]: https://bundlephobia.com/result?p=react-query

0 commit comments

Comments
 (0)