Skip to content

fix(kit): guard reinstall and stale plugin replay - #1166

Merged
webfansplz merged 1 commit into
mainfrom
fix/kit-dispose-and-plugin-replay
Oct 19, 2026
Merged

webfansplz merged 1 commit into
mainfrom
fix/kit-dispose-and-plugin-replay

Conversation

@webfansplz

Copy link
Copy Markdown
Member

Two small hardening fixes for the kit lifecycle. Neither is reachable through the Vite or Chrome hosts today.

  • Reinstalling a disposed kit. dispose() clears the runtime handlers, RPC and plugins, but install() reset disposed and reinstalled the hook. The result was a kit that connected but failed every query with Unknown runtime query. install() on a disposed kit is now a no-op with a warning to create a new kit. Both hosts already create a new kit after dispose.
  • Replaying setups for unmounted apps. setupDevToolsPlugin calls are buffered globally so a later kit can replay them, but entries were never removed. A new kit on the same page (e.g. after HMR of the Vite injection with appendTo) re-ran setups for apps that had already unmounted. The plugin controller now drops buffered entries for an app on app:unmount. Setups for mounted apps, or without an app, are still replayed. This only affects plugins using the v9 setupDevToolsPlugin; Pinia and Vue Router use the v8 API, which isn't buffered.

Verification

New tests/unit/plugin/kit-lifecycle.test.ts:

  • reinstalling a disposed kit is ignored and warns (fails on main)
  • a setup for an unmounted app isn't replayed into a new kit (fails on main)
  • a setup for a mounted app is still replayed

Unit and integration tests pass (369), tsc on the kit and lint are clean.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 01:55
@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 525bed6
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/6ad1842e1e8bece3f66db592

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vue/devtools-agent@1166
npm i https://pkg.pr.new/@vue/devtools-api@1166
npm i https://pkg.pr.new/@vue/devtools-kit@1166
npm i https://pkg.pr.new/vite-plugin-vue-devtools@1166

commit: 525bed6

@webfansplz
webfansplz merged commit 8bb4936 into main Oct 19, 2026
8 checks passed
@webfansplz
webfansplz deleted the fix/kit-dispose-and-plugin-replay branch October 19, 2026 04:34
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.

2 participants