Releases: pmndrs/zustand
v5.0.5
It comes with some small improvements.
What's Changed
- feat(vanilla): update shallow compare function and tests by @dbritto-dev in #3108
- feat: add devtools.cleanup() method by @maxam2017 in #3111
- refactor: remove unnecessary type assertion in createJSONStorage by @2yunseong in #3113
- feat(devtool): inferred action type by @alimertcakar in #2987
New Contributors
- @Josh68 made their first contribution in #3106
- @wingedotter5 made their first contribution in #3115
- @maxam2017 made their first contribution in #3111
- @2yunseong made their first contribution in #3113
Full Changelog: v5.0.4...v5.0.5
4.5.7
See: #3087 (comment)
Full Changelog: v4.5.6...4.5.7
v5.0.4
This fixes module resolution issue for React Native users.
What's Changed
- refactor(traditional): remove duplicated ExtractState type declaration by @shinhyogeun in #2982
- fix(package): react-native condition by @dai-shi in #3087
New Contributors
- @zbeyens made their first contribution in #2958
- @samirhembrom made their first contribution in #2963
- @alimertcakar made their first contribution in #2980
- @sidahmedabdelillah made their first contribution in #2978
- @Sunjae95 made their first contribution in #2994
- @chervyakovru made their first contribution in #3001
- @andriyor made their first contribution in #3002
- @theperfectpunk made their first contribution in #2998
- @locothedev made their first contribution in #3004
- @paulschoen made their first contribution in #3008
- @mooalot made their first contribution in #3011
- @rn0614 made their first contribution in #3037
- @dngur9801 made their first contribution in #3042
- @Shashikantyadavv made their first contribution in #3045
- @mtilda made their first contribution in #3053
- @jroitgrund made their first contribution in #2995
- @oduntane made their first contribution in #3080
- @B1u3B01t made their first contribution in #3082
- @vikpe made their first contribution in #3094
- @wy-luke made their first contribution in #3100
- @shinhyogeun made their first contribution in #2982
Full Changelog: v5.0.3...v5.0.4
v5.0.3
ExtractState
is a type util to extract state type from store type.
What's Changed
- feat(types): Make ExtractState public by @vorant94 in #2935
- fix(build): alias entries in rollup config by @dai-shi in #2942
New Contributors
- @atticoos made their first contribution in #2883
- @sukvvon made their first contribution in #2890
- @Wxh16144 made their first contribution in #2891
- @leweyse made their first contribution in #2913
- @dmaskasky made their first contribution in #2936
- @HoberMin made their first contribution in #2938
Full Changelog: v5.0.2...v5.0.3
v4.5.6
v5.0.2
This fixes some issues in middleware.
What's Changed
- fix(middleware): devtools type error #2700 by @AndyRightNow in #2875
- fix(persist): fix async migrate on persist middleware by @dbritto-dev in #2877
New Contributors
- @ennjin made their first contribution in #2834
- @ytraddan made their first contribution in #2836
- @m1nsuplee made their first contribution in #2847
- @gonzalezfj made their first contribution in #2861
- @mordv made their first contribution in #2869
- @marcoamt made their first contribution in #2874
- @AndyRightNow made their first contribution in #2875
Full Changelog: v5.0.1...v5.0.2
v5.0.1
This fixes shallow
function for some edge cases.
What's Changed
- fix(shallow): fallback map-like iterator comparison by @dai-shi in #2795
- fix(shallow): iterable-like insensitive keys order comparison (alternate implementation) by @dai-shi in #2821
New Contributors
- @legcy143 made their first contribution in #2799
- @kretajak made their first contribution in #2822
- @steaks made their first contribution in #2824
Full Changelog: v5.0.0...v5.0.1
v5.0.0
πππ Zustand v5 π»π»π»
TL;DR
- No new features
- Drop many old things
- Migration from v4 should be smooth.
Changes in v5
- Drop default exports
- Drop deprecated features
- Make React 18 the minimum required version
- Make use-sync-external-store a peer dependency (required for
createWithEqualityFn
anduseStoreWithEqualityFn
inzustand/traditional
) - Make TypeScript 4.5 the minimum required version
- Drop UMD/SystemJS support
- Organize entry points in the package.json
- Drop ES5 support
- Stricter types when setState's replace flag is set
- Persist middleware behavioral change
- Other small improvements (technically breaking changes)
Migration Guide
Read the migration guide carefully:
https://github.com/pmndrs/zustand/blob/main/docs/migrations/migrating-to-v5.md
Frequently Reported Issue
During the RC period, some users encountered the following infinite loop error:
Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
This case was already a non-ideal behavior in v4 but appears more explicitly as an error in v5. While there are several ways to resolve this, using useShallow
often fixes the problem.
What's Changed
- v5 by @dai-shi in #2138
- Fix Immer type inference for
setState
by @chrisvander in #2696
New Contributors
- @abernier made their first contribution in #2674
- @tthallos made their first contribution in #2501
- @sagiereder made their first contribution in #2673
- @melutovich made their first contribution in #2692
- @rgksugan made their first contribution in #2695
- @Anuovec made their first contribution in #2708
- @EthanRBrown made their first contribution in #2717
- @mym0404 made their first contribution in #2730
- @87xie made their first contribution in #2745
- @f312213213 made their first contribution in #2761
- @DanThemes made their first contribution in #2764
- @chaficnajjar made their first contribution in #2770
- @goosewobbler made their first contribution in #2781
- @Amyssyko made their first contribution in #2784
- @MartinGamesCZ made their first contribution in #2785
Full Changelog: v4.5.5...v5.0.0
v5.0.0-rc.2
Hopefully, this will be the last RC, unless we have serious bug reports in #2741.
What's Changed
- chore: enable isolatedDeclarations by @dai-shi in #2738
- revert useShallow refactor in #2701 by @dai-shi in #2703
New Contributors
- @Anuovec made their first contribution in #2708
- @EthanRBrown made their first contribution in #2717
- @mym0404 made their first contribution in #2730
Full Changelog: v5.0.0-rc.1...v5.0.0-rc.2
v5.0.0-rc.1
This version includes some minor changes. Please report any issues if you find.
What's Changed
- Fix Immer type inference for
setState
by @chrisvander in #2696 - refactor useShallow by @dai-shi in #2701
New Contributors
- @sagiereder made their first contribution in #2673
- @melutovich made their first contribution in #2692
- @rgksugan made their first contribution in #2695
Full Changelog: v5.0.0-rc.0...v5.0.0-rc.1