Public hook or event for live-query graph runs (for performance attribution)
メンテナーはふだん 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:
createLiveQueryObserversubscribes to changes and status, not to the run itself.createEffect's per-graph-run callback fires per effect query, so instrumenting it does not coveruseLiveQuery/createLiveQueryCollectionsites (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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/db のほかの issue
-
Persisted on-demand Electric collection enters error after a committed transaction waits across subset hydration対応中かも @alec-watts が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
SQLite persistence silently serializes Temporal values as {}, breaking hydration and subset queries対応中かも @KyleAMathews が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
useLiveInfiniteQuery commits an empty first render over a synchronously loaded collection (useLiveQuery doesn't)対応中かも @KyleAMathews が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
dx hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cloudflare/agents#2498 ·
メンテナーはふだん 1 日以内に返信
-
Missing repro Platform: Android
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
software-mansion/react-native-reanimated#10816 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
redhat-developer/rhdh-plugin-export-overlays#4129 ·
メンテナーはふだん 1 日以内に返信