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

Public hook or event for live-query graph runs (for performance attribution)

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

まず CollectionConfigBuilder.executeGraphRun と maybeRunGraph を確認し、次に提案されている live-query コレクションイベントとグローバルな onLiveQueryRun フックを比較します。完了条件は、オプトイン可能なパブリックな拡張ポイントが各グラフ実行をタイミング情報とコレクションの識別情報付きで報告し、useLiveQuery と createLiveQueryCollection をカバーし、dist の内部実装へのパッチ適用を避けることです。

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

説明

Problem

We attribute main-thread long tasks to the sync stage that caused them using performance.mark pairs around our own collection commits (co:sync:commit:start/end). The other half of the picture, the time a commit spends re-running dependent live queries, has no public seam: CollectionConfigBuilder.executeGraphRun / maybeRunGraph run synchronously inside the source collection's commit and are private, and CollectionConfigBuilder is not re-exported from @tanstack/db.

What exists publicly today does not cover it:

  • createLiveQueryObserver subscribes to changes and status, not to the run itself.
  • createEffect's per-graph-run callback fires per effect query, so instrumenting it does not cover useLiveQuery / createLiveQueryCollection sites (we have ~65).
  • Collection events are status:change, subscribers:change, index:added, index:removed.

Patching the dist to wrap executeGraphRun works but is a vendor carry we do not want to maintain for a metric.

Request

A public, opt-in event around a live query's graph run, for example on the live query collection:

collection.on('graph:run', ({ id, durationMs, changes }) => { /* mark / measure */ })

or a global hook (onLiveQueryRun(listener)) that fires with { id, startTime, endTime } per executeGraphRun. Either lets consumers emit performance.mark pairs with detail: { collection: id } and lets DevTools-style tooling attribute long tasks to specific queries without touching internals.

Context

@tanstack/db 0.7.2. Related to the offset-regression issue we filed against electric-sql/electric#4806 in the same instrumentation effort.

主要言語
TypeScript
スター
3.9k
フォーク
268
平均マージ
1日 4時間
マージ済み PR(30日)
178

環境構築

はじめの一歩

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

TanStack/db のほかの issue

TanStack/db の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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