Skip to content

Releases: pmndrs/zustand

v4.0.0-rc.1

29 Apr 14:33
Compare
Choose a tag to compare

This improves some types for TypeScript users. Please read ./docs for TypeScript usage and v4 migration.

What's Changed

  • breaking(middleware/devtools): remove checking old string option by @dai-shi in #933
  • Fix TS4023 and other minor changes by @devanshj in #940
  • fix(types): avoid any in react.ts by @dai-shi in #941

New Contributors

Full Changelog: v4.0.0-rc.0...v4.0.0-rc.1

v4.0.0-rc.0

18 Apr 02:12
Compare
Choose a tag to compare

Long-awaited zustand v4!

We started working on #550 at Aug 31 2021. It's been more than 7 months!

Release status

Although this release is v4.0.0-rc.0, we treat this as a normal release. While we might make some changes before the final one, the stability of this release should be same as other releases like v3.7.*.

No breaking changes in JavaScript API

Most notably, this release is backward compatible with the latest v3 API. Some features deprecated in v3 are removed in v4. It's highly recommended to update to latest v3, before upgrading to v4, and check any deprecation messages.

Big rewrite in TypeScript

Zustand code in JS is surprisingly small, and its value is actually in TypeScript. Although it is very tricky to support mutation nature of zustand middleware, @devanshj did a great job to support types as much as possible. There are some breaking changes in types from v3. Please refer ./docs/typescript.md and ./docs/v4-migration.md.

Your feedback is necessary

As always, feedback is welcome, and even necessary this time because otherwise nothing happens. Please try v4 and open issues and discussions (discussions are preferable if you are not sure which).

What's Changed

  • breaking(vanilla): drop deprecated store.subscribe with selector by @dai-shi in #604
  • breaking(middleware): drop deprecated persist options and make removeItem required by @dai-shi in #598
  • breaking(core): drop v2 hook compatibility by @dai-shi in #597
  • breaking(types): drop deprecated UseStore type by @dai-shi in #596
  • feat: use-sync-external-store by @dai-shi in #550
  • breaking(middleware/devtools): use official devtools extension types by @dai-shi in #819
  • breaking(middleware/devtools): remove deprecations and warnings by @devanshj in #892
  • fix(build): separate vanilla build by @dai-shi in #904
  • breaking(types): Add higher kinded mutator types by @devanshj in #725
  • fix(index): export createStore from vanilla by @dai-shi in #914
  • fix(middleware): separate immer middleware by @dai-shi in #915
  • fix(middleware/devtools): add enabled option and show devtools warning only if enabled by @Aslemammad in #880

Full Changelog: v3.7.2...v4.0.0-rc.0

v3.7.2

07 Apr 14:05
Compare
Choose a tag to compare

This fixes an issue in persist for some use cases.

What's Changed

  • fix(middleware/persist): Merge storage value with the latest store state by @zerofirework in #894

New Contributors

Full Changelog: v3.7.1...v3.7.2

v3.7.1

28 Feb 02:45
Compare
Choose a tag to compare

This fixes a type issue with zustand/context in v3.7.0.

What's Changed

  • fix(context): revert removing overloads in UseContextStore by @devanshj in #817
  • fix(middleware/devtools): deprecate serialize.options by @dai-shi in #828

Full Changelog: v3.7.0...v3.7.1

v3.7.0

10 Feb 23:53
Compare
Choose a tag to compare

This release is to prepare for v4 release, which will include some breaking changes. Especially typing store with middleware will be changed. This release gives partial migration path (see tests/middlewareTypes.test.tsx for examples), so it's highly recommended to try this version before v4 comes and report issues.

It also fixes some small typing issues and improves UMD/SystemJS bundling. Oh, and last but not least, vite users don't need to set NODE_ENV anymore.

What's Changed

  • fix(devtools): don't show jsdoc deprecation warning when no options are passed by @devanshj in #781
  • fix(middleware): match vanilla StateCreator type in subscribeWithSelector by @toddw in #787
  • feat(build): use __DEV__ to control development mode by @dai-shi in #789
  • feat: Migrations regarding higher kinded mutators for v4 by @devanshj in #772

New Contributors

Full Changelog: v3.6.9...v3.7.0

v3.6.9

10 Jan 14:18
Compare
Choose a tag to compare

This adds UMD and SystemJS builds for CDN.

What's Changed

New Contributors

Full Changelog: v3.6.8...v3.6.9

v3.6.8

24 Dec 07:35
Compare
Choose a tag to compare

This fixes some issues in devtools middleware.

What's Changed

  • fix(middleware/devtools): minor fixes for pause recording feature by @devanshj in #720
  • fix(middleware/devtools): revert extension connector with try-catch to fix RN usage by @dai-shi in #724
  • fix(middleware/devtools): deprecate passing name directly instead of an object by @devanshj in #731

New Contributors

Full Changelog: v3.6.7...v3.6.8

v3.6.7

07 Dec 07:35
Compare
Choose a tag to compare

There was a regression in devtools middleware in v3.6.6, which is fixed.

What's Changed

  • fix(middleware): devtools work in non-browser by @dai-shi in #693

Full Changelog: v3.6.6...v3.6.7

v3.6.6

03 Dec 13:28
Compare
Choose a tag to compare

This fixes and improves devtools middleware. The basic usage shouldn't be changed. If you have questions on usage, please open a new discussion.

What's Changed

New Contributors

Full Changelog: v3.6.5...v3.6.6

v3.6.5

09 Nov 14:08
Compare
Choose a tag to compare

This version further improves to fix some typing issues introduced in v3.6.0 and fixes persist api introduced in v3.6.3.

What's Changed

  • fix(types): fix core types to better handle middleware types by @dai-shi in #641
  • feat(middleware): add onFinishHydration to persist api by @AnatoleLucet in #646

Full Changelog: v3.6.4...v3.6.5