17 Commits

Author SHA1 Message Date
Devansh Jethmalani
8e987d99aa
docs(typescript): add recommendation to use devtools after immer (#1198)
* docs(typescript): add recommendation to use `devtools` after `immer`

* remove typo

* run prettier

Co-authored-by: daishi <daishi@axlight.com>
2022-08-19 07:48:00 +09:00
Daishi Kato
2122a0c5e7
docs: move mdx files from website repo (#1172)
* move mdx files from website repo

* run prettier

* add frontmatter in md files

* fix img path
2022-08-07 11:30:20 +09:00
Garrett Hopper
0d6ff79ca7
fix typo in typescript.md (#1152)
* fix typo in typescript.md

Not sure if `useBoundStore` had some special meaning in other places, but there were incorrect references to it in the `combine` comment that didn't match the example. (I just replaced it with `useBearStore` everywhere assuming it was a typo.)

* update typescript.md

* update typescript.md
2022-08-01 10:00:29 +09:00
Daishi Kato
fa581ddd9b
fix(docs): useBoundStore instead of useStore (#1125)
* fix(docs): useBoundStore instead of useStore

* run prettier
2022-07-26 08:58:43 +09:00
Devansh Jethmalani
8d7bb9aec9
doc(types): Remove independent slices pattern (#1090) 2022-07-16 21:15:58 +09:00
xlboy
85a5959a2d
docs(typescript): supplement the missing ) symbol in the combine code example (#1082)
* docs(typescript): supplement the missing `)` symbol in the `combine` code example

* style(docs/typescript): formatting
2022-07-13 20:56:29 +09:00
Devansh Jethmalani
cb7c2a2f36
docs(typescript): Add mutators reference (#1050)
* docs(typescript): Add mutators reference

* better wording
2022-07-06 12:28:27 +09:00
guilleon-velasco
e220737042
docs(typescript): fix minor grammar issue (#1009) 2022-06-15 19:19:28 +09:00
Daishi Kato
2b698fb249
chore: run prettier for docs (#1007) 2022-06-14 23:00:07 +09:00
InfiniteXyy
1011a2fa3c
chore(docs): fix typo in docs & code examples (#1006) 2022-06-14 22:06:44 +09:00
Devansh Jethmalani
d83c41d312
docs(typescript): Add a note to not use curried version when using state-creating middlewares (#1003) 2022-06-14 09:42:35 +09:00
Himself65
89c35772cf
chore(docs): fix code highlight (#978) 2022-05-31 09:51:04 +09:00
mahendradambe
12c81383ac
docs(typescript): fix typo in middleware without mutations (#956)
Co-authored-by: mahendrad <mahendrad@consultbop.com>
2022-05-15 14:45:59 +09:00
Devansh Jethmalani
72de1aed5d
Fix TS4023 and other minor changes (#940)
* fix(ts4023): use type aliases instead of interfaces

* refactor(types): immer, devtools
- make immer types more like devtools for better quickinfo
- make immer and devtools store names consistent with
  StoreMiddleware naming convention (eg StorePersist,
  StoreRedux, etc)

* format(docs): add a linebreak after <summary>
2022-04-29 23:15:55 +09:00
Piotr
54d5e0cd71
fix(docs): remove not used imports (#931) 2022-04-26 09:27:50 +09:00
Piotr
d1d487f096
Docs: Fix TypeScript docs for Middleware that changes the store type (#927) 2022-04-24 11:31:20 +09:00
Devansh Jethmalani
99cddcf76f
breaking(types): Add higher kinded mutator types (#725)
* imaginary code that uses uSES

* revert backward compatibility code as this is not going to be v4

* use use-sync-external-store

* revert to react 17

* handle error by our own

* v4.0.0-alpha.2

* fix&refactor a bit

* update uSES experimental package

* remove error propagation hack

* update size snapshot

* update uSES and add dts

* split react.ts and no export wild

* split useStore impl

* context to follow the new api, export wild again

* v4.0.0-alpha.3

* add missing await

* update uSES

* update uSES

* uses uSES extra!

* v4.0.0-alpha.3

* fix(types): Rename from UseStore to UseBoundStore

* breaking(types): drop deprecated UseStore type

* breaking(core): drop v2 hook compatibility

* breaking(middleware): drop deprecated persist options

* breaking(core): drop deprecated store.subscribe with selector

* update uSES

* fix update uSES

* v4.0.0-alpha.5

* combine subscribe type

* intentional undefined type

* add useDebugValue

* update uSES

* update uSES types

* breaking(middleware): make persist options.removeItem required

* update uSES

* v4.0.0-alpha.6

* fix(readme): remove memoization section which is no longer valid with uSES

* feat(readme): add new createStore/useStore usage

* update useSES

* update uSES and deps

* v4.0.0-alpha.7

* update uSES

* update uSES

* shave bytes

* vanilla: add higher kinded mutator types

* persist: add higher kinded mutator types

* persist: try to minimize diff

* use `PopArgument` in vanilla too

* update uSES

* use overloads instead of `createWithState`

* avoid symbols

* add new types to middlewares

* add new types react

* add new types to context

* fix persist types

* add immer

* migrate middleware type tests

* fix react type, export `UseBoundStore`

* migrate vanilla type tests

* rename `_createStore` to `createStoreImpl`

* Default to no mutations in `StateCreator`

* migrate context.test.tsx

* fix devtools.test.tsx type erros

* context: remove callsignature in useStoreApi

* context: remove `UseContextStore` type

* context: fix useBoundStore type

* context: keep `UseContextStore` for tooltip just don't export it

* react: remove duplicate overload in create

* export `WithPersist`

* devtools: preserve try/catch

* devtools: preserve window check

* add a test case for v3 style create

* devtools: preverse test fix from base branch

* remove StoreApiWithFoo types, don't export WithFoo types

* style

* devtools: preverse `originalIsRecording` change

* fix bug in devtools

* empty commit

* 4.0.0-beta.1

* fix lint

* style

* export immer fix tests

* style, minor fixes

* devtools: fix test

* Update tests/devtools.test.tsx

* breaking(middleware/devtools): use official devtools extension types

* type object.create

* avoid emitting @redux-devtools/extension

* fix type with any

* refactor

* fix yarn lock

* temporary fix #829

* v4.0.0-beta.2

* fix lint

* lock date-fns version

* test middleware subtyping

* fix errors in conflict resolution

* lock testing-library/react alpha version

* more correct (and strict) persist types

* migrate tests

* wip release notes

* fix devtools merge with base

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

* add a test case for persist with partialize option

* update readme

* fix lint

* immer: mutate `store.setState`

* fix devtools merge with base

* immer: fix mutations order

* changes in readme

* move and rename v4 migration md

* add `combine` usage in readme

* typos

* create separate md for typescript, add common recipes

* minor fixes

* devtools: minor type fix
(probably I copy pasted from persist and forgot to remove `U`)

* add more migrations

* context: fix import

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

* devtools: minor refactor
rearrange code for better diff

* fix lint: run prettier

* wip

* uSES rc.1

* getServerState for #886, no types yet

* uSES v1

* devtools: remove deprecations and warnings

* fix tests

* v4.0.0-beta.2

* wip

* migrate tests

* persist: keep diff minimal

* fix merge in package.json and yarn.lock

* fix merge for persist

* don't use `import type`

* docs(typescript): add slices pattern

* fix selector & equals types
for inference with useCallback, see issue #812

* add test for setState with replace

* remove undefined selector overload

* make immer more generic

* make devtools replace-friendly and more correctly typed

* migrate tests

* make setState bivariant to make the state covariant

* devtools: return the result of `setState`

* devtools: make the fallback branch in `StoreSetStateWithAction` bivariant too
(I forgot to make this bivaraint)

* remove strict replace

* fix lint

Co-authored-by: daishi <daishi@axlight.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-04-18 09:14:00 +09:00