* 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>
* feat(react): implement getServerState by closing over the defaultState
serverState will be used by react on the first client render; this should avoid hydration mismatches when combined with the persist middleware, which can change the state between the SSR and the first CSR
* define getServerState in vanilla.ts
* feat: implement getServerResult in persist middleware
this avoids hydration errors when state is restored from e.g. localstorage synchronously
* feat: capture initialState for getServerState in react
this avoids hydration mismatches when updates happen to the store state between ssr and csr
* refactor: revert changes to oldImpl
* fix: make selector default to identity function
if we default to `api.getState`, we will always read the client snapshot if there is no selector passed. An identity function returns its argument, which is either the snapshot (api.getState) or the server snapshot (api.getServerState)
* define getInitialState in vanilla
* revert WithReact
* fix them
* fix test
* oops, fix another test too
* forgot to use identity
* test: add a test for hydration errors
* fix(readme): imply getInitialState is a public api
---------
Co-authored-by: daishi <daishi@axlight.com>
* feat: non-object state
* add test
* prefer unknown
* fix types for persist and subscribeWithSelector
* no Cast in persist and subscribeWithSelector
* simplify immer type
* simplify devtools type
* simplify redux type
* simplify type with looser action
* fix StoreApi type parameter
* fix types
* feat(types): better middleware support
* some more trial
* some more trial
* Revert "some more trial"
This reverts commit c54bf7cb75faa58e6df4325679ea5f815b594d01.
* some more trial
* some more trial
* some more trial
* some more trial
* Revert "some more trial"
This reverts commit 3aef9e229a54f18a901a1aea557cb05b46e8f2ab.
* some more trial
* Revert "some more trial"
This reverts commit fce0cb4c3e012adb35e5240e64d31cde3f7790f8.
* some more trial
* some more trial
* some more trial
* some more trial
* add redux middleware type test
* fix with type alias
* add devtools and redux combination test
* combine to support named set
* remove duplicated types
* Remove usage of `any` from tests
* Improve
* Improve
* Replace @ts-ignore with @ts-expect-error
* Fix TS errors
* Apply suggested solution to 'can get the store'
* Remove any from 'can set store' (TS doesn't like it, though)
* Yay
* Use more precise type
* (types): improve types for setState
allow for passing multiple key generics to PartialState; this will make sure that we can have paths in the PartialState setter function that return different keys
* (types): improve types for setState
replace `name` with `something`. for some reason, the property `name` does not yield errors :/
* (types): improve types for setState
streamline generic default values in middleware.ts with those in vanilla.ts
* (types): improve types for setState
use generic type S instead of State (S extends State)
* Remove undesired index signature
* Use type assertion
* Update TypeScript readme
* Update TypeScript readme
* Replace Record with object
* Remove unnecessary keyof
* Minor fixes
* (types): improve types for setState
instead of using Partial, which would allow setting every field to undefined, we infer the types of the values depending on the keys passed into the set function
* (types): improve types for setState
add code comment to clarify why we are using Pick<T, K> | T
* (types): improve types for setState
apply the same changes we did for SetState also to namedSet for the devtools middleware
* (types): improve types for setState
tests for the partial logic
* empty commit
Co-authored-by: daishi <daishi@axlight.com>
* fixed an issue in type infering while using eq function in hooks
* moving back quotes removed by autoformatter
* tweaked test and run linter
* Update tests/basic.test.tsx
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>