@khanacademy/wonder-blocks-data 2.3.4 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/es/index.js +368 -429
  3. package/dist/index.js +457 -460
  4. package/docs.md +19 -13
  5. package/package.json +3 -3
  6. package/src/__tests__/__snapshots__/generated-snapshot.test.js.snap +40 -160
  7. package/src/__tests__/generated-snapshot.test.js +15 -195
  8. package/src/components/__tests__/data.test.js +159 -965
  9. package/src/components/__tests__/gql-router.test.js +64 -0
  10. package/src/components/__tests__/intercept-data.test.js +9 -66
  11. package/src/components/__tests__/track-data.test.js +6 -5
  12. package/src/components/data.js +9 -117
  13. package/src/components/data.md +38 -60
  14. package/src/components/gql-router.js +66 -0
  15. package/src/components/intercept-data.js +2 -34
  16. package/src/components/intercept-data.md +7 -105
  17. package/src/hooks/__tests__/use-data.test.js +826 -0
  18. package/src/hooks/__tests__/use-gql.test.js +233 -0
  19. package/src/hooks/use-data.js +143 -0
  20. package/src/hooks/use-gql.js +77 -0
  21. package/src/index.js +13 -9
  22. package/src/util/__tests__/get-gql-data-from-response.test.js +187 -0
  23. package/src/util/__tests__/memory-cache.test.js +134 -35
  24. package/src/util/__tests__/request-fulfillment.test.js +21 -36
  25. package/src/util/__tests__/request-handler.test.js +30 -30
  26. package/src/util/__tests__/request-tracking.test.js +29 -30
  27. package/src/util/__tests__/response-cache.test.js +521 -561
  28. package/src/util/__tests__/result-from-cache-entry.test.js +68 -0
  29. package/src/util/get-gql-data-from-response.js +69 -0
  30. package/src/util/gql-error.js +36 -0
  31. package/src/util/gql-router-context.js +6 -0
  32. package/src/util/gql-types.js +65 -0
  33. package/src/util/memory-cache.js +18 -14
  34. package/src/util/request-fulfillment.js +4 -0
  35. package/src/util/request-handler.js +2 -27
  36. package/src/util/request-handler.md +0 -32
  37. package/src/util/response-cache.js +50 -110
  38. package/src/util/result-from-cache-entry.js +38 -0
  39. package/src/util/types.js +14 -35
  40. package/LICENSE +0 -21
  41. package/src/components/__tests__/intercept-cache.test.js +0 -124
  42. package/src/components/__tests__/internal-data.test.js +0 -1030
  43. package/src/components/intercept-cache.js +0 -79
  44. package/src/components/intercept-cache.md +0 -103
  45. package/src/components/internal-data.js +0 -219
  46. package/src/util/__tests__/no-cache.test.js +0 -112
  47. package/src/util/no-cache.js +0 -67
  48. package/src/util/no-cache.md +0 -66
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # @khanacademy/wonder-blocks-data
2
+
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4ff59815: Add GraphQL fetch mock support to wonder-blocks-testing
8
+
9
+ ## 3.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b68cedfe: Add GqlRouter component
14
+ - c7233a97: Implement useGql hook
15
+
16
+ ## 3.0.1
17
+
18
+ ### Patch Changes
19
+
20
+ - d281dac8: Ensure server-side request fulfillments can be intercepted
21
+
22
+ ## 3.0.0
23
+
24
+ ### Major Changes
25
+
26
+ - b252d9c8: Remove client-side caching
27
+ - b252d9c8: Introduce useData hook