Skip to content

Plan upgrade of @tanstack/react-table to v9 #72

Description

@cmil

@tanstack/react-table v9 has recently reached stable (9.0.0 shipped 2026-08, current: 9.1.0). Our current peer-dep range is ^8.21.3. This issue tracks the plan for moving to v9 — not whether to do it (it needs to happen sooner or later, since v9 is now the maintained line), but how and when.

Motivation

  • Performance. The v9 migration guide advertises up to 90% memory savings for large tables, 40–70% speed improvements in sorting/filtering/aggregation paths, and further gains in column resizing. Expected to matter for the tables in the Einakter webapp, whose corpus tables are the largest we render.
  • React Compiler compatibility. The v9 state system is built on TanStack Store, which the migration guide describes as "a reactive foundation that works correctly under the React Compiler." This resolves the concern flagged inline in Table.tsx via // eslint-disable-next-line react-hooks/incompatible-library.
  • Ongoing feature/maintenance work (e.g. Infinity page sizes, getCanLastPage) is landing on the v9 line.

Internal changes

Table.tsx is the only file that touches the library and the code changes are mechanical:

  • useReactTableuseTable
  • getCoreRowModel() / getFilteredRowModel() / getSortedRowModel() → declared via features / tableFeatures() with coreRowModel: createCoreRowModel(), filteredRowModel: createFilteredRowModel(), etc.
  • ColumnDef<TData>ColumnDef<TFeatures, TData, TValue>
  • sortingFn column option → sortFn
  • flexRender, SortingState, SortDirection unchanged
  • The // useReactTable may not work with the React Compiler comment and its eslint-disable can be removed.

Public API impact — the coordination cost

@tanstack/react-table is a peerDependency. Consumers (eltec-frontend, ecocor-frontend, dracor-frontend, einakter) supply their own ColumnDef<...> arrays to our <Table> via Table.tsx:

export interface Props<TData = unknown> {
  data: TData[];
  columns: ColumnDef<TData>[];
  defaultSort?: SortingState;
}

In v9 that type requires a new TFeatures generic, so the upgrade has to happen in lockstep across the ecosystem:

  • A major-version bump of @dracor/react.
  • Peer-dep range change: "@tanstack/react-table": "^8.21.3""^9.0.0".
  • Coordinated PRs in the consuming repos.

A legacy shim (@tanstack/react-table/legacyuseLegacyTable, legacyCreateColumnHelper) exists but is documented as deprecated / temporary migration aid; leaning on it doesn't seem worthwhile if we're bumping majors anyway.

Suggested sequencing

  1. Land the current CorpusCard-sharing work in eltec-frontend and ecocor-frontend first (already in progress).
  2. Wait for the v9 ecosystem to settle a bit (a few more patch/minor releases).
  3. Then open a coordinated upgrade PR here + follow-up PRs in each consuming repo, released as @dracor/react v2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions