Skip to content
Source
Sign inSign up
TanStack/table

fix(table-core): add `export {}` to declaration files without an export statement #6620

MergedMFA-G(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/6620/headmerged by KevinVandy

🎯 Changes

Fixes #6619.

Since 9.2.5 the table-core .d.ts files no longer end with export { … } (rolldown-plugin-dts 0.28.2+ inlines the export modifiers instead). A declaration file without any export statement exports every top-level declaration, so private aliases such as RangeValue in aggregationFns.d.ts become referable, but only through a deep path that the package exports map blocks. A consumer emitting declarations then fails:

error TS2883: The inferred type of 'min' cannot be named without a reference to 'RangeValue' from './node_modules/@tanstack/table-core/dist/features/row-aggregation/aggregationFns.js'.

scripts/rewrite-table-core-dts.mjs now appends export {}; to declaration files that have no export { … }, export * or export = statement, as suggested in the issue. This is a workaround until sxzz/rolldown-plugin-dts#312 is fixed upstream (sxzz/rolldown-plugin-dts#310 is still open); once it is, the step becomes a no-op.

Verified against the built dist linked into a consumer through the package exports map, with the repro from the issue (module/moduleResolution: NodeNext, declaration: true):

  • before: TS2883 on RangeValue; 117 of the emitted .d.ts files had no export statement
  • after: compiles, and the emitted type inlines (number | Date) | undefined as with 9.2.4; no declaration file is left without an export statement
  • importing every public entry point (., static-functions, reactivity, flex-render, store-reactivity-bindings, experimental-worker-plugin) with skipLibCheck: false type-checks both before and after, so nothing that the files import from each other was relying on the implicit exports

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test and pnpm test:e2e, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

Ran for @tanstack/table-core: build, test:types, test:build (publint) and test:lib (1330 tests pass), plus tsc --noEmit for the React, Vue and Solid adapters against the rebuilt dist. I did not run the full pnpm test / pnpm test:e2e suites; the change only touches the post-build declaration rewrite.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Prevented private declarations from appearing in generated type definition files, addressing TypeScript errors in affected projects.
    1. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      🦋 Changeset detected

      Latest commit: 5aa54ceda3aab56c07ddd058bdcf4795469dc362

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 12 packages
      NameType
      @tanstack/table-corePatch
      @tanstack/alpine-tablePatch
      @tanstack/angular-table-devtoolsPatch
      @tanstack/angular-tablePatch
      @tanstack/ember-tablePatch
      @tanstack/lit-tablePatch
      @tanstack/octane-tablePatch
      @tanstack/preact-tablePatch
      @tanstack/react-tablePatch
      @tanstack/solid-tablePatch
      @tanstack/svelte-tablePatch
      @tanstack/vue-tablePatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Important

      Review skipped

      Review was skipped as selected files did not have any reviewable changes.

      ⚙️ Run configuration
      • Configuration used: Repository: TanStack/table/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: f1edfb6a-2638-4c64-b543-a7d6cc955879

      📥 Commits

      Reviewing files that changed from the base of the PR and between 2cf76516a155643952d5d642cc232315a8bb2bac and 5aa54ceda3aab56c07ddd058bdcf4795469dc362.


      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: TanStack/table/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: eb1cbfe8-8b2c-466c-a22d-585dc205a014

      📥 Commits

      Reviewing files that changed from the base of the PR and between 6aa0d74946b393f4f316085998bb6ec31c2ef593 and 2cf76516a155643952d5d642cc232315a8bb2bac.


      📒 Files selected for processing (2)
      • .changeset/quiet-dts-exports.md
      • scripts/rewrite-table-core-dts.mjs

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



      📝 Walkthrough

      Walkthrough

      The declaration rewrite script now appends export {}; to declaration files without a recognized export statement. A changeset declares a patch release for @tanstack/table-core.

      Changes

      Declaration export preservation

      Layer / File(s)Summary
      Preserve declaration module status
      scripts/rewrite-table-core-dts.mjs, .changeset/quiet-dts-exports.md
      The rewrite script leaves files with recognized export statements unchanged and appends export {}; to files without one. The changeset describes the declaration-emission change.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: kevinvandy


      Merge Risk: ⚪ Minimal · up to 2cf76

      The change adds module markers to generated declarations that need them. No actionable merge blocker was established.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 …Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the main change: adding export {} to declaration files without export statements in table-core.
      Description check✅ PassedThe description includes the required Changes, Checklist, and Release Impact sections. It explains the problem, implementation, motivation, validation results, and changeset. It also clearly states th…
      Linked Issues check✅ PassedIssue [#6619] requires a workaround for TS2883 during consumer declaration emission. The pull request adds ensureExportStatement in scripts/rewrite-table-core-dts.mjs. It appends export {}; when…
      Out of Scope Changes check✅ PassedThe changes stay within issue [#6619]. The script change implements the declaration-module workaround. The @tanstack/table-core patch changeset documents the TS2883 fix and supports its release. No …

      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)


      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share

      Comment `@coderabbitai help` to get the list of available commands.
    3. KevinVandy approved these changes

    4. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 5aa54ceda3aab56c07ddd058bdcf4795469dc362

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded5m 54sView ↗
      nx run-many --targets=build --exclude=examples/**✅ Succeeded1m 2sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-10-12 15:13:19 UTC

    5. More templates

      @tanstack/alpine-table

      npm i https://pkg.pr.new/@tanstack/alpine-table@6620

      @tanstack/angular-table

      npm i https://pkg.pr.new/@tanstack/angular-table@6620

      @tanstack/angular-table-devtools

      npm i https://pkg.pr.new/@tanstack/angular-table-devtools@6620

      @tanstack/ember-table

      npm i https://pkg.pr.new/@tanstack/ember-table@6620

      @tanstack/lit-table

      npm i https://pkg.pr.new/@tanstack/lit-table@6620

      @tanstack/match-sorter-utils

      npm i https://pkg.pr.new/@tanstack/match-sorter-utils@6620

      @tanstack/octane-table

      npm i https://pkg.pr.new/@tanstack/octane-table@6620

      @tanstack/preact-table

      npm i https://pkg.pr.new/@tanstack/preact-table@6620

      @tanstack/preact-table-devtools

      npm i https://pkg.pr.new/@tanstack/preact-table-devtools@6620

      @tanstack/react-table

      npm i https://pkg.pr.new/@tanstack/react-table@6620

      @tanstack/react-table-devtools

      npm i https://pkg.pr.new/@tanstack/react-table-devtools@6620

      @tanstack/solid-table

      npm i https://pkg.pr.new/@tanstack/solid-table@6620

      @tanstack/solid-table-devtools

      npm i https://pkg.pr.new/@tanstack/solid-table-devtools@6620

      @tanstack/svelte-table

      npm i https://pkg.pr.new/@tanstack/svelte-table@6620

      @tanstack/table-core

      npm i https://pkg.pr.new/@tanstack/table-core@6620

      @tanstack/table-devtools

      npm i https://pkg.pr.new/@tanstack/table-devtools@6620

      @tanstack/vue-table

      npm i https://pkg.pr.new/@tanstack/vue-table@6620

      @tanstack/vue-table-devtools

      npm i https://pkg.pr.new/@tanstack/vue-table-devtools@6620

      commit: 5aa54ce

    6. KevinVandy approved these changes

    7. KevinVandy merged this2d5f5b6

    8. KevinVandy closed this

Sign in to join this conversation.