Skip to content

fix(query-devtools): align onClose setter type#10607

Open
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:fix/query-devtools-onclose-setter-type
Open

fix(query-devtools): align onClose setter type#10607
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:fix/query-devtools-onclose-setter-type

Conversation

@grzdev
Copy link
Copy Markdown
Contributor

@grzdev grzdev commented Apr 28, 2026

🎯 Changes

Align the onClose setter type in TanstackQueryDevtoolsPanel with the updated callback signature.

The onClose callback was previously changed from () => unknown to () => void across devtools packages, but the internal panel class still exposed:

setOnClose(onClose: () => unknown)

This updates:

  • #onClose signal type to () => void
  • setOnClose parameter type to () => void

This ensures consistency with the public devtools API and avoids leaking the outdated unknown return type.

No runtime behavior changes.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

Bug Fixes

  • Updated the devtools panel's closing callback type to correctly specify void return type, improving type safety.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

This patch release updates the onClose callback type in the TanStack Query Devtools panel from returning unknown to void. The change includes a Changesets metadata file and updates to both the internal signal type and the public method signature in TanstackQueryDevtoolsPanel.

Changes

Cohort / File(s) Summary
Changesets Release Metadata
.changeset/query-devtools-onclose-setter-type.md
Documents a patch release for @tanstack/query-devtools recording the setOnClose callback type update.
Type Signature Updates
packages/query-devtools/src/TanstackQueryDevtoolsPanel.tsx
Updates onClose callback type from () => unknown to () => void in both the internal signal type and public setOnClose method signature.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With void return types, now crystal clear,
The devtools panel has naught to fear!
No unknown shadows in the night,
Our callbacks typed, precise and right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: aligning the onClose setter type in query-devtools to be consistent with the public API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description follows the required template structure with all sections present and properly filled out.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 28, 2026

View your CI Pipeline Execution ↗ for commit b979abe

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 9s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-28 20:03:07 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 28, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10607

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10607

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10607

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10607

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10607

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10607

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10607

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10607

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10607

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10607

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10607

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10607

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10607

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10607

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10607

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10607

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10607

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10607

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10607

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10607

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10607

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10607

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10607

commit: b979abe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant