Skip to content

feat: retarget @octanejs/tanstack-table to TanStack Table v9 - #283

Merged
trueadm merged 3 commits into
octanejs:mainfrom
KevinVandy:feat/tanstack-table-v9
Jul 26, 2026
Merged

trueadm merged 3 commits into
octanejs:mainfrom
KevinVandy:feat/tanstack-table-v9

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Retarget @octanejs/tanstack-table from TanStack Table v8 to v9, porting the v9 adapter surface onto octane.
  • Port the Pulseboard example to the v9 API (required — it would no longer compile) and add cell range selection to it, mirroring upstream's examples/react/cell-selection.

Why

The binding adapted @tanstack/react-table v8 (useReactTable + flexRender). v9 is a different architecture: a framework-agnostic core built on TanStack Store atoms, tree-shakeable features, and a thin adapter that subscribes to a selected state slice. Adapting v8 meant octane users could not reach any of that.

Changes

@octanejs/tanstack-table

Ported from the v9 React adapter, against @tanstack/[email protected]:

File Contents
types.ts Whole public type surface (plain .ts, so the .tsrx.d.ts sidecars stay thin)
reactivity.ts octaneReactivity() — table-core's coreReactivityFeature over TanStack Store atoms
useTable.tsrx useTable(options, selector?), table.state / Subscribe / FlexRender
Subscribe.tsrx Store/atom subscription component
FlexRender.ts flexRender + FlexRender (incl. aggregated / placeholder cells)
createTableHook.tsrx useAppTable, AppTable/AppCell/AppHeader/AppFooter, component registries, createAppColumnHelper
createTableHookContexts.ts Scoped table/cell/header contexts

Notes for reviewers:

  • Hook-slot ABI. useTable and useAppTable end in an optional selector, so the compiler-injected call-site slot lands in it — useTable(options) compiles to useTable(options, slot). Both split the trailing slot off their rest args (src/internal.ts), same as the sibling store/query/hotkeys bindings.
  • Single store path. Every TanStack Store primitive is imported from @octanejs/tanstack-store (which re-exports all of @tanstack/store) rather than the store core directly. Atoms compare by identity, so two resolved copies would silently break every subscription. The pulseboard pack canary now asserts a single @octanejs/tanstack-store install to keep that true.
  • useLegacyTable is deliberately not ported. Upstream's v8-compat shim exists to migrate existing React v8 codebases; an octane binding has none.
  • The package moved from the tsgo typecheck chain to bindings:typecheck (tsrx-tsc), since it now contains .tsrx.

Repo bookkeeping these changes forced

  • packages/octane/tests/external-hook-slot.test.ts: tanstack-table dropped out of the hand-slot-forwarding registry. Every hook it exports now lives in .tsrx (fully compiled, so the octane.hookSlots.manual flag would not apply anyway), and its remaining plain .ts sources call no slot-keyed hook — only useContext, which is exempt. That matches the other all-.tsrx bindings (tanstack-form, tanstack-hotkeys, tanstack-ai), none of which are listed.
  • packages/octane-evals corpus regenerated: it pins a lockfile hash, and this PR changes pnpm-lock.yaml.
  • scripts/check-package-packs.mjs: @octanejs/tanstack-store and @octanejs/tanstack-hotkeys join the packed Pulseboard set (neither is published at the workspace version — hotkeys is not published at all), plus a dependencyEdges entry asserting a single @octanejs/tanstack-store install.
  • scripts/run-example-e2e.test.mjs shard-weight baseline [28, 29, 30] → [29, 29, 30] (pulseboard gained one e2e journey).

Pulseboard example

  • Ported to the v9 API (tableFeatures, useTable, table.state, getAllCells()).
  • Added cellSelectionFeature: click / shift-click / Ctrl-click ranges, drag-to-select, and getSelectionEdges()-driven outlines. No extra chrome — the panel gains no summary line, hint text, or buttons; every action is a keyboard shortcut.
  • Keyboard navigation via @octanejs/tanstack-hotkeys scoped to the grid, matching the React example.
  • The useTable selector deliberately excludes cellSelection; rows subscribe to that atom individually, so a drag re-renders only the rows whose outline changed.

