Releases: pmndrs/jotai
v2.2.3
This comes with some small improvements.
What's Changed
- fix: declare @types/react as peerDep to avoid phantom dep by @wjw99830 in #2048
- fix(vanilla): check duplicated instances by @dai-shi in #2049
New Contributors
Full Changelog: v2.2.2...v2.2.3
v2.2.2
This includes some fixes for edge cases.
What's Changed
- fix(vanilla): bail out recomputing with the same value by @dai-shi in #2016
- fix(utils): loadable handles sync errors by @dai-shi in #2021
New Contributors
- @vossmalte made their first contribution in #2006
Full Changelog: v2.2.1...v2.2.2
v2.2.1
This includes some improvements in jotai/utils
. Especially, unstable_unwrap
is getting to be stable.
What's Changed
- feat(utils/useHydrateAtoms) - Optionally rehydrate with force hydrate by @SariSabouh in #1990
- fix(utils): revert atomWithStorage typing by @dai-shi in #1994
- fix(utils): improve selectAtom typing by @dai-shi in #1995
- fix(utils): improve unstable_unwrap for sometimes async atom by @dai-shi in #1996
- fix(utils): unstable_unwrap to support writable atom by @dai-shi in #1997
New Contributors
- @SariSabouh made their first contribution in #1990
Full Changelog: v2.2.0...v2.2.1
v2.2.0
It includes a few improvements. Some utils are rewritten as there was a misconception when migrating from v1. ESM builds are optimized for Vite users.
Migration Guide for jotai/utils
atomWithDefault
// suppose we have this
const asyncAtom = atom(() => Promise.resolve(1))
const countAtom = atomWithDefault((get) => get(asyncAtom))
// and in component
const setCount = useSetAtom(countAtom)
// previously,
setCount((c) => c + 1) // it worked, but it will no longer work
// instead, you need to do this
setCount((countPromise) => countPromise.then((c) => c + 1))
atomWithStorage
// suppose we have async storage
const storage = createJSONStorage(() => AsyncStorage)
const countAtom = atomWithStorage('count-key', 0, storage)
// in component
const [count, setCount] = useAtom(countAom)
// previously, countAtom is a sync atom, so you could update like this:
setCount((c) => c + 1)
// with the new version, it becomes async occasionally, so you need to resolve it:
setCount(async (c) => (await c) + 1)
What's Changed
- breaking(utils): predictable atomWithDefault by @dai-shi in #1939
- breaking(utils): improve atomWithStorage by @dai-shi in #1958
- feat(vanilla): new store listeners for devtools by @dai-shi in #1966
- fix(build): mode env for "import" condition" by @dai-shi in #1978
New Contributors
- @reinierkaper-carewell made their first contribution in #1980
Full Changelog: v2.1.1...v2.2.0
v2.1.1
This version fixes some issues in edge cases.
What's Changed
- fix(vanilla): Stable promise by @backbone87 in #1933
- fix(vanilla): update atoms with tree structure dependencies (regression from v1) by @dai-shi in #1959
- fix: prefer PromiseLike where appropriate by @dai-shi in #1967
New Contributors
- @blissdev made their first contribution in #1945
- @hwanyoungChoi made their first contribution in #1957
- @alexhad6 made their first contribution in #1971
- @backbone87 made their first contribution in #1933
Full Changelog: v2.1.0...v2.1.1
v2.1.0
This includes some improvements as well as some breaking changes in unstable features.
What's Changed
- fix(vanilla): better promise handling by @dai-shi in #1851
- fix(atomWithStorage): handle RESET/removeItem from cross-tab storage updates by @nderscore in #1882
- breaking(vanilla): remove deprecated store dev methods by @dai-shi in #1893
- fix(react): Infer useHydrateAtoms value types from atom.read ReturnType by @ericdowell in #1898
- chore(tests): migrate to vitest by @arjunvegda in #1839
New Contributors
- @lloydrichards made their first contribution in #1865
- @todorone made their first contribution in #1878
- @eikonomega made their first contribution in #1885
- @milhamm made their first contribution in #1903
- @RIP21 made their first contribution in #1907
- @ericdowell made their first contribution in #1898
Full Changelog: v2.0.4...v2.1.0
v2.0.4
This includes some small improvements. One of them is to improve Deno compatibility.
What's Changed
- fix(atomWithStorage, createJSONStorage): scope subscriptions to specified browser storage by @nderscore in #1814
- fix(babel): improve debug label support for third-party jotai libraries by @arjunvegda in #1818
- fix(react): atom type inference in hooks by @Thisen in #1866
- chore: add extentsion in imports by @dai-shi in #1823
New Contributors
- @Etesam913 made their first contribution in #1810
- @haywirez made their first contribution in #1828
- @amirhhashemi made their first contribution in #1830
- @Fonger made their first contribution in #1835
- @satyamgupta1495 made their first contribution in #1825
- @FoundTheWOUT made their first contribution in #1846
- @nderscore made their first contribution in #1814
- @manakuro made their first contribution in #1860
Full Changelog: v2.0.3...v2.0.4
v2.0.3
This release includes important features for upcoming devtools.
What's Changed
- feat: add 'debugPrivate' flag to atom by @arjunvegda in #1779
- fix(build): possibly improve ESM for production build by @dai-shi in #1780
- feat: add dev_subscribe_store by @arjunvegda in #1790
- fix(utils, types): added export of Loadable type by @arjunvegda in #1806
New Contributors
- @himself65 made their first contribution in #1789
- @wenq1 made their first contribution in #1805
Full Changelog: v2.0.2...v2.0.3
v2.0.2
This version add some small improvements, mostly for some minor cases.
What's Changed
- fix(vanilla): async derived atom not updated (race condition in an edge case) by @gimelfarb in #1768
- fix(utils): tweak atomWithDefault types for better DX by @dai-shi in #1770
- fix(build): UMD names by @dai-shi in #1772
New Contributors
- @arjunvegda made their first contribution in #1773
- @gimelfarb made their first contribution in #1768
Full Changelog: v2.0.1...v2.0.2
v2.0.1
This adds various small improvements. Docs are also updated.
What's Changed
- fix(build): improve patch scripts by @dai-shi in #1736
- fix(vanilla/utils): improve selectAtom for more use cases by @dai-shi in #1738
- fix(vanilla): type utils by @dai-shi in #1741
- chore: remove
__DEV__
with ts-jest by @dai-shi in #1742 - fix(build): reorder the types field in package.json by @HiChen404 in #1753
- fix(react): avoid JSX transform for <= React 18 interop by @CodyJasonBennett in #1759
New Contributors
- @revskill10 made their first contribution in #1726
- @Odonno made their first contribution in #1728
- @naixy28 made their first contribution in #1740
- @HiChen404 made their first contribution in #1753
- @CodyJasonBennett made their first contribution in #1759
Full Changelog: v2.0.0...v2.0.1