Releases: pmndrs/jotai
v2.8.2
This fixes another edge case and improves utils for more flexibility.
What's Changed
- fix(store2): "stuck" derived atoms where some derivations may never resolve by @backbone87 in #2448
- feat(utils): allow providing a subscribe method to createJSONStorage util by @mhsattarian in #2539
- fix(vanilla): fix store.ts for an edge case by @dai-shi in #2567
New Contributors
- @mhsattarian made their first contribution in #2539
Full Changelog: v2.8.1...v2.8.2
v2.8.1
This fixes a regression in v2.6.4 and a regression in v2.7.0.
What's Changed
- feat: add back dev4_restore_atoms to store v2 by @arjunvegda in #2509
- fix(core): update atom value with conditional dependencies (regression with #2363) by @probeiuscorp in #2534
- fix(store): properly update atom values with edge-case dependency by @dai-shi in #2555
New Contributors
- @lazybean made their first contribution in #2492
- @linjiajian999 made their first contribution in #2496
- @do7be made their first contribution in #2505
- @faizanu94 made their first contribution in #2507
- @ouweiya made their first contribution in #2514
- @trongthanh made their first contribution in #2524
- @probeiuscorp made their first contribution in #2534
Full Changelog: v2.8.0...v2.8.1
v2.8.0
This version introduces a new feature atomWithLazy
and deprecates useReducerAtom
and freezeAtomCreator
. It also introduces an experimental store implementation in jotai/experimental
.
Migration Guide
selectAtom
selectAtom
will no longer internally unwrap promises. To migrate to the new api, use the unwrap
utility from jotai/utils
package.
// suppose we have this
const baseAtom = atom(Promise.resolve({ id: 0, name: 'test' }))
// previously selectAtom would internally unwrap promises.
const idAtom = selectAtom(
baseAtom,
({ name }) => name,
(prev, curr) => prev.id === curr.id
)
// instead, you need to import `unwrap` from 'jotai/utils' and pass the unwrapped atom
import { unwrap } from 'jotai/utils'
...
const idAtom = selectAtom(
unwrap(baseAtom),
({ name }) => name,
(prev, curr) => prev.id === curr.id
)
useReducerAtom
https://jotai.org/docs/recipes/use-reducer-atom
freezeAtomCreator
https://jotai.org/docs/guides/debugging#freezeatomcreator
What's Changed
- [BREAKING] selectAtom does not resolve promises internally by @dmaskasky in #2435
- New store implementation as
store2.ts
by @dai-shi in #2463 - feat(utils): atomWithLazy for lazily initialized primitive atoms. by @iwoplaza in #2465
- deprecate useReducerAtom by @dai-shi in #2467
- fix(babel): do not depend on path by @dai-shi in #2482
- fix(utils): improve freezeAtom and freezeAtomCreator by @backbone87 in #2476
- deprecate freezeAtomCreator by @dai-shi in #2490
New Contributors
- @frameflare made their first contribution in #2483
Full Changelog: v2.7.2...v2.8.0
v2.7.2
Mostly refactors.
What's Changed
- refactor(vanilla): moved (un)mount guards into their respective functions. (suggestion) by @iwoplaza in #2457
- fix(vanilla): improve dual instance warning in DEV by @dai-shi in #2462
- refactor: no-any by @dai-shi in #2471
- fix: avoid slow types by @dai-shi in #2472
Full Changelog: v2.7.1...v2.7.2
v2.7.1
This fixes a regression in v2.7.0.
What's Changed
- fix(vanilla): store should flush pending write triggered asynchronously and indirectly by @iwoplaza in #2451
- fix(utils): atomWithStorage to always run onMount by @dai-shi in #2455
New Contributors
- @rothsandro made their first contribution in #2426
- @NehalDamania made their first contribution in #2441
- @tien made their first contribution in #2446
- @ashuvssut made their first contribution in #2445
Full Changelog: v2.7.0...v2.7.1
v2.7.0
We've improved the use of WeakMap for better memory management. Please report to us if any regressions are found.
What's Changed
- feat: atomWithRefresh by @dai-shi in #2393
- refactor: make
pendingMap
a WeakMap for better memory management by @dai-shi in #2396 - fix(utils): make 'unwrap' and 'loadable' able to access async atom's resolved value immediately by @iwoplaza in #2417
- fix(types): withStorageValidator by @dai-shi in #2418
- build: change rollup target to ES2018 by @amirhhashemi in #2419
Full Changelog: v2.6.5...v2.7.0
v2.6.5
Some type improvements!
What's Changed
- fix(types): useAtom with one type argument for primitive atoms by @dai-shi in #2386
- fix(types): fix withStorageValidator type by @dai-shi in #2410
New Contributors
- @henrikvilhelmberglund made their first contribution in #2391
Full Changelog: v2.6.4...v2.6.5
v2.6.4
Performance improvement! Check it out!
What's Changed
- refactor: refactoring store and options type by @ssi02014 in #2360
- refactor: modified Args type by @ssi02014 in #2367
- Improve performance of recomputeDependents by @samkline in #2363
- fix(vanilla): fix unexpected cache in jotai-scope by @yf-yang in #2371
New Contributors
- @ssi02014 made their first contribution in #2360
- @samkline made their first contribution in #2363
- @yf-yang made their first contribution in #2371
Full Changelog: v2.6.3...v2.6.4
v2.6.3
Some improvements in core and utils 👏
What's Changed
- fix: atoms should not remount on recalculations (with async dependencies) by @dmaskasky in #2347
- fix(utils): atomWithReducer for jotai-scope by @dai-shi in #2351
- fix(utils/atomWithStorage): defaultStorage with disabled local storage crashes on mount by @benediktschlager in #2354
- feat(vanilla): customizable atom.unstable_is by @dai-shi in #2356
New Contributors
- @SpringHgui made their first contribution in #2320
- @sakurawen made their first contribution in #2358
- @JoltCode made their first contribution in #2357
- @benediktschlager made their first contribution in #2354
Full Changelog: v2.6.2...v2.6.3
v2.6.2
Some improvements for atomWithStorage. Feedback is welcome.
What's Changed
- fix(vanilla): should mount once with atom creator atom by @nogaten in #2319
- feat(utils): createJSONStrage options by @dai-shi in #2324
- feat(utils): add withStorageValidator by @dai-shi in #2336
New Contributors
- @L-Qun made their first contribution in #2318
- @ahme-dev made their first contribution in #2332
- @nogaten made their first contribution in #2319
Full Changelog: v2.6.1...v2.6.2