Skip to content

Releases: pmndrs/zustand

v3.6.2

30 Oct 00:52
Compare
Choose a tag to compare

v3.6.0 introduced middleware types trying to infer store types as much as possible. However, it doesn't work well for several cases, and users need to type manually which was actually hard. In this version, middleware types are simplified and let users to explicitly type when needed more easily. Many examples are in tests/middlewareTypes.test.tsx. If you find issues or need some more typing examples, please report them.

What's Changed

  • fix(middleware): simplify middleware types and allow explicit typing by @dai-shi in #617

Full Changelog: v3.6.1...v3.6.2

v3.6.1

26 Oct 15:44
Compare
Choose a tag to compare

Summary

This fixes some type issues introduced in v3.6.0. devtools is improved to accept updating state from DevTools Ext.

What's Changed

Full Changelog: v3.6.0...v3.6.1

v3.6.0

21 Oct 14:09
Compare
Choose a tag to compare

Summary

This version mainly comes with type improvement for middleware. It's tricky implementation-wise. Please report issues and let's look for solutions or workarounds.
It has renamed and deprecated types: UseStore πŸ‘‰ UseBoundStore
A new subscribeWithSelector middleware is added, deprecating the equivalent feature in core.

Migrating to subscribeWithSelector middleware

Previously, you could do this:

const useStore = create(...)
useStore.subscribe(callback, selector, equalityFn)

which is deprecated and replaced with:

const useStore = create(subscribeWithSelector(...))
useStore.subscribe(selector, callback, { equalityFn }) // selector is not optional

What's Changed

  • feat(types): better middleware support by @dai-shi in #601
  • fix(types): Rename from UseStore to UseBoundStore by @dai-shi in #595
  • feat(middleware): subscribeWithSelector middleware by @dai-shi in #603

New Contributors

Full Changelog: v3.5.14...v3.6.0

v3.5.14

19 Oct 11:43
Compare
Choose a tag to compare

Summary

Fixed a regression in devtools that was introduced in v3.5.11.

What's Changed

  • fix(middleware): export PersistOptions type definitions by @abraaoz in #588
  • fix(middleware): jump state support in devtools by @Aslemammad in #590

New Contributors

Full Changelog: v3.5.13...v3.5.14

v3.5.13

07 Oct 12:54
Compare
Choose a tag to compare

The persist middleware has a new option partialize which works for nested properties, deprecating blacklist and whitelist options.

  • #463 feat(persist): add partialize option

v3.5.12

01 Oct 13:34
Compare
Choose a tag to compare

v3.5.11 accidentally requires newer node.js versions. v3.5.12 fixes it by reverting exports format.

  • #578 fix(package): avoid subpath pattern in exports

v3.5.11

28 Sep 16:12
Compare
Choose a tag to compare

⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0

This improved devtools middleware. There can still be room for improvement. Free free to open issues and feature requests, and possibly contribute to them.

  • #560 Fix: remove useless internal info in devtools
  • #558 chore(build): simplify exports and support nested subpath

v3.5.10

26 Aug 14:24
Compare
Choose a tag to compare

Our fixes for ESM in v3.5.8 and v3.5.9 were somewhat good and somewhat bad. Now, this should be the better one based on our experience and reported issues. If you still have some issues, please file them.

  • #540 Allow optional REDUX DEVTOOLS "options" object
  • #543 Rollback to initial exports structures with duplicated .js and .mjs files for additional support of bundlers

v3.5.9

17 Aug 12:06
Compare
Choose a tag to compare

We've been struggling with providing package that works for various bundlers and node.
v3.5.8 was expected to solve the issue with node, but it turned out having an issue with webpack 5.
We basically gave up supporting old bundlers. v3.5.9 comes with simplified builds with latest standard.

Note for old bundlers like webpack 4: Unlike previous versions, the bundler will pick cjs build by default. If you need module build, it should be explicit. Free free to open an issue for questions and discussions.

  • #537 Package all files into a single dist folder

v3.5.8

13 Aug 12:03
Compare
Choose a tag to compare

This improves ESM build.

  • #507 fix(build): Improved ESM support for most used bundlers with fallbacks for older bundlers