Skip to content

v3 - #3337

Draft
dai-shi wants to merge 22 commits into
mainfrom
v3
Draft

v3#3337
dai-shi wants to merge 22 commits into
mainfrom
v3

Conversation

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jotai Ready Ready Preview Jul 30, 2026 6:50am

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown
More templates

npm i https://pkg.pr.new/jotai@3337

commit: 0088bab

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Size Change: -86.9 kB (-82.77%) 🏆

Total Size: 18.1 kB

📦 View Changed
Filename Size Change
dist/babel/plugin-debug-label.js 0 B -1.06 kB (removed) 🏆
dist/babel/plugin-react-refresh.js 0 B -1.26 kB (removed) 🏆
dist/babel/preset.js 0 B -1.55 kB (removed) 🏆
dist/esm/babel/plugin-debug-label.mjs 0 B -1.12 kB (removed) 🏆
dist/esm/babel/plugin-react-refresh.mjs 0 B -1.31 kB (removed) 🏆
dist/esm/babel/preset.mjs 0 B -1.62 kB (removed) 🏆
dist/esm/index.mjs 0 B -62 B (removed) 🏆
dist/esm/react.mjs 0 B -1.85 kB (removed) 🏆
dist/esm/react/utils.mjs 0 B -746 B (removed) 🏆
dist/esm/utils.mjs 0 B -67 B (removed) 🏆
dist/esm/vanilla.mjs 0 B -667 B (removed) 🏆
dist/esm/vanilla/internals.mjs 0 B -4.79 kB (removed) 🏆
dist/esm/vanilla/utils.mjs 0 B -5.18 kB (removed) 🏆
dist/index.js 60 B -182 B (-75.21%) 🏆
dist/react.js 139 B -1.67 kB (-92.32%) 🏆
dist/react/continuablePromise.js 540 B +540 B (new file) 🆕
dist/react/Provider.js 426 B +426 B (new file) 🆕
dist/react/useAtom.js 190 B +190 B (new file) 🆕
dist/react/useAtomValue.js 420 B +420 B (new file) 🆕
dist/react/useAtomValueRaw.js 426 B +426 B (new file) 🆕
dist/react/useAtomValueRawSync.js 325 B +325 B (new file) 🆕
dist/react/useSetAtom.js 321 B +321 B (new file) 🆕
dist/react/utils.js 122 B -1.28 kB (-91.3%) 🏆
dist/react/utils/useAtomCallback.js 201 B +201 B (new file) 🆕
dist/react/utils/useHydrateAtoms.js 319 B +319 B (new file) 🆕
dist/react/utils/useReducerAtom.js 374 B +374 B (new file) 🆕
dist/react/utils/useResetAtom.js 194 B +194 B (new file) 🆕
dist/system/babel/plugin-debug-label.development.js 0 B -1.22 kB (removed) 🏆
dist/system/babel/plugin-debug-label.production.js 0 B -900 B (removed) 🏆
dist/system/babel/plugin-react-refresh.development.js 0 B -1.41 kB (removed) 🏆
dist/system/babel/plugin-react-refresh.production.js 0 B -1.05 kB (removed) 🏆
dist/system/babel/preset.development.js 0 B -1.72 kB (removed) 🏆
dist/system/babel/preset.production.js 0 B -1.29 kB (removed) 🏆
dist/system/index.development.js 0 B -252 B (removed) 🏆
dist/system/index.production.js 0 B -185 B (removed) 🏆
dist/system/react.development.js 0 B -2.04 kB (removed) 🏆
dist/system/react.production.js 0 B -1.25 kB (removed) 🏆
dist/system/react/utils.development.js 0 B -859 B (removed) 🏆
dist/system/react/utils.production.js 0 B -465 B (removed) 🏆
dist/system/utils.development.js 0 B -257 B (removed) 🏆
dist/system/utils.production.js 0 B -190 B (removed) 🏆
dist/system/vanilla.development.js 0 B -737 B (removed) 🏆
dist/system/vanilla.production.js 0 B -349 B (removed) 🏆
dist/system/vanilla/internals.development.js 0 B -4.91 kB (removed) 🏆
dist/system/vanilla/internals.production.js 0 B -3.01 kB (removed) 🏆
dist/system/vanilla/utils.development.js 0 B -5.38 kB (removed) 🏆
dist/system/vanilla/utils.production.js 0 B -3.12 kB (removed) 🏆
dist/umd/babel/plugin-debug-label.development.js 0 B -1.2 kB (removed) 🏆
dist/umd/babel/plugin-debug-label.production.js 0 B -973 B (removed) 🏆
dist/umd/babel/plugin-react-refresh.development.js 0 B -1.4 kB (removed) 🏆
dist/umd/babel/plugin-react-refresh.production.js 0 B -1.12 kB (removed) 🏆
dist/umd/babel/preset.development.js 0 B -1.69 kB (removed) 🏆
dist/umd/babel/preset.production.js 0 B -1.36 kB (removed) 🏆
dist/umd/index.development.js 0 B -383 B (removed) 🏆
dist/umd/index.production.js 0 B -327 B (removed) 🏆
dist/umd/react.development.js 0 B -1.95 kB (removed) 🏆
dist/umd/react.production.js 0 B -1.34 kB (removed) 🏆
dist/umd/react/utils.development.js 0 B -1.54 kB (removed) 🏆
dist/umd/react/utils.production.js 0 B -1.02 kB (removed) 🏆
dist/umd/utils.development.js 0 B -395 B (removed) 🏆
dist/umd/utils.production.js 0 B -340 B (removed) 🏆
dist/umd/vanilla.development.js 0 B -794 B (removed) 🏆
dist/umd/vanilla.production.js 0 B -403 B (removed) 🏆
dist/umd/vanilla/internals.development.js 0 B -6.18 kB (removed) 🏆
dist/umd/vanilla/internals.production.js 0 B -3.84 kB (removed) 🏆
dist/umd/vanilla/utils.development.js 0 B -6.42 kB (removed) 🏆
dist/umd/vanilla/utils.production.js 0 B -3.75 kB (removed) 🏆
dist/utils.js 66 B -177 B (-72.84%) 🏆
dist/vanilla.js 115 B -570 B (-83.21%) 🏆
dist/vanilla/atom.js 350 B +350 B (new file) 🆕
dist/vanilla/internals.js 6.18 kB +166 B (+2.76%)
dist/vanilla/store.js 429 B +429 B (new file) 🆕
dist/vanilla/typeUtils.js 31 B +31 B (new file) 🆕
dist/vanilla/utils.js 245 B -6.06 kB (-96.11%) 🏆
dist/vanilla/utils/atomWithDefault.js 346 B +346 B (new file) 🆕
dist/vanilla/utils/atomWithLazy.js 185 B +185 B (new file) 🆕
dist/vanilla/utils/atomWithObservable.js 945 B +945 B (new file) 🆕
dist/vanilla/utils/atomWithReducer.js 154 B +154 B (new file) 🆕
dist/vanilla/utils/atomWithRefresh.js 322 B +322 B (new file) 🆕
dist/vanilla/utils/atomWithReset.js 226 B +226 B (new file) 🆕
dist/vanilla/utils/atomWithStorage.js 1.16 kB +1.16 kB (new file) 🆕
dist/vanilla/utils/constants.js 100 B +100 B (new file) 🆕
dist/vanilla/utils/freezeAtom.js 517 B +517 B (new file) 🆕
dist/vanilla/utils/selectAtom.js 468 B +468 B (new file) 🆕
dist/vanilla/utils/splitAtom.js 1.35 kB +1.35 kB (new file) 🆕
dist/vanilla/utils/unwrap.js 858 B +858 B (new file) 🆕

