Skip to content

Releases: pmndrs/jotai

v1.3.9

10 Oct 13:01
Compare
Choose a tag to compare

Summary

There was an edge-case issue with async atoms reported #751, which is fixed. Other changes are basically refactoring, but they may fix some potential bugs.

What's Changed

  • fix(core): resolve infinite loop with chained async dependencies by @dai-shi in #766
  • fix(query): improve atomWith(Infinite)Query with enabled by @dai-shi in #767
  • fix(core): improve reading atom state by @dai-shi in #768
  • fix(core): promise handling in store by @dai-shi in #769

Full Changelog: v1.3.8...v1.3.9

v1.3.8

07 Oct 11:06
Compare
Choose a tag to compare

Summary

jotai/utils

  • atomWithHash takes options object for more customization
    • the old signature (serialize/deserialize functions) is deprecated and will be remove in the next version

jotai/valtio

  • atomWithProxy takes options object for enable sync option

PRs

  • #752 fix(valtio): Add option for atomWithProxy to be synchronous
  • #758 fix(utils): atomWithHash options

v1.3.7

01 Oct 14:13
Compare
Choose a tag to compare

Summary

v1.3.4-1.3.6 accidentally requires newer node.js versions. v1.3.7 fixes it by reverting exports format.
This also fixes handling async atoms with chained dependency, which solves some cases.

PRs

  • #734 refactor(utils): loadable util
  • #735 refactor(core): commitAtom in store
  • #747 fix(core): resume from suspense on derived atom with async atom dependency
  • #748 fix(package): avoid subpath pattern in exports

v1.3.6

24 Sep 13:31
Compare
Choose a tag to compare

⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0

Summary

This fixes a false positive warning in some environments reported in #709. It also comes with some refactoring for more code maintainability.

PRs

  • #717 refactor(core,utils,devtools): add dev methods in store
  • #719 chore(build): pin esbuild for now and replace size plugin with github action
  • #727 refactor(core): interruptable promise implementation
  • #730 fix(core,utils): support unknown error type
  • #732 chore(build): upgrade and unpin esbuild and fix compressed size action

v1.3.5

17 Sep 09:58
Compare
Choose a tag to compare

⚠️ Minimum requirements for Node.js (for server-side usage like Next.js): v14.13.0, v12.20.0

Summary

v1.3.4 requires node >= 14 in package.json, which may cause some issues in certain envs. As we don't require it, this reverts back to node >= 12. This also adds babel preset in jotai/babel.

PRs

  • #706 feat(babel): Babel preset for Jotai
  • #710 refactor(utils,immer,optics): with memoizeAtom
  • #716 fix(build): Switch back to Node 12

v1.3.4

13 Sep 13:03
Compare
Choose a tag to compare

⚠️ Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0

Summary

jotai

  • Fix a bug that prevented to recover from async atom errors

jotai/utils

  • Add a new loadable util which allows to avoid using <Suspense>

jotai/babel

  • Add new "experimental" babel plugin to auto-attach .debugLabel to atom configs
    • Feedback is very welcomed.

PRs

  • #701 fix(core,query): handle edge cases with writeAtom returning a promise
  • #678 refactor: stricter tsconfig
  • #704 chore(build): simplify exports and support nested subpath
  • #705 fix(core): Allow retries for errored async reads
  • #698 feat(utils): Add loadable
  • #697 feat(babel): Babel plugin: debug-label

v1.3.3

09 Sep 14:37
Compare
Choose a tag to compare

Summary

jotai

Previously, writing atom returns always void, but this was troublesome when a derived atom has a custom write function which returns a promise. Now, it returns a promise if write returns a promise.

PRs

  • #687 refactor(core): re-implement useAtom with useReducer
  • #689 fix(core): return promise void on write atom and set

v1.3.2

27 Aug 14:39
Compare
Choose a tag to compare

Summary

There was an issue in v1.3.1 with regard to CJS/ESM exports. Please use v1.3.2 instead.

PRs

  • #679 Rollback to initial exports structures with duplicated .js and .mjs files for additional support of bundlers

v1.3.1

25 Aug 15:48
Compare
Choose a tag to compare

Summary

This changed the exports config to match with nodejs standard. If you experience some issues with your bundlers feel free to open issues to report them.

jotai/core

  • Some code refactoring was done, which also changed other jotai/* bundles accordingly.

jotai/query

  • Support enabled option (Previously, it wasn't working properly)
  • Support infinite query page refresh

jotai/urql

  • Support pause option
  • Support reexecute callback

PRs

  • #648 refactor: rename store to scope container
  • #650 refactor: new store.ts based on old vanilla.ts
  • #652 Fix(useAtomsSnapshot): Only use values in snapshots
  • #653 fix(query): improve initial data method
  • #654 refactor(core): remove duplicated code
  • #665 feat(query): enabled functionality
  • #655 fix(urql): support pause option
  • #670 feat(query): infinite query page refresh
  • #657 ESM/CJS Exports addition
  • #668 feat(urql): support reexecute in atomWithQuery

v1.3.0

10 Aug 10:03
Compare
Choose a tag to compare

Summary

jotai

We fixed atom scope feature. useAtom now takes optional scope in the second argument and atom.scope is deprecated. As it falls back to the previous behavior, the core is not breaking. (However, other jotai/* has breaking changes in atom scope handling.)

jotai/utils

  • New experimental useHydrateAtoms hook to restore atom values in render.
  • Fixed performance related issues for waitForAll and useAtomCallback.

PRs

  • #633 fix(weakCache): Replace recursion with while loop to avoid too much recursion
  • #646 refactor(core): useMutableSource emulation without symbol and any
  • #640 breaking: useAtom scope instead of atom scope
  • #637 Feature: useHydrateAtoms
  • #644 fix(utils): improve useAtomCallback performance