v4.0.0-rc.0
版本发布时间: 2022-04-18 10:12:21
pmndrs/zustand最新发布版本:v5.0.0-rc.2(2024-09-15 11:17:18)
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 https://github.com/pmndrs/zustand/pull/604
- breaking(middleware): drop deprecated persist options and make removeItem required by @dai-shi in https://github.com/pmndrs/zustand/pull/598
- breaking(core): drop v2 hook compatibility by @dai-shi in https://github.com/pmndrs/zustand/pull/597
- breaking(types): drop deprecated UseStore type by @dai-shi in https://github.com/pmndrs/zustand/pull/596
- feat: use-sync-external-store by @dai-shi in https://github.com/pmndrs/zustand/pull/550
- breaking(middleware/devtools): use official devtools extension types by @dai-shi in https://github.com/pmndrs/zustand/pull/819
- breaking(middleware/devtools): remove deprecations and warnings by @devanshj in https://github.com/pmndrs/zustand/pull/892
- fix(build): separate vanilla build by @dai-shi in https://github.com/pmndrs/zustand/pull/904
- breaking(types): Add higher kinded mutator types by @devanshj in https://github.com/pmndrs/zustand/pull/725
- fix(index): export createStore from vanilla by @dai-shi in https://github.com/pmndrs/zustand/pull/914
- fix(middleware): separate immer middleware by @dai-shi in https://github.com/pmndrs/zustand/pull/915
- fix(middleware/devtools): add
enabled
option and show devtools warning only if enabled by @Aslemammad in https://github.com/pmndrs/zustand/pull/880
Full Changelog: https://github.com/pmndrs/zustand/compare/v3.7.2...v4.0.0-rc.0