Skip to content
Source
Sign inSign up
TanStack/db

Revalidate declaration emission for exported inferred live-query Collections #2339

OpenKyleAMathews opened this issue 1 comment
KyleAMathewscommented

Problem and historical evidence

The release deferral record preserves declaration-emission failures against the initial RC artifacts and strict installed main 95460bc875a2259b34eea534e5592a9d0394e73f.

Both ESM and CommonJS failed for an exported inferred live-query factory (TS2742 / TS4058) and an exported inferred Collection value (TS2742 / TS4023). Private compiler/live types and LIVE_QUERY_INTERNAL could not be named.

This concerns libraries that emit declarations. It does not establish a runtime failure. No new installed-artifact reproduction was run when filing this follow-up; revalidate against current main first.

Preserved witness

The linked record contains the complete original unannotated factory and its source/receiving hashes. Its essential path is:

import { Query, createLiveQueryCollection } from '@tanstack/db'
import type { Collection } from '@tanstack/db'

type Row = { id: number; version: number; optional?: string | null }
declare const source: Collection<Row>

export function receiver() {
  const selected = new Query()
    .from({ row: source })
    .select(({ row }) => ({ id: row.id, version: row.version, value: 0 }))
  return createLiveQueryCollection({ query: selected, getKey: (row) => row.id })
}

Reproduce with strict NodeNext declaration emission for both .mts and .cts against actual installed tarballs, plus an exported inferred-value form. Use the full original witness when comparing historical receipts.

Acceptance

  • Determine whether the original failures still reproduce; preserve exact package/compiler versions and diagnostics.
  • Extend the public-type owner with legal generated row/key shapes, factory and inferred-value exports, and ESM/CommonJS installed receivers.
  • Keep inferred exports unannotated. A narrow public view containing only readonly toArray is a limited control, not proof that full Collection emission works.
  • If a defect survives, show RED before repair, GREEN after it, and a fault control; record public API and receiving limits.

Related historical reports: #1012 and #393 are closed. This issue tracks the distinct retained RC factory/value witness and requires fresh validation rather than assuming those old repairs failed.

  1. Fresh revalidation on frozen, freshly fetched origin/main baabf57a0f110d57ad9bb7b81148466b18fbe0d1 confirms this remains open.

    I built and packed this revision's own DB/IVM sources, then used native npm to install those actual tarballs into an isolated receiver. Both packages are 1.0.0-rc.1.1; compiler TypeScript 5.9.3, Node 24.19.0. The original factory source matches the retained SHA256 c6c8c1da415901f4935f611387e7f6a3234b5f9753544256f0680038dcc1b50d; the original full inferred-value export and controls were restored from the historical receiving files.

    Strict NodeNext declaration emission (skipLibCheck: false) still gives:

    Unannotated full export.mts / ESM.cts / CommonJS
    Original factoryTS2742 twice + TS4058TS2742 twice + TS4058
    Original inferred Collection valueTS2742 twice + TS4023TS2742 twice + TS4023

    All four skip declaration emission. The diagnostics still identify private query/compiler/types, query/live/internal, and the unnameable LIVE_QUERY_INTERNAL symbol. Native tsc and separate fresh compiler Programs agree, with zero setup/dependency diagnostics. Both modes resolve the installed package's correct declaration exports.

    The original factory kept private admits, and the historical named readonly toArray view emits, in both formats. That limited view does not establish full Collection emission. The historical narrow Collection<Row, number> annotation still fails TS2322 and remains an invalid control.

    Provenance checks compare all 158 source files with this SHA and all 866 DB / 208 IVM archive files with the installed copies. Final builds used Vite 7.3.7/Vitest 4.1.12; an initial older-tool build was retained separately, and all 894 output files, all 314 declarations, and both full tarballs are byte-identical. External dependencies were explicitly fingerprinted local repacks after registry setup attempts failed; this is an installed local-tarball witness, without a public-registry archive provenance claim.

    No production repair was requested or made. This fixed original-witness result is sufficient to keep the issue open; generated row/key cases and the installed public-type owner extension remain follow-up work. It establishes a declaration-emission defect, without a runtime-failure claim. Exact argv, cwd, diagnostics, compiler/source/archive fingerprints, controls, setup-attempt classification and replay files are preserved in the issue-2339 investigation evidence.

Sign in to join this conversation.