Releases: pmndrs/zustand
v4.4.1
Fixes some issues reported with the deprecated feature in v4.4.0.
What's Changed
- fix(types): accept undefined equalityFn for the deprecated useStore by @dai-shi in #1972
- fix: improve warning for deprecated equalityFn by @dai-shi in #1976
New Contributors
- @kangju2000 made their first contribution in #1969
Full Changelog: v4.4.0...v4.4.1
v4.4.0
This adds new zustand/traditional
entry point and deprecates equalityFn from zustand
.
Migration Guide
If you don't use custom equalityFn
, nothing is required.
For those who use custom equalityFn such as shallow
:
// previously
import { create } from 'zustand'
const useFooStore = create((set) => ...)
// now
import { createWithEqualityFn } from 'zustand/traditional'
const useFooStore = createWithEqualityFn((set) => ..., Object.is)
// Object.is is the default quailtyFn in zustand create; to match that behavior, pass that function here. This can be updated to shallow or anything else
What's Changed
- feat: deprecate equalityFn and add createWithEqualityFn by @dai-shi in #1945
- fix: declare @types/react as peerDep to avoid phantom dep by @leviosa-e in #1963
New Contributors
- @luizeboli made their first contribution in #1915
- @mohammedmulazada made their first contribution in #1931
- @coder054 made their first contribution in #1932
- @itayperry made their first contribution in #1957
- @cwtuan made their first contribution in #1953
- @tiagobento made their first contribution in #1962
- @leviosa-e made their first contribution in #1963
Full Changelog: v4.3.9...v4.4.0
v4.3.9
This includes a small improvement for production build mostly for Vite users. Docs have been improved too!
What's Changed
New Contributors
- @Debbl made their first contribution in #1792
- @Nipodemos made their first contribution in #1782
- @vadimshvetsov made their first contribution in #1800
- @bobylito made their first contribution in #1810
- @celineling made their first contribution in #1804
- @valerii15298 made their first contribution in #1819
- @Hecmatyar made their first contribution in #1816
- @203x made their first contribution in #1826
- @Ciensprog made their first contribution in #1844
- @Romainlg29 made their first contribution in #1843
- @dcorb made their first contribution in #1847
- @ivoilic made their first contribution in #1856
- @Kiku-CN made their first contribution in #1889
- @LartyHD made their first contribution in #1893
- @ChoiHyunjin made their first contribution in #1903
- @thesuryavivek made their first contribution in #1906
- @thedipankarroy made their first contribution in #1913
Full Changelog: v4.3.8...v4.3.9
v4.3.8
For persist middleware, a new option for createJSONStorage in introduced to support more cases. Note that createJSONStorage isn't a required function (and it's not very recommended as it's not type safe), and one should create a custom storage for more use cases.
What's Changed
- chore: add extension in imports by @dai-shi in #1678
- feat(middleware/persist): improve createJSONStorage for Maps by @lauhon in #1763
- chore(tests): migrate to vitest by @arjunvegda in #1753
New Contributors
- @JacobWeisenburger made their first contribution in #1737
- @spacemeowx2 made their first contribution in #1742
- @arjunvegda made their first contribution in #1754
- @zc627788 made their first contribution in #1752
- @arvinxx made their first contribution in #1758
- @SilentFlute made their first contribution in #1762
- @dannobytes made their first contribution in #1779
- @BLooDBRothER made their first contribution in #1777
- @lauhon made their first contribution in #1763
Full Changelog: v4.3.7...v4.3.8
v4.3.7
This includes a couple of improvements in persist
middleware.
What's Changed
- feat(middleware/persist): add skip hydration option #405 by @gmanninglive in #1647
- fix(middleware/persist): ensure
persist
does not drop updates inonRehydrateStorage
when using a synchronous storage API by @coffeebeats in #1689 - fix(middleware/persist): ensure argument for
onRehydrateStorage
andonHydrate
is defined on first hydration by @coffeebeats in #1692
New Contributors
- @hi-otto made their first contribution in #1687
- @pastelmind made their first contribution in #1707
- @gmanninglive made their first contribution in #1647
- @coffeebeats made their first contribution in #1689
Full Changelog: v4.3.6...v4.3.7
v4.3.6
This has a little improvement for library authors.
What's Changed
- fix(react, types): relax react types by @lukesmurray in #1589
- fix: typo in shallow.ts by @ysulyma in #1667
New Contributors
- @ctolmsted made their first contribution in #1670
- @kevin51jiang made their first contribution in #1674
- @lukesmurray made their first contribution in #1589
- @ysulyma made their first contribution in #1667
Full Changelog: v4.3.5...v4.3.6
v4.3.5
v4.3.4 has a regression in CJS build. Please use this version instead.
What's Changed
New Contributors
- @jmantonellini made their first contribution in #1485
- @hiendv made their first contribution in #1661
Full Changelog: v4.3.4...v4.3.5
v4.3.4
This version fixes some build configs for some edge cases.
What's Changed
- fix(build): UMD names by @dai-shi in #1632
- fix(build): possibly improve ESM for production build by @dai-shi in #1645
- fix(build): add explicit export paths for cjs by @barelyhuman in #1659
New Contributors
- @AwesomeDevin made their first contribution in #1633
- @adimit made their first contribution in #1641
Full Changelog: v4.3.3...v4.3.4
v4.3.3
This version includes some small fixes and internal improvements.
What's Changed
- fix(build): improve patch scripts by @dai-shi in #1593
- fix(log): deprecated messages copyedit for consistency by @jareha in #1588
- chore: remove
__DEV__
with ts-jest by @dai-shi in #1598 - fix(build): reorder the types field in package.json by @HiChen404 in #1600
New Contributors
- @nitedani made their first contribution in #1544
- @nus3 made their first contribution in #1550
- @holgergp made their first contribution in #1565
- @JoaoPauloLousada made their first contribution in #1605
- @sajadtorkamani made their first contribution in #1606
- @zhangrenyang made their first contribution in #1608
- @jareha made their first contribution in #1588
- @HiChen404 made their first contribution in #1600
Full Changelog: v4.3.2...v4.3.3
v4.3.2
There was a regression with default export (which is deprecated) in v4.3.0 and v4.3.1. This should fix it.
What's Changed
- fix(vanilla,shallow): default export regression in CJS by @dai-shi in #1531
- fix(middleware/persist): Fix the storage type by @MOZGIII in #1540
New Contributors
- @catmonster made their first contribution in #1539
- @MOZGIII made their first contribution in #1540
Full Changelog: v4.3.1...v4.3.2