32 Commits

Author SHA1 Message Date
Mordechai Dror
d2ac8205ec
feat(types): Make ExtractState public (#2935)
* make ExtractState public and move it to vanilla

* add docs on the matter

* Update vanilla.ts

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2025-01-07 22:57:18 +09:00
Chafic Najjar
eac9dad35b
Fix "previous" and "next" navigation links (#2777) 2024-10-08 07:11:45 -05:00
Charles Kornoelje
717f569022
docs: remove State and improve replace typecasting (#2776) 2024-10-06 19:32:48 -05:00
DanThemes
976ae9fb16
Update typescript.md (#2764)
Typo: "That is to say how could **do** we type ..."
2024-10-01 17:41:15 +09:00
Tibinko
c0cd364b8f
docs: typo in typescript docs (#2708) 2024-08-28 09:44:04 +09:00
Daishi Kato
e247220ece
v5 (#2138)
* prepare for the next major version

* [v5] breaking: drop default exports (#2238)

* fix: drop default exports for v5

* chore: remove default from cjs build

* refactor: export shallow in v5

* fix: remove `addModuleExport` option for cjs.

* [v5] breaking: drop deprecated features (#2235)

* fix: remove deprecated v4 features

* chore(build): remove context

* docs(typescript): remove deprecated equals api

* docs(persist): remove old persist api

* chore: run yarn prettier on typescript docs

* Discard changes to docs/guides/typescript.md

* Discard changes to docs/integrations/persisting-store-data.md

* Discard changes to tests/shallow.test.tsx

* Discard changes to tests/vanilla/subscribe.test.tsx

* [v5] breaking: make React 18 as minimal requirement (#2236)

* fix: update package.json to require react 18+

* chore: update github actions to test on react 18+

* chore: remove devtools-skip hack from actions

* chore(test): remove CI-SKIP from devtools tests

* [v5] breaking: make use-sync-external-store an optional peer dependency (#2237)

* chore: make use-sync-external-store optional peerDep

* fix: use correct versions in package.json

* [v5] breaking: require TypeScript 4.5 and update tests (#2257)

* breaking(types): TS requirement

* wip: latest only

* wip: latest only 2

* drop ts <4.4

* wip: do not skip lib checkes

* use latest node types

* drop ts 4.4

* [v5]: drop "module" condition  (#2270)

* Update package json in order to remove module

* Update rollup config in order to remove module config

* Update patch esm script

* Update package json to general exports and update node version (#2272)

* [v5]: drop UMD/SystemJS builds (#2287)

* Update rollup config in order to drop system js and umd builds

* Update packages

* Clean up files

* Update rollup config

* Update gh workflows

* Minor fixes

* Minor fixes

* Minor fixes

* Minor fixes

* Testing

* Minor changes

* Minor fixes

* remove `WithReact` type (#2300)

* 5.0.0-alpha.0

* [v5]: do not depend on use-sync-external-store (#2301)

* [v5]: do not depend on use-sync-external-store

* memo get(server)snapshot

* 5.0.0-alpha.1

* [v5]: refactor useMemoSelector (#2302)

* [v5]: refactor useMemoSelector

* add a test

* Revert "[v5]: refactor useMemoSelector"

This reverts commit b3c8b15586a270d12c335e566975021adf86c815.

* Revert "Revert "[v5]: refactor useMemoSelector""

This reverts commit 3c47301d23e18dffb7d72df36595f83570d15d08.

* [v5]: separate react entry point (#2303)

* 5.0.0-alpha.2

* 5.0.0-alpha.3

* refactor: Switch to Object.hasOwn (#2365)

* [v5] drop es5 (#2380)

* update yarn lock

* 5.0.0-alpha.4

* [v5]: follow React "standard" way with breaking behavioral change (#2395)

* [v5]: follow React "standard" way with breaking behavioral change

* add test

* 5.0.0-alpha.5

* [v5] Rewrite shallow to support iterables (#2427)

* [v5] fix rollup config for cjs (#2433)

* 5.0.0-alpha.6

* no production build test

* recover types that are dropped in #2462

* remove unused replacement

* [v5] Remove Devtools warning (#2466)

* chore: remove devtools extension warning

* docs: add devtools link to readme

* chore: remove unused test

* chrome: remove unused tests

* chore: remove unused test

* Revert "chore: remove unused test"

This reverts commit 0fa2a75f4936d960f703bf19e8f3505962cd628e.

* update test name

* update pnpm lock

* fix merge main

* add migration guide

* fix typos

* 5.0.0-beta.0

* update migration doc

* fix merge main

* fix merge main (prettier)

* 5.0.0-beta.1

* fix(types)!: require complete state if `setState`'s `replace` flag is set (#2580)

* fix(types): require complete state if `setState`'s `replace` flag is set

* switch to variant 2

* fix type errors

* update setState types for devtools and immer

* make devtools setState non-generic

* add migration guide

* merge migration guides

* run prettier

* Update tests/middlewareTypes.test.tsx

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: daishi <daishi@axlight.com>

* 5.0.0-beta.2

* move v5 migration doc

* fix ci

* missing commmit

* remove unused rule exclusion

* comment about react compiler

* revert eslint config

---------

Co-authored-by: Charles Kornoelje <33156025+charkour@users.noreply.github.com>
Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>
Co-authored-by: Ekin Dursun <ekindursun@gmail.com>
Co-authored-by: Simon Farshid <simon.farshid@outlook.com>
2024-08-16 09:41:00 +09:00
Aberratio
cae5bb48bc
Update typescript.md - middleware order (#2558)
Change in the description of the order of middleware.
2024-05-17 20:36:29 +02:00
StyleShit
11cc9c3c5e
docs: fix typos in the typescript guide (#2550) 2024-05-13 10:47:11 +02:00
Charles Kornoelje
eb8443faa3
docs(middleware): modify both set and setState (#2306)
* docs(middleware): modify `set` and `setState`

* update middleware docs
2024-02-15 22:21:29 +09:00
Charles Kornoelje
41838c5187
chore(docs): rewrite to remove deprecated references in persist docs (#2248)
* chore(docs): rewrite to remove deprecated references in persist docs

* chore(docs): remove deprecated equalityFn
2023-12-14 08:05:20 +09:00
Daishi Kato
9857a676a9
refactor: revisit prettier config to be minimal (#2193) 2023-11-14 12:19:51 +09:00
Bram Van der Sype
643bb7ab11
Improve types in Immer middleware docs (#2139)
* Having the generic type on `immer` makes you lose introspection in IDE's.

* Add note about parenthesis and link back to typescript guide.
2023-10-23 08:44:10 +09:00
Danilo Britto
f3a0fd802b
Update slices-pattern.md (#2046)
* Update slices-pattern.md

* Update typescript.md

* Fix format

* Update typescript.md

Co-authored-by: Blazej Sewera <code@sewera.dev>

* Update typescript.md

Co-authored-by: Blazej Sewera <code@sewera.dev>

---------

Co-authored-by: Blazej Sewera <code@sewera.dev>
2023-09-12 21:30:08 +09:00
John Gilliland
9ddfced2ea
docs: Update typescript guide persist examples... (#2001)
* docs: Update typescript guide persist examples to add required name option

* docs: run prettier

* docs: reverting prettier changes to testing.md

* docs: Update docs/guides/typescript.md per review comment.

Co-authored-by: Blazej Sewera <code@sewera.dev>

* docs: Update docs/guides/typescript.md per review comment and zustand conventions.

Co-authored-by: Blazej Sewera <code@sewera.dev>

* docs: change persist options name property to bearStore for consistency.

---------

Co-authored-by: John Gilliland <John.Gilliland@Starz.com>
Co-authored-by: Blazej Sewera <code@sewera.dev>
2023-08-25 16:54:04 +09:00
Daishi Kato
5777a65cf5
chore(deps): update dev dependencies (#1965) 2023-08-01 10:42:18 +09:00
Mohammed 'Mo' Mulazada
f73736d59a
improve docs readability (#1931)
* make codeblock easier to understand

* add explanation to what mock does

* add info block

* rewrite typescript section

* Update typescript.md

* Update docs/guides/testing.md

Co-authored-by: Blazej Sewera <code@sewera.dev>

* prefix with >

---------

Co-authored-by: Blazej Sewera <code@sewera.dev>
2023-07-13 18:01:47 +09:00
Daniels L
e71e313bd7
docs(typescript): fix bounded use store example (#1779)
* test: changer

* docs: fix abstract bounded store hook TS example

Fixes type issues due to optional arg:
https://github.com/pmndrs/zustand/discussions/1564#discussioncomment-5735802

* fix: pr feedback
2023-04-28 17:40:42 +09:00
Jacob Weisenburger
f94ad23b43
fixes #1735 (#1737) 2023-04-07 11:54:45 +09:00
Devansh Jethmalani
f508b2c315
docs(typescript): clean up bounded useStore recipe (#1581)
* Make bounded useStore recipe section minimal

* Add a receipe for `createBoundedUseStore`

* run prettier

* use vanilla store
(as the react store is already a bounded useStore hook)
2023-01-30 08:23:26 +09:00
Holger Grosse-Plankermann
04080fdedc
fix(docs/typescript): provide example how to use middlewares with #1565 (#1578) 2023-01-27 09:00:31 +09:00
Holger Grosse-Plankermann
1023eb4af4
fix(docs/typescript): use correct initial state in test example (#1577) 2023-01-26 19:55:37 +09:00
Holger Grosse-Plankermann
44b23382f0
fix(docs/typescript): add typing usage with custom store hooks (#1565)
* Docs for discussion 1564

* Apply prettier

* fix(docs/typescript): use overloading example discussed in #1564
2023-01-25 11:52:53 +09:00
Daishi Kato
0b55a3d74b
feat: deprecate default export (#1514) 2023-01-10 18:13:25 +09:00
Devansh Jethmalani
ea8415b98d
docs(typescript): highlight the extra parenthesis for create (#1410)
* docs(typescript): highlight the extra parenthesis for `create`

* fix typo
2022-11-05 12:58:21 +09:00
Devansh Jethmalani
ca059788d3
fix(types): fix StateCreator subtyping (#1373)
* fix(types): fix `StateCreator` subtyping

* prefer import type

Co-authored-by: daishi <daishi@axlight.com>
2022-10-23 08:55:31 +09:00
Joel Mathew Koshy
e8b05d8179
docs: added separate docs file for slices pattern (#1344) 2022-10-07 01:05:07 +09:00
Jacob Bergholtz
4ed81bc11b
Add usage with context to docs (#1291)
* docs: context guide proposal

* fix(docs): typo & omit comment

* fix(docs): remove horizontal rules

* fix(docs): add wiki link to DI

* fix(docs): format with prettier

* fix(docs): cases that model => where... is needed

* fix(docs): use sentence case

* fix(docs): omit quote block

* fix(docs): into "a" custom hook

* fix(docs): format with prettier

* fix(docs): sort broken nav indexes

* Update docs/guides/initialize-state-with-props.md

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

* fix(docs): reintroduce React.createContext example

* scripts: escape quotes

* styles: run prettier

* fix(docs): omit 'React' from imports

* styles: run prettier

* styles: run prettier

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-09-18 09:01:06 +09:00
Chris K
1c56b91b5a
fix: remove unneeded <br> causing website build to fail (#1272) 2022-09-08 18:32:33 +09:00
Devansh Jethmalani
b8ec61dc53
docs(typescript): Rewrite the inference explanation (#1252)
* docs(typescript): Rewrite the inference explanation

* run prettier

* fix grammar

* run prettier

* typo

* grammar, punctuation

* more edits

* replacing ellipses with colon for consistency

* even more edits

* edit summary

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

* fix hypothetical type

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-09-03 08:48:06 +09:00
Fawaz Haroun
445e147478
fix(docs): Issue 1120 docs guides (#1247)
* docs: testing documentation review

* docs: auto-generated-selectors documentation review

* docs: auto-generated-selectors documentation review

* docs: flux-inspired-practices documentation review

* docs: flux-inspired-practices documentation review

* docs: flux-inspired-practices documentation review

* docs: immutable-state-and-merging documentation review

* docs: immutable-state-and-merging documentation review

* docs: event-handler-in-pre-react-18 documentation review

* docs: ran the yarn run prettier command

* review: reviewed documentation guides

* review: typo fixes and ran yarn run prettier

* review: change based on review comment

* review: change based on review comment

* review: change based on review comment

* review: made changes based on review

* ran yarn run prettier

* Update docs/guides/typescript.md

Co-authored-by: Devansh Jethmalani <jethmalani.devansh@gmail.com>

Co-authored-by: Devansh Jethmalani <jethmalani.devansh@gmail.com>
2022-09-02 07:54:27 +09:00
Fawaz Haroun
476a381df8
fix(docs): Issue 1120 docs guides (#1244)
* docs: testing documentation review

* docs: auto-generated-selectors documentation review

* docs: auto-generated-selectors documentation review

* docs: flux-inspired-practices documentation review

* docs: flux-inspired-practices documentation review

* docs: flux-inspired-practices documentation review

* docs: immutable-state-and-merging documentation review

* docs: immutable-state-and-merging documentation review

* docs: event-handler-in-pre-react-18 documentation review

* docs: ran the yarn run prettier command

* review: reviewed documentation guides

* review: typo fixes and ran yarn run prettier

* review: change based on review comment

* review: change based on review comment

* review: change based on review comment
2022-08-31 08:09:15 +09:00
Chris K
b85f6413f1
docs(issue-1215): restructure top level docs (#1222) 2022-08-25 19:34:32 +09:00