Validation

  • pnpm format:check — clean
  • pnpm typecheck — clean (exit 0)
  • pnpm test — 13,477 passed. Two failing files were caused by this PR and are fixed (the hook-slot registry and the evals corpus above); both verified green in isolation afterwards. Two unrelated files still fail on this machine and are not from this PR: base-ui/tests/differential/parity.test.ts (passes 52/52 in isolation — parallel-execution contention, the first case times out at 5s) and jotai/tests/conformance/utils.test.ts (needs localStorage, unavailable without --localstorage-file).
  • targeted: vitest --project tanstack-table — 39 passed, including 5 differential tests that run the same .tsrx fixture through octane and real @tanstack/react-table@9 and assert byte-identical HTML across sorting, filtering, pagination, selection, visibility, expanding, and Updater<T> composition
  • targeted: pulseboard Playwright suite — 7 passed, including a new cell-range-selection journey covering click, shift-click, edge outlines, drag, arrow nav, Shift+arrow extend, Mod+A select-all, and Escape clear, asserted through the cells' own selection classes
  • pnpm packages:pack:check, pnpm examples:static:check, pnpm bindings:status:check, pnpm tsrx-decls:check, pnpm changeset:check

Risk / follow-ups

  • API changes vs the old v8 binding, listed for orientation rather than as a migration burden — Octane is experimental and this binding has no users: useReactTable → useTable; get*RowModel() options → the features option; row.getVisibleCells() now requires columnVisibilityFeature (getAllCells() is the always-available accessor); table.getState() → table.state. A user-supplied onSortingChange-style handler now replaces the feature's default atom writer rather than composing with it, so pair it with state. All recorded in the changeset.
  • @tanstack/table-core@9 is still a beta (9.0.0-beta.58), pinned exactly. The v8 catalog entry is untouched, so benchmarks/tanstack-com/react stays on v8.
  • Pre-existing flake, not from this PR: openDashboard in the pulseboard spec asserts a transient aria-busy="true" right after goto(..., { waitUntil: 'commit' }), which is already gone if the app renders fast enough. It fails roughly 1 run in 3 and affects all 7 tests. Unmodified here (verified against HEAD); worth fixing separately before this suite gates CI.
  • Separate octane bug found: the prettier .tsrx formatter silently drops const type-parameter modifiers. Minimal repro: export function f<const T extends string>(x: T): T reformats to <T extends string>. It stripped them from createTableHook's component-map generics; the published .tsrx.d.ts sidecar retains them, so consumer inference is correct, but implementation and declaration disagree. Not addressed here — it needs its own fix in the formatter.

🤖 Generated with Claude Code


Note

High Risk
This is a breaking retarget of a core data-table binding onto beta table-core v9, with new store-atom subscription semantics and compiler hook-slot handling—apps on the old v8 surface must migrate, and duplicate @tanstack/store installs would break subscriptions.

Overview
Retargets @octanejs/tanstack-table from TanStack Table v8 to v9 (@tanstack/[email protected]). The adapter is rewritten around useTable, Subscribe, flexRender/FlexRender, createTableHook, and store-driven state via @octanejs/tanstack-store and useSelector, replacing v8’s useReactTable and useState wiring. useLegacyTable is not ported. useTable/useAppTable strip the compiler hook slot from rest args so an optional trailing selector does not consume the slot.

Docs and release notes update binding status, package entry counts, and a changeset describing the breaking API shifts (features vs get*RowModel(), table.state vs getState(), getAllCells(), custom on*Change behavior).

Pulseboard migrates to the v9 API and adds cell range selection (click, shift-click, drag, keyboard via @octanejs/tanstack-hotkeys) with per-row table.Subscribe on cellSelection for cheaper drags, plus a new Playwright journey and styles.

Tooling: tanstack-table moves to bindings:typecheck (tsrx-tsc); it is removed from the manual hook-slot forwarding registry because hooks live in .tsrx. Eval train manifest overlayLockfileHash updates; root typecheck no longer typechecks tanstack-table via tsgo.

Reviewed by Cursor Bugbot for commit 0696191. Bugbot is set up for automated code reviews on this repo. Configure here.

The binding adapted @tanstack/react-table v8 (useReactTable + flexRender).
v9 is a different architecture: a framework-agnostic core over TanStack Store
atoms, tree-shakeable features, and a thin adapter that subscribes to a
selected state slice.

Port the v9 adapter onto octane — useTable, Subscribe, flexRender/FlexRender,
createTableHook, createTableHookContexts — over @tanstack/table-core@9. Table
state lives in Store atoms via table-core's coreReactivityFeature bindings and
re-renders are driven by useSelector over the selected slice.

useTable and useAppTable end in an optional `selector`, so both split the
compiler-injected trailing hook slot off their rest args; otherwise
useTable(options) reads the slot symbol as the selector.

Upstream's useLegacyTable v8-compat entry is intentionally not ported — it
exists to migrate existing React v8 codebases, which an octane binding has
none of.

Port the Pulseboard example to the v9 API (it would no longer compile) and add
cell range selection with @octanejs/tanstack-hotkeys keyboard navigation,
mirroring upstream's examples/react/cell-selection.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@KevinVandy is attempting to deploy a commit to the Ripple Team Team on Vercel.

