Skip to content

docs(framework/vue/devtools): align the 'Embedded Mode' example with the other adapters and add the missing 'ref' import#10855

Merged
sukvvon merged 1 commit into
mainfrom
docs/framework-vue-devtools-embedded-mode-align
Jun 1, 2026
Merged

docs(framework/vue/devtools): align the 'Embedded Mode' example with the other adapters and add the missing 'ref' import#10855
sukvvon merged 1 commit into
mainfrom
docs/framework-vue-devtools-embedded-mode-align

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Jun 1, 2026

🎯 Changes

Align the Vue ## Embedded Mode example with the other adapter docs (React/Preact/Solid) and add the missing ref import so the snippet is actually usable when copy-pasted into a plain Vue 3 project:

  • add import { ref } from 'vue' — without auto-import (Nuxt, unplugin-auto-import, etc.) the original snippet would throw ref is not defined
  • rename the reactive flag from isDevtoolsOpen to isOpen so it matches the variable used in the React/Preact/Solid examples
  • switch the button label from the static Open Devtools to the dynamic ${isOpen ? 'Close' : 'Open'} the devtools panel, mirroring how the React/Preact/Solid examples reflect the current panel state
 <script setup>
+import { ref } from 'vue'
 import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools'
-const isDevtoolsOpen = ref(false)
+const isOpen = ref(false)
 function toggleDevtools() {
-  isDevtoolsOpen.value = !isDevtoolsOpen.value
+  isOpen.value = !isOpen.value
 }
 </script>

 <template>
   <h1>The app!</h1>
-  <button @click="toggleDevtools">Open Devtools</button>
-  <VueQueryDevtoolsPanel v-if="isDevtoolsOpen" :onClose="toggleDevtools" />
+  <button @click="toggleDevtools">
+    {{ isOpen ? 'Close' : 'Open' }} the devtools panel
+  </button>
+  <VueQueryDevtoolsPanel v-if="isOpen" :onClose="toggleDevtools" />
 </template>

The Vue-idiomatic parts of the snippet — <script setup> with a named toggleDevtools function, v-if for conditional rendering, and the <h1>The app!</h1> placeholder — are intentionally preserved so the example still reads like idiomatic Vue 3.

Found while comparing the Embedded Mode sections across all four adapter docs in #10853. The missing ref import was flagged by CodeRabbit during review.

✅ 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

  • Documentation
    • Updated Vue Devtools embedded-mode example: simplified open/close handling, introduced a single toggle-driven state for the panel, and adjusted the example button to reflect and control panel visibility dynamically.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Jun 1, 2026

View your CI Pipeline Execution ↗ for commit 2d31081

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

☁️ Nx Cloud last updated this comment at 2026-06-01 07:20:12 UTC

@sukvvon sukvvon self-assigned this Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

🚀 Changeset Version Preview

2 package(s) bumped directly, 23 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.6 → 0.2.7 Changeset
@tanstack/query-devtools 5.100.14 → 5.100.15 Changeset
@tanstack/angular-query-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/angular-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/eslint-plugin-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/query-async-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/query-broadcast-client-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/query-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-persist-client-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-sync-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/react-query 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-next-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/svelte-query 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-devtools 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-persist-client 6.1.33 → 6.1.34 Dependent
@tanstack/vue-query 5.100.14 → 5.100.15 Dependent
@tanstack/vue-query-devtools 6.1.33 → 6.1.34 Dependent

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc5505c5-8cd1-4f0d-ad96-21faefad1e9b

📥 Commits

Reviewing files that changed from the base of the PR and between 2d31081 and 617b606.

📒 Files selected for processing (1)
  • docs/framework/vue/devtools.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/framework/vue/devtools.md

📝 Walkthrough

Walkthrough

Vue devtools documentation example updated: the embedded mode code snippet replaces isDevtoolsOpen state with isOpen and introduces a toggleDevtools function. Button text now dynamically shows "Open" or "Close" based on the panel state, and visibility is controlled through the renamed state variable.

Changes

Vue Devtools Embedded Mode Example

Layer / File(s) Summary
Embedded mode state and toggle implementation
docs/framework/vue/devtools.md
State variable renamed from isDevtoolsOpen to isOpen with a toggleDevtools function; button displays dynamic "Open"/"Close" text and triggers the toggle; panel v-if condition updated to use the new state variable.
  • Sequence Diagram(s):
sequenceDiagram
  participant Button
  participant Component
  participant VueQueryDevtoolsPanel
  Button->>Component: click -> toggleDevtools()
  Component->>Component: isOpen = !isOpen
  Component->>VueQueryDevtoolsPanel: render when isOpen true (v-if="isOpen")
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • TanStack/query#10854: Also edits the Vue devtools "Embedded Mode" docs; this PR changes example state/toggle while #10854 fixes a "React app" typo to "Vue app".
  • TanStack/query#10853: Updates embedded-mode devtools documentation examples across frameworks to use a local isOpen state and conditional toggle logic.

Poem

🐰 I toggled a state with a hop and a nibble,
Docs now say isOpen—so small and so nimble,
A button that flips from Open to Close,
The panel appears where the bright cursor goes,
Hooray for clear examples—now off I wiggle!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: aligning the embedded mode example with other adapters and adding the missing 'ref' import.
Description check ✅ Passed The PR description is comprehensive, follows the template structure, includes detailed change explanations with code diffs, and documents the checklist items and release impact.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/framework-vue-devtools-embedded-mode-align

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 1, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10855

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 617b606

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

size-limit report 📦

Path Size
react full 12.11 KB (0%)
react minimal 9.08 KB (0%)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/framework/vue/devtools.md`:
- Around line 94-96: The Vue docs example is missing the Vue import for ref, so
the <script setup> snippet should be updated to import ref alongside
VueQueryDevtoolsPanel. Fix the code example in the devtools markdown by adding
the missing ref import in the same snippet where isOpen is initialized, and
review nearby Vue documentation examples for the same pattern to ensure any
ref(...) usage is paired with an import from Vue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8559a476-e7e4-465d-9a46-d6368774bce3

📥 Commits

Reviewing files that changed from the base of the PR and between a79fc8d and 2d31081.

📒 Files selected for processing (1)
  • docs/framework/vue/devtools.md

Comment thread docs/framework/vue/devtools.md
…the other adapters and add the missing 'ref' import
@sukvvon sukvvon force-pushed the docs/framework-vue-devtools-embedded-mode-align branch from 2d31081 to 617b606 Compare June 1, 2026 07:18
@sukvvon sukvvon changed the title docs(framework/vue/devtools): align state name and button label in the 'Embedded Mode' example with the other adapters docs(framework/vue/devtools): align the 'Embedded Mode' example with the other adapters and add the missing 'ref' import Jun 1, 2026
@sukvvon sukvvon merged commit b1337cd into main Jun 1, 2026
9 checks passed
@sukvvon sukvvon deleted the docs/framework-vue-devtools-embedded-mode-align branch June 1, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant