-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
🏝️ TanStack Query DevTools for Expo/React Native! 🚀 #8846
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4b3e884
test
LovesWorking f7b02b4
feat(devtools): add action event types and notify functionality for q…
LovesWorking 16b0e7d
cleanup commeny
LovesWorking 10074bf
fix(devtools): update notifyDevtools to use queryClient for all actio…
LovesWorking 33cabd4
remove dup call
LovesWorking e7150fc
Fix online manager bug not syncing correctly
LovesWorking 2ec65f3
Update docs
LovesWorking cff1c33
Merge branch 'main' into main
LovesWorking 89ffabe
Merge branch 'main' into main
TkDodo 874bb10
Fix default case error due to additional events from dev tools.
LovesWorking 452bf71
Merge branch 'main' into main
LovesWorking 3aba238
Merge branch 'main' into main
LovesWorking 5cae570
Merge branch 'TanStack:main' into main
LovesWorking 43bab78
Merge branch 'TanStack:main' into main
LovesWorking fc1652b
Add events
LovesWorking 28cafec
ci: apply automated fixes
autofix-ci[bot] 504f598
Remove no longer needed code
LovesWorking 4d087a6
ci: apply automated fixes
autofix-ci[bot] 83d815e
revert previous change
LovesWorking 1cc4752
undo minor text change
LovesWorking f242647
ci: apply automated fixes
autofix-ci[bot] 74bef6e
Merge branch 'main' into main
TkDodo 7b11c9f
Update packages/query-devtools/src/Devtools.tsx
TkDodo daf0da1
Apply suggestions from code review
TkDodo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TkDodo marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think these should be here. The actions listened on the NotifyEvents are events that are dispatched from our query reducer. Consumers can listen to those to observe updates that happen in the cache. When the devtools trigger an update that will result in an internal state change, those changes will automatically be propagated.
Can you explain why those were added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other ideas to capture action events that's reliable? I added these, so I know exactly what action is pressed to forward the action to mobile. it just seemed like the easiest approach to subscribe to query events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I don’t understand what you’re trying to do. Why do you need to capture an event that happens in the devtools? Capture it where?
Assume I understand nothing about react native and expo (which is 99% true) and try to break down for me what you’re doing. If you want to listen to events from the devtools, doing that by dispatching an event on the queryCache and then listening to that is pretty likely not the right approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My plugin includes a web view that runs the React Query DevTools. The challenge I’m facing is linking DevTools actions to another client—in this case, mobile. I need to know when actions like refetch, invalidate, or set online/offline are triggered inside the DevTools UI.
Right now, the web view listens for those actions and sends a message to the mobile client to trigger the same action there. This works for all DevTools actions and online state changes.
If there's a simpler way to detect which action was pressed—along with the associated query and action type—I’d be happy to update the approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so should we make the devtools emit those events and you’d directly listen to those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, just to be on the same page: this would mean no changes to the
query-core
, right? because those messages wouldn’t go through the query cache...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay great 👍