compressed-size-action

* [v3] drop old node

* fix test

* fix again
* [v3] drop rollup

* strict module

* some fixes
* [v3] drop old React

* fix ci test
* [v3] redesign buildingBlocks

* use key constants for better readability
@dai-shi

dai-shi commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@github-actions

Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "FAIL",
  "jotai-family": "FAIL",
  "jotai-scope": "FAIL",
  "waku-jotai": "FAIL"
}

https://github.com/pmndrs/jotai/actions/runs/29786205385

rerender()
value = store.get(atom)
}
useEffect(() => store.sub(atom, rerender), [store, atom])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a slight behavioral difference in useAtomValue between v2 and v3. I'm not sure if this is intentional or could cause an issue.

// before (in useAtomValue)
useEffect(() => {
  const unsub = store.sub(atom, () => {
    // ...
    rerender()
  })
  rerender() // <-- rerender was called on mount
  return unsub
}, [store, atom, delay, promiseStatus])

// after (in useAtomValueRaw)
useEffect(() => store.sub(atom, rerender), [store, atom])

In v2, rerender() was explicitly called on mount, whereas in v3 it seems to only be triggered by the subscription.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional and documented.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is intentional and one of the biggest reasons for the major bump. Suggestions are welcome to improve the docs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't open a PR myself (locked to collaborators), so here's an attempt to better explain the differences between the three hooks: https://github.com/pmndrs/jotai/compare/v3...Wendystraite:jotai:v3_docs?expand=1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3360 is open.

@dai-shi

dai-shi commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

@arjunvegda Could you work on migrating jotai-devtools?

@dai-shi dai-shi mentioned this pull request Jul 23, 2026
@dai-shi

dai-shi commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@github-actions

Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "PASS",
  "jotai-family": "FAIL",
  "jotai-scope": "PASS",
  "waku-jotai": "FAIL"
}

https://github.com/pmndrs/jotai/actions/runs/30414312160

@dai-shi

dai-shi commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@github-actions

Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "PASS",
  "jotai-family": "FAIL",
  "jotai-scope": "PASS",
  "waku-jotai": "FAIL"
}

https://github.com/pmndrs/jotai/actions/runs/30414618853

@dmaskasky

Copy link
Copy Markdown
Collaborator

/ecosystem-ci run

@github-actions

Copy link
Copy Markdown

Ecosystem CI Output

---- Jotai Ecosystem CI Results ----
{
  "bunshi": "PASS",
  "jotai-devtools": "FAIL",
  "jotai-effect": "PASS",
  "jotai-family": "PASS",
  "jotai-scope": "PASS",
  "waku-jotai": "FAIL"
}

https://github.com/pmndrs/jotai/actions/runs/30465381178

* doc: explain loadable deprecation in v3 doc

* doc: explain differences between atom hooks

* doc: reword useAtomValueRaw return value explanations

Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>

---------

Co-authored-by: Wendy FOUCHTER <wendy.fouchter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants