Repeated navigation in an Inertia/Vue application causes the Vue Devtools Chrome extension (7.7.7) to become progressively slower.

オープン
#1,193 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
devtools

調査の方向性

Start by locating initDevToolsServerListener() and tracing how it registers handlers on devtools.ctx.hooks through the birpc interface. Check how the broadcast instance behaves during teardown and reconnection before deciding whether an initialization guard is safe. Done means repeated initialization no longer adds duplicate handlers or causes redundant messages, while reconnection behavior remains correct.

索引モデルが issue の本文から書いたものです。

説明

fix: prevent duplicate DevTools server listener registration

##created with help of AI

Problem

Repeated navigation in an Inertia/Vue application causes the Vue Devtools Chrome extension (7.7.7) to become progressively slower.

Investigation revealed that initDevToolsServerListener() can be invoked repeatedly through the birpc interface. Each invocation registers additional handlers on devtools.ctx.hooks, without checking whether those handlers have already been registered.

After several navigations, the internal hook registry contained 45 distinct handlers for each of the following events:

  • routerInfoUpdated
  • sendInspectorTreeToClient
  • sendInspectorStateToClient

This caused thousands of redundant inspector and router messages, despite relatively few Vue component lifecycle events.

Fix

Make initDevToolsServerListener() idempotent using a module-scoped initialization guard.

Subsequent RPC calls no longer register duplicate listeners.

Verification
  • Reproduced with Vue 3.5.42 and Inertia 2.1.6.
  • Reproduced using a minimal Vue application without Pinia or Vue Router.
  • Confirmed repeated initDevToolsServerListener() RPC invocations using Chrome's debugger.
  • Confirmed accumulation of 45 distinct callbacks per internal messaging hook.
  • Verified that deduplicating listeners and preventing further registration resolves the performance degradation.
Considerations

The guard assumes that the underlying RPC broadcast instance remains valid across subsequent initialization requests.

Connection teardown and reconnection behavior should be verified before merging.

主要言語
TypeScript
スター
2.9k
フォーク
292
平均マージ
3日 22時間
マージ済み PR(30日)
29

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vuejs/devtools のほかの issue

vuejs/devtools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。