Comments (7)
Thanks for reporting! Could you please help me reproduce this?
It seems to work fine for me locally in our Storybook playground. I'm using [email protected]
and the latest version of dev tools.
![image](https://private-user-images.githubusercontent.com/14841132/354416152-3ae9f327-6afb-4e23-950f-f7d96dcb6633.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMzMjg4NTMsIm5iZiI6MTcyMzMyODU1MywicGF0aCI6Ii8xNDg0MTEzMi8zNTQ0MTYxNTItM2FlOWYzMjctNmFmYi00ZTIzLTk1MGYtZjdkOTZkY2I2NjMzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODEwVDIyMjIzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5MTFjNzcyMGViNTY5OWM0YTc4ODQzMzVmZjRmZjZiMTU3N2Q3NGUwMjcyYTAwMmFkZTEwM2Y4NWEyYWJhMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0b25XMvYZnvyD51Z9F8nUcVKsELy9oQEMzqkuuPVWM8)
from jotai-devtools.
Sure, created a reproduction branch at https://github.com/axel-havukangas-tt/jotai-devtools/tree/158-repro where I updated to jotai version 2.9.1.
Interestingly, in the jotai-devtools sandbox, the warning message doesn't appear for all atoms. But at least appears when pressing the "TOGGLE RESULT" button:
Screen.Recording.2024-08-02.at.7.56.13.mov
Our app has a lot of async initialisations, so might be that the warning messages actually only comes in situations where an async operation updates an atom.
from jotai-devtools.
Investigated the issue a bit more, and seems to be somehow related to https://github.com/jotaijs/jotai-devtools/blob/main/src/utils/useAtomsSnapshot.ts#L110 where the hooks state update is not deferred when the store subscription triggers a callback. Not sure what change has caused the warnings to trigger here though.
from jotai-devtools.
Okay, after some more investigation it seems that the culprit is the different implementations of the composeWithDevTools
for the v1 and v2 stores. The v1 store doesn't emit any events on atom get, while the v2 implementation calls subscribes on get events.
Not sure what the reasoning is behind the extended store subscription in the v2 implementation, but one possible solution would be to skip the atom read events in the useAtomsSnapshot
hook store subscription.
from jotai-devtools.
If I can get some confirmation that my investigation is sane, and this is a reasonable approach to fix the issue, then I could make a PR next week that would add some event filtering to the store subscriptions so that the atomsSnapshot isn't unnecessarily updated on atom reads (which obviously shouldn't affect the returned value).
from jotai-devtools.
Thank you so much for your thorough investigation, @axel-havukangas-tt! I believe we can completely remove this line, as it seems unnecessary now.
Initially, I thought it was required for TimeTravel to sync the history for async atoms, but with async-get
in place, it's no longer needed.
Would you like to open a PR?
from jotai-devtools.
Yeah, if it seems like the whole get
callback isn't needed then it is probably cleaner to just remove that from the v2 store composition implementation.
Created a PR at #160
from jotai-devtools.
Related Issues (20)
- Uncaught ReferenceError: process is not defined (jsondiffpatch) HOT 4
- Issue with NextJs 13 and Mantine v7 HOT 2
- Feature request: make the UI minimize on ESC
- Chrome Extension?
- How can i use devtools in build for test server
- Atom rendering hangs on complex objects (such as the Firebase User object) HOT 4
- jotai-devtools not working with PNPM (declare jotai as a dependency) HOT 2
- Devtools error/crashing with NextJS 14.1 HOT 8
- [Feature Request] Trace source of atom updates
- [Feature Request] Performance Profiling Tools
- [Feature Request] Improve `jotai-scope` support HOT 1
- Missing style.css HOT 2
- CSS leaking HOT 17
- MantineThemeProvider.tsx:11 Uncaught Error: @mantine/core: MantineProvider was not found in component tree, make sure you have it in your app HOT 2
- Dark mode selection forgotten after page refresh HOT 1
- CSS leaking override mantine styles HOT 13
- I faced an issue when clicking on the Time Travel. HOT 1
- React 16 compatibility HOT 1
- Jotai Devtools spits out a mismatched server/client props warning when used in Nextjs 14 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jotai-devtools.