Skip to content

Releases: vercel/swr

1.0.0-beta.10

13 Aug 16:21
9fbe2ac
Compare
Choose a tag to compare
1.0.0-beta.10 Pre-release
Pre-release

Major Changes

  • BREAKING: Deprecate revalidate with mutate: #1332

Minor Changes

  • Improvement: ensure useSWRInfinite reuses useSWR cache: #1341

Patches

  • Code refactoring: #1307
  • Add package.json to module exports: #1313
  • Fix config being ignored when fetcher is null: #1311
  • Reset cache between tests: #1309
  • Refine the infinite hook: #1315
  • Test: add a test for getInfiniteKey with current data: #1319
  • Update bunchee 1.6.2: #1323
  • Chore: update useSWRInfinite import: #1326
  • Upgrade bunchee, reduce node_modules size: #1329
  • Build(deps): bump path-parse from 1.0.6 to 1.0.7: #1334

Credits

Huge thanks to @huozhi, @heysailor, @koba04, and @eric-hc for helping!

1.0.0-beta.9

27 Jul 12:34
7a05169
Compare
Choose a tag to compare
1.0.0-beta.9 Pre-release
Pre-release

Major Changes

  • Move infinite types to swr/infinite and deprecate old ones: #1272
  • Drop legacy types: #1276
  • Breaking: drop the default fetcher: #1304

Minor Changes

  • Feat: add getInfiniteKey to mutate the cache for useSWRInfinite: #1257
  • Rename isDocumentVisible to isVisible: #1308

Patches

  • Fix types generate: #1266
  • Add test case that covers #1286: #1297
  • Enhance: simplify deno detection: #1299
  • Refine createCache: #1283
  • Fix useSWRInfinite doesn't revalidate the first page: #1301
  • Code structure refactoring: #1303

Credits

Huge thanks to @huozhi and @koba04 for helping!

1.0.0-beta.8

06 Jul 09:09
a019c4f
Compare
Choose a tag to compare
1.0.0-beta.8 Pre-release
Pre-release

Major Changes

  • Sub-packages and immutable hook: #992

Patches

  • Add condition to check if window.addEventListener exists for React Native compatibility: #1234
  • Chore: bump typescript to use ts-expect-error instead of ts-ignore: #1239
  • Enhance: add $ prefix for non-major keys: #1174
  • Fix: fail accessing navigator on Node: #1254
  • Chore: fix to run the build script multiple times: #1255
  • Test: run concurrent rendering tests with React v18 alpha: #1259
  • Fix: ignore .d.ts in dist/ for ESLint: #1258
  • Enhance: use ts for testing: #1260
  • Chore: add watch scripts for sub packages to build them: #1261
  • Fix typo in use-swr: #1267
  • Chore: fix type SWRHookWithdMiddleware to SWRHookWithMiddleware: #1268

Credits

Huge thanks to @javascripter, @koba04, @huozhi, and @pa-rang for helping!

1.0.0-beta.7

22 Jun 21:56
8d109b8
Compare
Choose a tag to compare
1.0.0-beta.7 Pre-release
Pre-release

Minor Changes

  • Adopt bunchee as bundler: #1025
  • Custom cache provider: #1017
  • Middleware: #1160

Patches

  • Test: refactor use-swr-loading.test.tsx: #1057
  • Test: refactor use-swr-local-mutation.test.tsx: #1059
  • Fix #1056: #1058
  • Test: refactor use-swr-offline.test.tsx: #1063
  • Allow setting the generic on mutate(): #1069
  • Read cache during render: #794
  • Code refactoring: #1077
  • Add --no-sourcemap: #1079
  • Fix mutate: #1075
  • Revert #1024: #1085
  • Fix: race problem when in dedupingInterval: #1088
  • Bug fixes: #1096
  • Test: refactor use-swr-refresh.test.tsx: #1103
  • Docs: optimistic UI examples comments more clearer: #1102
  • Fix setting null cache in useSWRInfinite: #1110
  • Test: refactor use-swr-revalidate.test.tsx: #1111
  • Test: refactor use-swr-suspense.test.tsx: #1113
  • Build: upragde bundler: #1121
  • Replace deprecated types with latest types in axios-typescript example: #1128
  • Add saveData to slowConnection: #1130
  • Clean code: #1145
  • Update bound mutate readme: #1127
  • Code optimizations: #1150
  • Enhance: support exports field: #1154
  • Fix global mutate generic: #1159
  • Build(deps): bump hosted-git-info from 2.8.5 to 2.8.9: #1164
  • Enhance: upgrade ts lint config: #1169
  • Build(deps): bump browserslist from 4.16.3 to 4.16.6: #1181
  • Fix: autocomplete suggestions example: #1183
  • Build(deps): bump ws from 7.4.2 to 7.4.6: #1184
  • Update README.md: #1203
  • Fix typo in placeholder: #1206
  • Update package.json: #1205
  • Build(deps): bump acorn from 6.3.0 to 6.4.2: #1210
  • Build(deps): bump y18n from 4.0.0 to 4.0.3: #1209
  • Build(deps): bump lodash from 4.17.19 to 4.17.21: #1208
  • Build(deps): bump glob-parent from 5.1.0 to 5.1.2: #1207
  • Add codeowner @huozhi: #1221

