Skill Feedback: db-core collection-setup + mutations + react-db (mixed)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- postgres, typescript
調査の方向性
issue に記載されている collection-setup、schema、mutations-optimistic、react-db、meta-framework の skill ドキュメントから始めます。Electric の parser/schema パス、PostgreSQL-to-Zod のマッピング、schema-first ジェネリクス、TanStack Start の server-function 書き込みパスをカバーするように例とガイダンスを更新します。エンドツーエンドのワークフロー全体でこれらの不足点が一貫してドキュメント化されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Skill Feedback: db-core/collection-setup + db-core/mutations-optimistic + react-db + meta-framework
Package: @tanstack/db + @tanstack/react-db
Skill version: 0.5.30
Rating: mixed
Task
Build a real-time synced todo app using Electric + TanStack DB + TanStack Start, with Postgres as the backend.
What Worked
- The collection-setup skill's adapter selection table was immediately useful for picking
electricCollectionOptions - The mutations-optimistic skill's Immer-style draft proxy pattern (
collection.update(id, (draft) => { draft.completed = true })) was accurate and intuitive - The react-db skill's
useLiveQuerywith dependency arrays worked correctly - The meta-framework skill's
ssr: false+collection.preload()pattern for TanStack Start was essential and correct - The TInput/TOutput superset rule explanation in the schema docs was clear
What Failed
- The collection-setup skill shows
electricCollectionOptions<Todo>({...})with an explicit generic, but the actual overload requires the generic oncreateCollection<Todo>()when no schema is provided. With a schema (the recommended approach), no generic is needed at all.
Missing
1. Schema validates mutations only — not synced data
This is the most critical missing piece. The schema docs say "Schemas validate client changes only" but this distinction is buried and easy to miss. When using Electric, synced data bypasses the schema entirely and enters the collection as raw (parser-transformed) values. This means:
- The Electric
parserin shapeOptions handles the sync path - The Zod schema handles the mutation path (insert/update)
- You need BOTH for types like timestamptz
This caused a runtime error that was hard to diagnose. The collection-setup skill should explicitly state this dual-path when discussing Electric collections with schemas.
2. Schema should always be used (not bare generics)
The skill examples sometimes show electricCollectionOptions<Todo>({...}) without a schema. The recommended pattern should always be schema-first, with the type inferred from z.output<typeof schema>. This avoids the generic placement confusion entirely.
3. PG-type → Zod-type mapping for Electric collections
When using Electric, the skill should document which Zod types to use per Postgres type:
bool→z.boolean()(Electric auto-parses)int4→z.number()(Electric auto-parses)timestamptz→z.coerce.date()(needs parser too — see point 1)text/uuid→z.string()- The
z.union([z.string(), z.date()]).transform(...)pattern works butz.coerce.date()is simpler and satisfies the TInput-superset-of-TOutput rule automatically (TInput isunknown)
4. No TanStack Start server function examples for write path
The mutation handlers show api.todos.create() as a placeholder. For TanStack Start users, a concrete createServerFn example showing the Postgres transaction with pg_current_xact_id() returning { txid: Number(txid) } would close the biggest gap in the end-to-end story.
Self-Corrections
- Initially used a bare
Todotype generic instead of a Zod schema — user corrected this - Removed the Electric parser thinking the schema would handle timestamptz on the sync path — it doesn't, schemas only run on mutations
- Used
z.union([z.boolean(), z.string()]).transform(...)for booleans before learning Electric auto-parses them
User Comments
"Just frustrating that the SKILL didn't cover everything" — the schema-vs-parser dual path for Electric collections is the key gap.
- 主要言語
- TypeScript
- スター
- 3.9k
- フォーク
- 272
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 210
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/db のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
メンテナーはふだん 1 日以内に返信
-
browser-db-sqlite-persistence: option to load the wa-sqlite WASM by URL instead of inlined base64オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
electric-db-collection: on-demand + persistence fails after relaunch with "Snapshot requests are not supported in full mode"対応中かも @KyleAMathews が 4 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
TanStack/db#2056 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
submodule-pointer-regression
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
smith-horn/skillsmith#3061 ·
メンテナーはふだん 1 日以内に返信
-
area: ops type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
accensa/x402-facilitator-stellar#559 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
cosimochellini/one-piece-zero-spoiler#551 ·
メンテナーはふだん 1 日以内に返信
-
getWatched() omits __proto__ directories when cwd is set対応中かも @maxazure が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
area:web enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信