Pmndrs Jotai Versions Save

👻 Primitive and flexible state management for React

v2.2.1

11 months ago

This includes some improvements in jotai/utils. Especially, unstable_unwrap is getting to be stable.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.2.0...v2.2.1

v2.2.0

11 months ago

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

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.1.1...v2.2.0

v2.1.1

11 months ago

This version fixes some issues in edge cases.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.1.0...v2.1.1

v2.1.0

1 year ago

This includes some improvements as well as some breaking changes in unstable features.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.0.4...v2.1.0

v2.0.4

1 year ago

This includes some small improvements. One of them is to improve Deno compatibility.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.0.3...v2.0.4

v2.0.3

1 year ago

This release includes important features for upcoming devtools.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.0.2...v2.0.3

v2.0.2

1 year ago

This version add some small improvements, mostly for some minor cases.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.0.1...v2.0.2

v2.0.1

1 year ago

This adds various small improvements. Docs are also updated.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v2.0.0...v2.0.1

v2.0.0

1 year ago

🎉 🎉 🎉 Jotai v2 is here! 🍾 🍾 🍾

Backward compatible for JS users without async atoms

Async atom behavior is revisited and changed. TypeScript types are changed and improved.

New Store API

Exposes createStore which opens up new usages. With its power, it can be misused. Let's look for best practice. Feedback is appreciated.

Migration Guide

https://github.com/pmndrs/jotai/blob/v2.0.0/docs/guides/migrating-to-v2-api.mdx

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v1.13.1...v2.0.0

v1.13.1

1 year ago

Following v1.13.0, this version drops jotai/react/devtools entry point which was for pre-released v2 API. The same feature will be provided from jotai-devtools package.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/jotai/compare/v1.13.0...v1.13.1