Credits

Huge thanks to @huozhi, @koba04, @promer94, @nstepien, @MoonBall, @mkrtchian, @eunsukimme, @Tak-Iwamoto, @meeoh, and @teinett for helping!

0.5.6

03 May 16:56
19d620d
Compare
Choose a tag to compare

Patches

Credits

Huge thanks to @promer94 for helping!

0.5.4

19 Mar 19:19
fa676db
Compare
Choose a tag to compare

Patches

  • Refactor: fix a react-hooks/exhaustive-deps warning: #1035
  • Test: refactor use-swr-focus.test.tsx: #1036
  • Test: refactor use-swr-infinite.test.tsx: #1039
  • Export default SWR config to allow more flexible extensions: #1023
  • Test: refactor use-swr-integration.test.tsx: #1049
  • Fix: invalid invocation on raf: #1051
  • Types: expose KeyLoader: #1054
  • Test: refactor use-swr-key.test.tsx: #1055

Credits

Huge thanks to @koba04, @jakubriedl, and @huozhi for helping!

0.5.3

13 Mar 16:01
766718a
Compare
Choose a tag to compare

Patches

  • Fix dequal vendor: #1027
  • Test: refactor tests for configs: #1006
  • Test: refactor use-swr-error.test.tsx: #1031
  • Micro optimizations: #1018
  • Fix: support multiple useSWRInfinite hooks in a page: #1009

Credits

Huge thanks to @promer94 and @koba04 for helping!

0.5.1

10 Mar 15:49
c6cfdcf
Compare
Choose a tag to compare

Patches

  • Fix: revalidate with initialData when changing the key: #961
  • Update CODEOWNERS: dd1bcf9
  • Allow passing undefined config: #1022
  • Make swr zero dependency: #1024

Credits

Huge thanks to @koba04 and @huozhi for helping!

0.5.0

09 Mar 10:31
43b2920
Compare
Choose a tag to compare

Minor Changes

  • Types: makes types fn and config and getKey more strictly: #946
  • Fix: do not cache when mutate throws an error synchronously: #977
  • Perf: avoid unnecessary re-renders with the suspense mode: #979
  • Fix: do not depend on navigator.onLine; code optimizations: #1004
  • Fix: sync mutations are applied independently: #1003
  • Fix: sync cache only on compare returns true: #907
  • Optimize isValidating status: #967
  • Clean up types: #1016
  • Enable typescript strict mode: #1010

Patches

  • Update README.md: #974
  • Refactor: move DOM event handlers into web-preset: #972
  • Add-infinite-scroll-example: #970
  • Refactor: add the register prefix to onFocus and onReconnect: #993
  • Add example using useSWRInfinite: #968
  • Test: refactor use-swr-cache.test.tsx: #932
  • Using vite2 and add playground to master: #995
  • Test: refactor use-swr-config-callbacks.test.tsx: #933
  • Keep old esm directory structure: #1011

Credits

Huge thanks to @koba04, @huozhi, @Kexin-Li, @promer94, @dingran, and @ramyareye for helping!

0.4.2

08 Feb 13:55
5e82bb6
Compare
Choose a tag to compare

Patches

  • Chore: add comments that revalidate will be deprecated: #937
  • Remove legacy useSWRPages types: #938
  • Test: fix flaky tests for focus and location mutation: #944
  • Refactor: rename from waitForDedupingInterval to waitForNextTick: #960
  • Fix: checking if document is defined: #963

Credits

Huge thanks to @koba04 for helping!