📦 Bump jotai from 1.13.1 to 2.8.0
Bumps jotai from 1.13.1 to 2.8.0.
Release notes
Sourced from jotai's releases.
v2.8.0
This version introduces a new feature
atomWithLazyand deprecatesuseReducerAtomandfreezeAtomCreator. It also introduces an experimental store implementation injotai/experimental.Migration Guide
selectAtom
selectAtomwill no longer internally unwrap promises. To migrate to the new api, use theunwraputility fromjotai/utilspackage.// 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
unwrapfrom '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 )
useReducerAtomhttps://jotai.org/docs/recipes/use-reducer-atom
freezeAtomCreatorhttps://jotai.org/docs/guides/debugging#freezeatomcreator
What's Changed
- [BREAKING] selectAtom does not resolve promises internally by
@​dmaskaskyin pmndrs/jotai#2435- New store implementation as
store2.tsby@​dai-shiin pmndrs/jotai#2463- feat(utils): atomWithLazy for lazily initialized primitive atoms. by
@​iwoplazain pmndrs/jotai#2465- deprecate useReducerAtom by
@​dai-shiin pmndrs/jotai#2467- fix(babel): do not depend on path by
@​dai-shiin pmndrs/jotai#2482- fix(utils): improve freezeAtom and freezeAtomCreator by
@​backbone87in pmndrs/jotai#2476- deprecate freezeAtomCreator by
@​dai-shiin pmndrs/jotai#2490New Contributors
@​frameflaremade their first contribution in pmndrs/jotai#2483Full Changelog: https://github.com/pmndrs/jotai/compare/v2.7.2...v2.8.0
... (truncated)
Commits
1b4eb452.8.02d2f03afix(utils): dev-only deprecation message (#2491)a3be09efix(store): remove dev3 methods and add dev4 methods only in store2 (#2484)88303acadd memory leak test (#2487)2abd51cdeprecate freezeAtomCreator (#2490)93a28f4fix(vanilla): setters do not freeze new values (#2476)2ca8339chore: old ts versions to test in ci (#2489)c09843achore(deps): update dev dependencies (#2479)93a6fb9refactor atomWithLazy (#2485)1049ae1docs: fix some typos (#2483)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)