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

Support persisted initialRender for Electric progressive collections

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

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

@Jose10go がすでに取り組んでいます。

2026年10月20日 から。

  • #2203 @Jose10go による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
database

調査の方向性

Start with the network-first validation in @tanstack/db-sqlite-persistence-core and trace how @tanstack/electric-db-collection maps progressive sync mode to on-demand. Check the persistence and Electric collection tests for initial rendering and restored snapshots. Done means the reproduction no longer throws and a previously completed persisted snapshot can render while network synchronization continues.

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

説明

Description:

Persisted progressive electric collections should render its cached data after a hard refresh while network sync continues.

initialRender: {
  strategy: 'network-first',
  networkTimeoutMs: 0,
}

This throws for syncMode: 'progressive' because Electric translates it to 'on-demand', which the persistence wrapper rejects.
There is a documented restriction for on-demand collections. However, progressive collections eventually complete a full initial sync, so a previously completed, persisted snapshot should support this fallback.

Minimal reproduction

Versions: @tanstack/[email protected], @tanstack/[email protected].
Run this as an .mjs file with Node. No React, database, or running Electric server is needed to reproduce the configuration error.

import { electricCollectionOptions } from '@tanstack/electric-db-collection'
import { persistedCollectionOptions } from '@tanstack/db-sqlite-persistence-core'

persistedCollectionOptions({
  ...electricCollectionOptions({
    id: 'todos',
    syncMode: 'progressive',
    getKey: row => row.id,
    shapeOptions: {
      url: 'http://localhost:3000/v1/shape',
      params: { table: 'todos' },
    },
  }),
  persistence: {}, // Placeholder: throws before accessing persistence.
  initialRender: {
    strategy: 'network-first',
    networkTimeoutMs: 0,
  },
})

Produce Error: network-first initial rendering requires eager persistence syncMode

Expected behavior

For progressive collections with a previously completed persisted snapshot, allow initial rendering after local restoration, while network synchronization continues.

主要言語
TypeScript
スター
3.9k
フォーク
277
平均マージ
17時間 54分
マージ済み PR(30日)
226

環境構築

はじめの一歩

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

TanStack/db のほかの issue

TanStack/db の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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