Skip to content

Releases: pmndrs/zustand

v4.4.0

01 Aug 02:08
Compare
Choose a tag to compare

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

Full Changelog: v4.3.9...v4.4.0

v4.3.9

04 Jul 14:43
Compare
Choose a tag to compare

This includes a small improvement for production build mostly for Vite users. Docs have been improved too!

What's Changed

  • fix(build): mode env for "import" condition" by @dai-shi in #1845

New Contributors

Full Changelog: v4.3.8...v4.3.9

v4.3.8

04 May 07:51
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v4.3.7...v4.3.8

v4.3.7

31 Mar 15:16
Compare
Choose a tag to compare

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 in onRehydrateStorage when using a synchronous storage API by @coffeebeats in #1689
  • fix(middleware/persist): ensure argument for onRehydrateStorage and onHydrate is defined on first hydration by @coffeebeats in #1692

New Contributors

Full Changelog: v4.3.6...v4.3.7

v4.3.6

06 Mar 05:20
Compare
Choose a tag to compare

This has a little improvement for library authors.

What's Changed

New Contributors

Full Changelog: v4.3.5...v4.3.6

v4.3.5

28 Feb 11:15
Compare
Choose a tag to compare

v4.3.4 has a regression in CJS build. Please use this version instead.

What's Changed

  • fix(build): re-export createStore from index by @hiendv in #1661

New Contributors

Full Changelog: v4.3.4...v4.3.5

v4.3.4

27 Feb 03:03
Compare
Choose a tag to compare

This version fixes some build configs for some edge cases.

⚠️ this version has an issue in CJS build. Please use v4.3.5.

What's Changed

New Contributors

Full Changelog: v4.3.3...v4.3.4

v4.3.3

10 Feb 12:33
Compare
Choose a tag to compare

This version includes some small fixes and internal improvements.

What's Changed

New Contributors

Full Changelog: v4.3.2...v4.3.3

v4.3.2

14 Jan 00:05
Compare
Choose a tag to compare

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

Full Changelog: v4.3.1...v4.3.2

v4.3.1

10 Jan 11:15
Compare
Choose a tag to compare

This version supersedes v4.3.0.

What's Changed

  • chore: show deprecated message only in DEV by @dai-shi in #1523

Full Changelog: v4.3.0...v4.3.1