27 Commits

Author SHA1 Message Date
Daishi Kato
18ab9e2615
chore: update dev dependencies (#3279)
* chore: update dev dependencies

* downgrade vitest

* packages entry
2025-11-01 12:32:05 +09:00
thomas
d25a4d226f
docs and tests: filter out specific actions from being sent to Redux DevTools (#3252)
* feat:   filter out specific actions from being sent to Redux DevTools

* fix format issues

* refactor: rename actionBlacklist to actionsDenylist

* refactor: use redux devtools' type signature

* fix linter issue

* fix format issues

* refactor: update documentation

* refactor: format file

* Update src/middleware/devtools.ts

* fix: format issue

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2025-10-31 13:19:11 +09:00
Daishi Kato
ab5a98b187
test: fix for node 24 (#3278) 2025-10-31 13:17:00 +09:00
Ali Mert Çakar
670b60e19a
feat(devtool): inferred action type (#2987)
* feat(devtools middleware) add automatic action name finding

* docs(readme) add inferActionName example

* feat: update readmes

* feat: update devtools middleware and tests

* feat: remove inferActionName

---------

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>
2025-05-21 20:12:14 +09:00
Hong-Kuan Wu
b4177b3172
feat: add devtools.cleanup() method (#3111)
* feat(devtools): add cleanup method

* docs(devtools): add cleanup section

* reduce lines

* test(devtools): test if the connection removed after cleanup

---------

Co-authored-by: daishi <daishi@axlight.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2025-05-21 09:49:59 +09:00
Marcin Kulpa
8b9c374565
test: use @vitest/eslint-plugin (#2845) 2024-11-10 10:27:01 +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
Daishi Kato
66f3a029fb
chore: enable verbatimModuleSyntax in tsconfig (#2649) 2024-07-20 17:15:21 +09:00
Daishi Kato
d57072caf5
update vitest (#2462)
* update vitest

* use resolve

* patch for older ts

* for older ts

* hack with any

* for other builds

* wip: for umd

* Revert "wip: for umd"

This reverts commit a5c0d6beaa80cbbdcad7961b77d593effd6a83c8.

* wip: esm

* wip: system

* Revert "wip: system"

This reverts commit aa919631a94a5b321fa9f2ec6c26b826c37ca3b0.

* wip: umd

* wip: hack cjs

* system cannot be tested
2024-04-06 20:48:21 +09:00
Daishi Kato
c092d76260
chore(tests): suppress expected warnings (#2398) 2024-03-09 08:51:05 +09:00
Daishi Kato
9857a676a9
refactor: revisit prettier config to be minimal (#2193) 2023-11-14 12:19:51 +09:00
Daishi Kato
5777a65cf5
chore(deps): update dev dependencies (#1965) 2023-08-01 10:42:18 +09:00
Arjun Vegda
496a466c2c
chore(tests): migrate to vitest (#1753)
* test: migrate to vitest

* test: try #1 remove CI-MATRIX tags

* test: try 2 remove import/require replace

* chore: remove unused scripts/assignments

* chore(test-multiple-builds.yml): remove import/require replace script

* fix merging main

---------

Co-authored-by: daishi <daishi@axlight.com>
2023-05-04 13:25:24 +09:00
Daishi Kato
f37530fc3d
chore: add extentsion in imports (#1678)
* chore: add extentsion in imports

* fix github workflow

* revert for zustand/context

* do not patch :)

* fix workflow file

* update ts 5

* patch tsconfig

* use old typescript for react 16

* downlevel-dts to 3.8

* Revert "downlevel-dts to 3.8"

This reverts commit d03e5266e14146ed4a7c92e8a5cd2cb295727f69.

* patch workflow file

* patch for react 16

* remove ts3.4 in workflow

* skipLibChecks

* revert changes in test-multiple-versions.yml

* fix sed

* wip: add allowJs

* Revert "wip: add allowJs"

This reverts commit fca34d7d2decc1e469a733224f7680ab37792dc8.

* use ts 495

* useESM false

* Revert "useESM false"

This reverts commit 07a91d8acb14bc5839013aad47d0606dec312d62.

* no coverage

* no coverage 2

* no coverage 3

* wip

* disable transform

* revert a change

* revert changes

* test: try ignoring tests with dynamic imports

* test: skip tests that require/tests modules in isolation

* test: remove dynamic import

* run skipped tests on CI

* test: add new devtools imports to ci-only tests

* revert CI-ONLY-* hack

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* wip: workaround for react 16

* CI-MATRIX- for devtools CI hacks

* test: add env variable to test multiple builds workflow

* hack await import

* hack await import for another one

* wip: experimenting workflow file

* wip: experimenting workflow file

* wip: experimenting workflow file

* use different env name

* wip: experimenting workflow file

* do not use two envs

* revert to NODE_ENV

---------

Co-authored-by: Arjun <14841132+arjunvegda@users.noreply.github.com>
2023-05-02 06:28:46 +09:00
Daishi Kato
9062ca634f
chore: remove __DEV__ with ts-jest (#1598)
* wip: use ts-jest instead of swc/jest

* use esm in jest

* remove types/jest

* remove __DEV__

* fix rollup config

* fix github workflow

* hack jest.Mock

* wip: ts

* skipLibCheck for older ts 2

* wip: ts

* wip: workflow...

* wip: workflow...

* wip: workflow...

* experiment...

* experiment...2

* experiment...3

* experiment...4

* jest preset
2023-02-10 19:05:12 +09:00
Daishi Kato
0b55a3d74b
feat: deprecate default export (#1514) 2023-01-10 18:13:25 +09:00
Paul Pavlo Buidenkov
633c7dd7af
feat(middleware/devtools): Better redux devtools. One connection for all zustand stores (#1435)
* add example project for zustand devonly devtools with better rewind feature of redux devtools

* fix yarn install for demo

* remove lodash from demo

* adjust utils

* remove assets from demo project

* add codesandbox

* devtools for groups of stores

* remove command from .yml

* add tests

* cleanup

* Existing test cleanup

* Slight test cleanup; extract iife

* Slight cleanup

* Non-recursive S

* Remove initialState

Co-authored-by: Corin (CWStra) <cwstra@gmail.com>
2023-01-01 09:43:54 +09:00
Łukasz Rabiec
ed12c7edab
fix(types)(middleware/devtools): fix action type in devtools's setState (#1183)
* added payload to setState() in devtools middleware

* adjusted tests

* changed payload to any property name

* adjusted docs

* prettier readme.md

* adjusted for extends

* adjusted immer's setState

* Revert "adjusted immer's setState"

This reverts commit 50ce327bf0031a0ec61177b47733f397de036758.

* changed order of immer and devtools in tests

* added test for action with payload type in immer/devtools

* removed unnecessary test

* Update tests/middlewareTypes.test.tsx

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-08-19 07:10:50 +09:00
Daishi Kato
0ae0293e88
breaking(middleware/devtools): remove checking old string option (#933)
* breaking(middleware/devtools): remove checking old string option

* fix test

* fix test
2022-04-29 23:15:23 +09:00
M. Bagher Abiat
279bfb1e64
fix(middleware/devtools): add enabled option and show devtools warning only if enabled (#880)
* remove warning

* test

* rfc: enabled option

* debug

* update

* update

* [DEV-ONLY]

* [DEV-ONLY]

* let enable enabled

* let's enable enabled

* lint

* Update src/middleware/devtools.ts

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

* add tests for different cases

* refactor test

* fix test

* tweak mock in test

* fix merge main

Co-authored-by: daishi <daishi@axlight.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
2022-04-18 10:20:21 +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
Devansh Jethmalani
943af082ae
breaking(middleware/devtools): remove deprecations and warnings (#892)
* 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

* update uSES

* 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

* lock testing-library/react alpha version

* devtools: remove deprecations and warnings

* fix tests

* use `__DEV__`

* revert irrelevant v4 changes

* correct merge

* fix test

* fix `any`

* fix `any` again

Co-authored-by: daishi <daishi@axlight.com>
2022-04-09 02:27:28 +09:00
Daishi Kato
5b938fbbff
feat(build): use __DEV__ to control development mode (#789)
* feat(build): use __DEV__ to control development mode

* fix workflow

* missing env in systemjs build
2022-02-10 08:45:43 +09:00
Daishi Kato
5b3b963181
fix(middleware): revert devtools extension connector with try-catch (#724)
* fix(middleware): revert devtools extension connector with try-catch

* add a test case

Co-authored-by: Devansh Jethmalani <devanshj@users.noreply.github.com>
2021-12-24 16:09:46 +09:00
Devansh Jethmalani
cb99a36c59
devtools: minor fixes (#720) 2021-12-23 10:03:07 +09:00
Daishi Kato
c54d1df87b
fix(middleware): devtools work in non-browser (#693)
* fix(middleware): devtools work in non-browser

* early return

* add a test

Co-authored-by: Devansh Jethmalani <devanshj@users.noreply.github.com>
2021-12-07 16:06:41 +09:00
Devansh Jethmalani
58baf27476
rewrite devtools (#675)
* rewrite `devtools`

* style

* merge state instead of replace, fix lint

* fix lint, don't use `Array.prototype.at`

* fix typo

* more lint fixing

* feat: allow setting state from the devtools

* deference dispatch in the store to use latest `api.dispatch`
that gets replaced in devtools middleware
2021-12-03 22:12:31 +09:00