Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat: Improved realtime hooks monitoring

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
nuxtjs, typescript

調査の方向性

既存の「Hooks」タブから始め、関連する Nuxt の issue と pull request を確認してから、レポートでリンクされている hookable の制限を調査します。要求された監視動作を実装する前に、イベントの捕捉、フィルタリング、タイムスタンプ、ペイロードの保存、リスナーのフックに関する未解決の設計上の問題を解決します。

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

説明

enhancement
🆒 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:

Image

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

nuxt/devtools のほかの issue

nuxt/devtools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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