feat: Improved realtime hooks monitoring
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- nuxtjs, typescript
調査の方向性
既存の「Hooks」タブから始め、関連する Nuxt の issue と pull request を確認してから、レポートでリンクされている hookable の制限を調査します。要求された監視動作を実装する前に、イベントの捕捉、フィルタリング、タイムスタンプ、ペイロードの保存、リスナーのフックに関する未解決の設計上の問題を解決します。
索引モデルが issue の本文から書いたものです。
説明
🆒 Your use case
Related issues: https://github.com/nuxt/nuxt/issues/31892 and https://github.com/nuxt/nuxt/pull/31977
The current Hooks tab shows registered hooks and how many times they have been called. This is useful, but it would be even better if we could see the actual calls and listeners to the hooks in real time, including time stamps and the ability to filter by hook name and type (emit vs listen).
This is a common feature in many frameworks which let you monitor events in real time, and it would be a great addition to the Hooks tab. It would greatly improve the debugging experience.
Currently as you can see, when a hook is called, it only shows the number of times it has been called and the execution time. But it doesn't report when the hook was called, what the arguments were, and what listeners were called. There is also no way to filter hooks. This makes it more difficult to debug issues related to hooks.
Screencast
https://github.com/user-attachments/assets/11ca5e98-763b-4759-bb59-42796499666f
For example, here is how Events are monitored in Laravel. It shows a list of most recent events, how long ago it happened and supports filtering:
There is also a current limitation of hookable which does not have an API to hook into the listener calls. It is only possible to hook into the callHook method but not the hook method. So we cannot report on the listeners that are called. I already opened an issue regarding this - https://github.com/unjs/hookable/issues/117
🆕 The solution you'd like
In our company we created a custom NuxtDevtools module for this. It has a lot of limitations but it shows both emit and listen events, shows a timestamp and allows filtering by name and type. Emits are green, listens are blue. It uses LocalStorage to log the events. I think this should be built into the core of Nuxt Devtools.
Screencast
https://github.com/user-attachments/assets/294d63cf-e87e-47d4-928b-ae24b0ca459a
Features
- Show a list of hooks sorted by most recent
- Show a time stamp of when the hook was called (both emit and listen)
- Show the arguments passed to the hook
- Show both emit and listen events
- Allow filtering by hook name and type (e.g. show only callHook calls vs show only hook calls)
- Support for regex filtering (e.g. /show this hook/ -/hide this hook/)
Discussion Points
[ ] Should this be integrated into the existing Hooks tab or should it be a separate Events tab?
[ ] Can we patch hookable to allow hooking into listener calls?
[ ] Default filters, e.g. show only user hooks, hide system hooks. Regex filtering support.
[ ] Where should the data be stored? In LocalStorage? What about SSR?
[ ] Storing payload in LocalStorage might quickly baloon in size, use different storage or have a limit for payload?
🔍 Alternatives you've considered
No response
ℹ️ Additional info
No response
- 主要言語
- TypeScript
- スター
- 3.3k
- フォーク
- 214
- 平均マージ
- 19時間 45分
- マージ済み PR(30日)
- 12
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuxt/devtools のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
bug needs reproduction
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·