fix(devtools): change onClose callback type from () => unknown to () …#10118
fix(devtools): change onClose callback type from () => unknown to () …#10118grzdev wants to merge 3 commits intoTanStack:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 3e41e59 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThe PR tightens the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/query-devtools/src/TanstackQueryDevtoolsPanel.tsx (1)
37-37:⚠️ Potential issue | 🟡 MinorInternal signal type still uses
() => unknown, inconsistent with the public interface.The config interface on line 21 now declares
onClose?: () => void, but the private field#onCloseremainsSignal<(() => unknown) | undefined>. ThesetOnClosemethod on line 93 also still accepts() => unknown. Both should be updated to() => voidfor consistency.Proposed fix
- `#onClose`: Signal<(() => unknown) | undefined> + `#onClose`: Signal<(() => void) | undefined>And on line 93:
- setOnClose(onClose: () => unknown) { + setOnClose(onClose: () => void) {
Updated onClose callback type in devtools to improve type safety.
|
this comment seems correct, please address it: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.changeset/chatty-socks-act.md:
- Line 9: Update the truncated changeset description in chatty-socks-act.md by
replacing the ellipsis with the full sentence describing the change:
"fix(devtools): change onClose callback type from () => unknown to () => void"
so the full context appears in release notes; ensure the top-level summary line
and body reflect this exact completed description.
|
Fixed 👍 Updated the changeset description to include the full callback signature ( |
What
Changes the
onClosecallback type across devtools packages from:() => unknown
to:
() => void
Why
The callback does not return a value, and
voidbetter communicates the intended usage.This improves type clarity and developer experience across all framework bindings and docs.
Scope
No runtime changes.
Type-only improvement.
Summary by CodeRabbit
Documentation
Refactor
Chores