A member of the Team first needs to authorize it.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 2ee4bca. Configure here.

},
"dependencies": {
"@tanstack/table-core": "catalog:default"
"@octanejs/tanstack-store": "workspace:*",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inter-binding workspace dependency

Medium Severity

@octanejs/tanstack-table newly declares a workspace:* dependency on @octanejs/tanstack-store and imports store hooks, atoms, and types from that sibling binding. Binding packages must not depend on other @octanejs/* binding packages; shared pieces belong duplicated inside the binding (or sourced from framework-agnostic cores) rather than creating inter-binding coupling.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: Binding packages must not depend on other @octanejs binding packages

Reviewed by Cursor Bugbot for commit 2ee4bca. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applicable here — this is the repo's established pattern, not new coupling.

@octanejs/tanstack-form already declares the identical dependency and uses it the same way:

// packages/tanstack-form/package.json
"dependencies": {
  "@octanejs/tanstack-store": "workspace:*",
  "@tanstack/form-core": "catalog:default"
}
// packages/tanstack-form/src/useForm.tsrx (and useField/useFieldGroup/useFormGroup)
import { useSelector } from '@octanejs/tanstack-store';
// packages/tanstack-form/src/index.ts even re-exports it:
export { useSelector, useStore } from '@octanejs/tanstack-store';

It is also not an isolated exception — 11 workspace packages depend on a sibling @octanejs/* binding today:

package depends on
tanstack-form @octanejs/tanstack-store
tanstack-start @octanejs/tanstack-router
base-ui, lexical, radix, visx @octanejs/floating-ui
recharts, redux-toolkit @octanejs/redux
rsbuild-plugin-octane @octanejs/app-core, @octanejs/rspack-plugin
rspeedy-plugin-octane @octanejs/lynx, @octanejs/rspack-plugin
vite-plugin-octane @octanejs/app-core

The suggested alternative — "duplicated inside the binding, or sourced from the framework-agnostic core" — would actively introduce a bug here. TanStack Store atoms compare by identity. Reaching for @tanstack/store directly would give the binding a second resolution path to the store core, and two copies means the table's atoms and the app's useSelector no longer match, silently breaking every subscription. That is precisely why this PR routes every store primitive (createAtom, batch, shallow, and the atom/store types) through @octanejs/tanstack-store, which re-exports all of @tanstack/store.

The singleton is enforced, not assumed: scripts/check-package-packs.mjs now carries a dependencyEdges entry asserting that the packed @octanejs/tanstack-table and the app resolve the same @octanejs/tanstack-store install.

Leaving as-is. Happy to revisit if the maintainers want the sibling-binding rule applied repo-wide, but that would be a separate change touching all 11 packages.

@vercel

vercel Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
octane-website Ready Ready Preview, Comment Jul 26, 2026 8:40pm
octane-website-mcp Ready Ready Preview, Comment Jul 26, 2026 8:40pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 26, 2026 20:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 26, 2026 20:40 Inactive
@trueadm
trueadm merged commit bd094ec into octanejs:main Jul 26, 2026
28 checks passed
WebEferen added a commit that referenced this pull request Jul 26, 2026
#283 landed the same fix on main as `installableDependencySpec`, and the merge
took both implementations because they sit in different regions of the file. Only
main's is wired into DEP_SPECS, so `resolveSiblingVersions`, `siblingVersions`
and `depSpec` were dead code describing a path that never ran.

Keep main's. The emitted registry is byte-identical either way: all three shadcn
siblings (lucide, radix, sonner) live in a directory named after the unscoped
package, which is the only case where the two resolvers differ.
WebEferen added a commit that referenced this pull request Jul 26, 2026
* Resolve workspace specs in the shadcn registry and gate the class

The registry builder copied package.json specifiers verbatim into the install
specs the upstream shadcn CLI runs, so a `workspace:*` sibling emitted
`@octanejs/radix@workspace:*`, which no consumer can install. Resolve the
protocol to the sibling's current version, the substitution `pnpm pack` already
makes for the published manifest.

Those pins go stale on every sibling bump, so `changeset:version` regenerates
the registry alongside the other generated artifacts, and CI now gates
`registry:check`, which nothing checked before.

validateWorkspacePackages rejects any sibling edge that is not `workspace:*`.
That is the defect that broke the release job, and `packages:inventory:check`
already gates it in CI.

* Keep the registry test off hard-coded sibling versions

registry.test.ts asserted the literal `@octanejs/[email protected]` the frozen pins
happened to emit, so resolving the workspace protocol failed it. Derive the
expected version from the sibling manifest instead: a literal goes stale on
every sibling release, which is the drift the emit exists to avoid. Adds the
case that actually guards the generator, that no item emits a local protocol.

The shadcn vitest project's radix note described the pinned published copy;
`workspace:*` makes that resolution the sibling source.

* Regenerate the user-app corpus manifest

Two independent drifts left manifest.jsonl stale, and the evals suite failed on
both.

`overlayLockfileHash` pins pnpm-lock.yaml, which #289 changed when it moved
@octanejs/shadcn onto workspace siblings without rerunning the generator. That
one was already stale on main; this branch just inherited it.

`graderDigest` pins vitest.config.js, because the grading harness runs the
submission under that exact config. The previous commit reworded the shadcn
project's radix note, so every task's digest moved with it.

Nothing else changed: same 19 tasks, same ids, same template and reference
digests.

* Drop the duplicated workspace resolver from the registry builder

#283 landed the same fix on main as `installableDependencySpec`, and the merge
took both implementations because they sit in different regions of the file. Only
main's is wired into DEP_SPECS, so `resolveSiblingVersions`, `siblingVersions`
and `depSpec` were dead code describing a path that never ran.

Keep main's. The emitted registry is byte-identical either way: all three shadcn
siblings (lucide, radix, sonner) live in a directory named after the unscoped
package, which is the only case where the two resolvers differ.

* Regenerate the user-app corpus manifest after the main merge

`graderDigest` pins vitest.config.js. The merge kept main's manifest lines,
which were generated before this branch's radix note reword, so all 19 digests
were stale again. Only that field moves; the lockfile hash main regenerated is
already correct.

This branch was previously deployed

2 inactive deployments
Preview – octane-website — 06961911 Deployed Jul 26, 2026 by vercel[bot]
Preview – octane-website-mcp — 06961911 Deployed Jul 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants