Skip to content
Source
Sign inSign up
TanStack/table

feat(table-core): Further improve tree-shaking across features #6626

MergedKevinVandymerged 3 commits intomain fromrefs/pull/6626/headmerged by KevinVandy

KevinVandycommented
  • The core no longer bundles column ordering, pinned header ordering, or the expanded-row display walk. New stubs in core/featureStubs.ts (orderLeafColumns, orderByColumnPinning, expandRowModel) call a function that column grouping, column pinning, or row expanding stores on the table in initTableInstanceData, the same way _aggregateColumnValue works. constructTable drops from 5.51 to 5.24 kB brotli, and a minimal React useTable from 8.49 to 8.21 kB.
  • Pinned display order now lives in one internal function, features/column-pinning/orderByColumnPinning.ts. It replaces the separate copies in core header groups, row_getVisibleCells, and cell selection's column order.
  • Column sizing, column ordering, cell selection, column pinning, row pinning, and the paginated row model read other features through stubs instead of importing their utils. They no longer bundle features the table doesn't register.
  • Start, center, and end total sizes now sum the visible leaf columns in each pinning region instead of reading header groups. A new test checks that they still equal the header row widths with group headers and hidden columns.
  • In production, tableMemo no longer gives each memo an onAfterUpdate wrapper when there is no callback. Creating 500k row memos used 289 MB of heap instead of 389 MB and ran about 20% faster.
  • Row aggregation checks process.env.NODE_ENV at each dev warning, so production builds drop the message strings.
  • Regenerated the devtools bundle sizes. Across the feature sets used by 38 React examples, bundles shrink by 283 B brotli on average. Four sets that combine column ordering, pinning, and visibility grow by 50 to 61 B.
  • Public types are unchanged apart from the doc comments on the three region total size methods.

Notes

_orderByColumnPinning, _orderGroupedColumns, and _expandRows are untyped private functions stored on the table behind @ts-ignore. Together they account for about 270 B of the core saving. Replacing them with public APIs or static imports is a possible follow-up.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Performance
    • Improved tree-shaking so applications can ship less table feature code when using selected feature combinations.
    • Reduced bundle sizes across the measured feature-selection cases.
  • Bug Fixes
    • Improved consistency of column ordering and sizing across grouped, hidden, and pinned columns.
    • Preserved expected row expansion behavior when expanded rows are displayed with pagination.
    1. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      🦋 Changeset detected

      Latest commit: 37dc1de7b48b76f2acaaa9a025c7f11a16766aa1

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

      This PR includes changesets to release 17 packages
      NameType
      @tanstack/table-corePatch
      @tanstack/table-devtoolsPatch
      @tanstack/alpine-tablePatch
      @tanstack/angular-table-devtoolsPatch
      @tanstack/angular-tablePatch
      @tanstack/ember-tablePatch
      @tanstack/lit-tablePatch
      @tanstack/octane-tablePatch
      @tanstack/preact-table-devtoolsPatch
      @tanstack/preact-tablePatch
      @tanstack/react-table-devtoolsPatch
      @tanstack/react-tablePatch
      @tanstack/solid-table-devtoolsPatch
      @tanstack/solid-tablePatch
      @tanstack/svelte-tablePatch
      @tanstack/vue-table-devtoolsPatch
      @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. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 37dc1de7b48b76f2acaaa9a025c7f11a16766aa1

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

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

    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      🚀 Changeset Version Preview

      2 package(s) bumped directly, 15 bumped as dependents.

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/table-core9.3.0 → 9.3.1Changeset
      @tanstack/table-devtools9.3.0 → 9.3.1Changeset
      @tanstack/alpine-table9.3.0 → 9.3.1Dependent
      @tanstack/angular-table9.3.0 → 9.3.1Dependent
      @tanstack/angular-table-devtools9.3.0 → 9.3.1Dependent
      @tanstack/ember-table9.3.0 → 9.3.1Dependent
      @tanstack/lit-table9.3.0 → 9.3.1Dependent
      @tanstack/octane-table9.3.0 → 9.3.1Dependent
      @tanstack/preact-table9.3.0 → 9.3.1Dependent
      @tanstack/preact-table-devtools9.3.0 → 9.3.1Dependent
      @tanstack/react-table9.3.0 → 9.3.1Dependent
      @tanstack/react-table-devtools9.3.0 → 9.3.1Dependent
      @tanstack/solid-table9.3.0 → 9.3.1Dependent
      @tanstack/solid-table-devtools9.3.0 → 9.3.1Dependent
      @tanstack/svelte-table9.3.0 → 9.3.1Dependent
      @tanstack/vue-table9.3.0 → 9.3.1Dependent
      @tanstack/vue-table-devtools9.3.0 → 9.3.1Dependent
    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Walkthrough

      Warning

      Review details and warnings were omitted to fit the comment limit.

    5. pkg-pr-new[bot](GitHub profile, opens in a new tab)commented
      More templates

      @tanstack/alpine-table

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

      @tanstack/angular-table

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

      @tanstack/angular-table-devtools

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

      @tanstack/ember-table

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

      @tanstack/lit-table

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

      @tanstack/match-sorter-utils

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

      @tanstack/octane-table

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

      @tanstack/preact-table

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

      @tanstack/preact-table-devtools

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

      @tanstack/react-table

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

      @tanstack/react-table-devtools

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

      @tanstack/solid-table

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

      @tanstack/solid-table-devtools

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

      @tanstack/svelte-table

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

      @tanstack/table-core

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

      @tanstack/table-devtools

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

      @tanstack/vue-table

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

      @tanstack/vue-table-devtools

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

      commit: 37dc1de

    6. KevinVandy merged this87c6bcc

    7. KevinVandy closed this

Sign in to join this conversation.