Skip to content

chore(deps): bump jotai-effect from 1.0.0 to 2.0.2 #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 28, 2025

Bumps jotai-effect from 1.0.0 to 2.0.2.

Release notes

Sourced from jotai-effect's releases.

v2.0.0

We’re excited to announce the release of jotai-effect v2, which brings a single but significant change to the core API: atomEffect now runs synchronously whenever it mounts or its dependencies change. This update improves consistency, helps avoid race conditions, and keeps related state changes in sync.


What’s New?

Synchronous atomEffect

  • In v1, atomEffect would run asynchronously in the next microtask.
  • In v2, atomEffect runs synchronously on mount and whenever the dependencies it uses have changed.
  • Batching is still supported when you update multiple dependencies in a single writable atom. The effect runs only after that writable atom has finished all its updates, preventing partial updates or intermediate states.

Example:

const syncEffect = atomEffect((get, set) => {
  get(someAtom)
  set(anotherAtom)
})
const store = createStore()
store.set(someAtom, (v) => v + 1)
// The effect above runs immediately, so anotherAtom is updated in the same microtask
console.log(store.get(anotherAtom)) // Updated by atomEffect synchronously

When someAtom is updated, the effect runs immediately, updating anotherAtom in the same turn. If you update multiple atoms in the same writable atom, these changes are batched together, and atomEffect runs after those updates complete.


Migration Guide

For most users, no change is required. If you depended on the old microtask delay or cross-atom batching, read on.

1. Adding back the microtask delay

If your logic explicitly relied on atomEffect running in a separate microtask, you can reintroduce the delay yourself:

Before (v1)

const effect = atomEffect((get, set) => {
  console.log('effect')
  return () => {
    console.log('cleanup')
  }
})

After (v2)

... (truncated)

Commits
  • d0422bc chore: update version to v2.0.2
  • 8f9f73f fix: ensure effect runs when another effect changes deps (#65)
  • 54fa00f update README and LICENSE
  • a2f5c44 safely access process global if it exists (#64)
  • 9f4ac62 [Breaking] feat: synchronous atomEffect (#62)
  • 52ff1c1 fix: esm builds (#61)
  • 8eda178 update version to 1.1.5
  • baddc8a adjust exports to support non-ts environments
  • 9568194 use a typeof not function cleanup guard instead (#59)
  • a39282a update version to 1.1.4
  • Additional commits viewable in compare view

Dependabot compatibility score

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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will 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 version will 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 dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [jotai-effect](https://github.com/jotaijs/jotai-effect) from 1.0.0 to 2.0.2.
- [Release notes](https://github.com/jotaijs/jotai-effect/releases)
- [Commits](jotaijs/jotai-effect@v1.0.0...v2.0.2)

---
updated-dependencies:
- dependency-name: jotai-effect
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Apr 28, 2025
Copy link
Contributor Author

dependabot bot commented on behalf of github Jun 16, 2025

Superseded by #192.

@dependabot dependabot bot closed this Jun 16, 2025
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/jotai-effect-2.0.2 branch June 16, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants