feat(react-query-dev-tools): Add ReactQueryDevToolsPanel support
Hi :wave:
Since major version 5 of TanstackQuery, the debug bar has been redesigned and much improved. However, support for the DevtoolsPanel component has been lost. The aim of my contribution is to reinstate this component.
Work done in the @tanstack/query-devtools package: Soon...
Work done in the @tanstack/react-query-devtools package: Soon...
@toofff Thanks for working on the devtools panel API! Is this PR good to take a look at? Or do you need any help with it? 😄 I'll be happy to help you if you run into any blockers
@toofff Thanks for working on the devtools panel API! Is this PR good to take a look at? Or do you need any help with it? 😄 I'll be happy to help you if you run into any blockers
I haven't taken the time to finalize my PR yet, it's not good enough to look at.
The logic I had was to add 2 exportable components. The Devtools component and the DevtoolsPanel component without the PiPProvider. Would this logic work for you? @ardeora
I'm going to find some time this week to get back to it and hopefully finish it all off.
@toofff yeah that's fine. The devtools panel not having a PiP view makes sense because that would ideally be neet to be handled on the user side. Also, no rush at all. Let me know if you have any other questions/concerns!
@ardeora I was able to work a bit last night and have a better idea where I'm headed.
The @tanstack/react-query-devtools package will export 2 components: ReactQueryDevtools & ReactQueryDevtoolsPanel.
The @tanstack/query-devtools package will also export 2 classes: TanstackQueryDevtools & TanstackQueryDevtoolsPanel.
These 2 classes will use the same Devtools component, but configured differently.
The TanstackQueryDevtoolsPanel class will configure the Devtools component so that:
- the open button is no longer present
- the close button is no longer present
- control buttons will probably no longer be present (e.g. position)
- the PIP button is no longer present
At first I just wanted to export the DevtoolsPanel component, but I ran into a lot more problems than I thought. The CSS was all broken, the functionalities more or less functional... So I think the simplest option is to simply disable certain functionality.
What do you think? Does the vision of my work suit you?
Note: If everything is OK for you, I could do the same thing for the other languages that the debug bar supports, but in another pull request :smile:
Hi @ardeora :wave:
Here's a first draft of what I'm thinking of doing.
I'm not a fan of the drilling props I've set up, so I'm thinking of putting the 4 props directly accessible via the main provider. I also need to disable the basic button that displays or not the debug bar and add a state control to open or not the debug bar panel.
I think I'd have done all this differently, but I didn't want to redo everything for my first pull request, but it can be improved in a future pull request ;)
Could you tell me what you think and if I should finish this as soon as possible?
@toofff Thanks for working on this. This is looking great! I'll take a look at this today and detailed comments if required!
@ardeora here's my finished contribution. Let me know what you think :pray:
After this pull request, I could implement the DevtoolsPanel component for the other technologies and their documentation.
Hi @toofff I took a look at the changes have made a PR to fix some things. https://github.com/toofff/tanstack-query/pull/1 Let me know what you think! I think if everything looks good, we can merge this today/tomorrow whenever things go through
@ardeora I'll review and test your pull request tomorrow evening, I don't think I'll have time tonight.
Thank you for your feedback.
@ardeora I squashed your 3 commits and did a cherry-pick in my branch.
I also corrected:
- the documentation to remove the isOpen prop from the
ReactQueryDevtoolsPanelcomponent - updated the dependencies of the
@tanstack/query-example-react-devtools-panelpackage with the latest versions of Tanstack/Query. - kept the two ReactQueryDevtools & ReactQueryDevtoolsPanel files in the
@tanstack/react-query-devtoolspackage
@ardeora if everything is good for you, you can merge ;)
Thank you very much for your help and cooperation in this adventure. :pray:
☁️ Nx Cloud Report
CI is running/has finished running commands for commit 1c196e5460e2c1b506068889425962828f4ed481. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 2 targets
Sent with 💌 from NxCloud.
Hi! I'm autofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.
I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
- Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
- Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).
More templates
- @tanstack/query-example-angular-basic
- @tanstack/query-example-angular-infinite-query-with-max-pages
- @tanstack/query-example-angular-router
- @tanstack/query-example-angular-simple
- @tanstack/query-example-solid-astro
- @tanstack/query-example-solid-basic
- @tanstack/query-example-solid-basic-graphql-request
- @tanstack/query-example-solid-default-query-function
- @tanstack/query-example-solid-simple
- @tanstack/query-example-solid-start-streaming
- @tanstack/query-example-svelte-basic
- @tanstack/query-example-svelte-auto-refetching
- @tanstack/query-example-svelte-optimistic-updates
- @tanstack/query-example-svelte-load-more-infinite-scroll
- @tanstack/query-example-svelte-simple
- @tanstack/query-example-svelte-ssr
- @tanstack/query-example-svelte-star-wars
- @tanstack/query-example-svelte-playground
- @tanstack/query-example-vue-2.6-basic
- @tanstack/query-example-vue-2.7-basic
- @tanstack/query-example-vue-basic
- @tanstack/query-example-vue-dependent-queries
- @tanstack/query-example-vue-nuxt3
- @tanstack/query-example-vue-persister
- @tanstack/query-example-vue-simple
- @tanstack/query-example-react-algolia
- @tanstack/query-example-react-auto-refetching
- @tanstack/query-example-react-basic
- @tanstack/query-example-react-basic-graphql-request
- @tanstack/query-example-react-default-query-function
- @tanstack/query-example-react-devtools-panel
- @tanstack/query-example-react-infinite-query-with-max-pages
- @tanstack/query-example-react-load-more-infinite-scroll
- @tanstack/query-example-react-nextjs
- @tanstack/query-example-react-nextjs-app-prefetching
- @tanstack/query-example-nextjs-suspense-streaming
- @tanstack/query-example-react-offline
- @tanstack/query-example-react-optimistic-updates-cache
- @tanstack/query-example-react-optimistic-updates-ui
- @tanstack/query-example-react-pagination
- @tanstack/query-example-react-prefetching
- @tanstack/query-example-react-react-native
- @tanstack/query-example-react-router
- @tanstack/query-example-react-rick-morty
- @tanstack/query-example-react-shadow-dom
- @tanstack/query-example-react-simple
- @tanstack/query-example-react-star-wars
- @tanstack/query-example-react-suspense
- @tanstack/query-example-react-playground
@tanstack/angular-query-devtools-experimental
pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@7788
@tanstack/eslint-plugin-query
pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@7788
@tanstack/angular-query-experimental
pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@7788
@tanstack/query-async-storage-persister
pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@7788
@tanstack/query-broadcast-client-experimental
pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@7788
@tanstack/query-core
pnpm add https://pkg.pr.new/@tanstack/query-core@7788
@tanstack/query-devtools
pnpm add https://pkg.pr.new/@tanstack/query-devtools@7788
@tanstack/query-persist-client-core
pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@7788
@tanstack/query-sync-storage-persister
pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@7788
@tanstack/react-query
pnpm add https://pkg.pr.new/@tanstack/react-query@7788
@tanstack/react-query-devtools
pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@7788
@tanstack/react-query-next-experimental
pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@7788
@tanstack/react-query-persist-client
pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@7788
@tanstack/solid-query
pnpm add https://pkg.pr.new/@tanstack/solid-query@7788
@tanstack/solid-query-devtools
pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@7788
@tanstack/solid-query-persist-client
pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@7788
@tanstack/svelte-query-devtools
pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@7788
@tanstack/svelte-query
pnpm add https://pkg.pr.new/@tanstack/svelte-query@7788
@tanstack/svelte-query-persist-client
pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@7788
@tanstack/vue-query
pnpm add https://pkg.pr.new/@tanstack/vue-query@7788
@tanstack/vue-query-devtools
pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@7788
commit: 1c196e5
@ardeora everything is correct now, tonight I'll be able to start my new pull request for the other technologies and update the respective documentations and examples ;)
Thanks a lot for the help, it was much appreciated.
@ardeora yes, it is @yanoucrea