Repository navigation
feat: retarget @octanejs/tanstack-table to TanStack Table v9 - #283
Conversation
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]>
|
@KevinVandy is attempting to deploy a commit to the Ripple Team Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
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:*", |
There was a problem hiding this comment.
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)
Triggered by learned rule: Binding packages must not depend on other @octanejs binding packages
Reviewed by Cursor Bugbot for commit 2ee4bca. Configure here.
There was a problem hiding this comment.
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
#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.
* 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.


Summary
@octanejs/tanstack-tablefrom TanStack Table v8 to v9, porting the v9 adapter surface onto octane.examples/react/cell-selection.Why
The binding adapted
@tanstack/react-tablev8 (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-tablePorted from the v9 React adapter, against
@tanstack/[email protected]:types.ts.ts, so the.tsrx.d.tssidecars stay thin)reactivity.tsoctaneReactivity()— table-core'scoreReactivityFeatureover TanStack Store atomsuseTable.tsrxuseTable(options, selector?),table.state/Subscribe/FlexRenderSubscribe.tsrxFlexRender.tsflexRender+FlexRender(incl. aggregated / placeholder cells)createTableHook.tsrxuseAppTable,AppTable/AppCell/AppHeader/AppFooter, component registries,createAppColumnHelpercreateTableHookContexts.tsNotes for reviewers:
useTableanduseAppTableend in an optionalselector, so the compiler-injected call-site slot lands in it —useTable(options)compiles touseTable(options, slot). Both split the trailing slot off their rest args (src/internal.ts), same as the sibling store/query/hotkeys bindings.@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-storeinstall to keep that true.useLegacyTableis deliberately not ported. Upstream's v8-compat shim exists to migrate existing React v8 codebases; an octane binding has none.tsgotypecheck chain tobindings:typecheck(tsrx-tsc), since it now contains.tsrx.Repo bookkeeping these changes forced
packages/octane/tests/external-hook-slot.test.ts:tanstack-tabledropped out of the hand-slot-forwarding registry. Every hook it exports now lives in.tsrx(fully compiled, so theoctane.hookSlots.manualflag would not apply anyway), and its remaining plain.tssources call no slot-keyed hook — onlyuseContext, which is exempt. That matches the other all-.tsrxbindings (tanstack-form,tanstack-hotkeys,tanstack-ai), none of which are listed.packages/octane-evalscorpus regenerated: it pins a lockfile hash, and this PR changespnpm-lock.yaml.scripts/check-package-packs.mjs:@octanejs/tanstack-storeand@octanejs/tanstack-hotkeysjoin the packed Pulseboard set (neither is published at the workspace version — hotkeys is not published at all), plus adependencyEdgesentry asserting a single@octanejs/tanstack-storeinstall.scripts/run-example-e2e.test.mjsshard-weight baseline[28, 29, 30]→[29, 29, 30](pulseboard gained one e2e journey).Pulseboard example
tableFeatures,useTable,table.state,getAllCells()).cellSelectionFeature: click / shift-click / Ctrl-click ranges, drag-to-select, andgetSelectionEdges()-driven outlines. No extra chrome — the panel gains no summary line, hint text, or buttons; every action is a keyboard shortcut.@octanejs/tanstack-hotkeysscoped to the grid, matching the React example.useTableselector deliberately excludescellSelection; rows subscribe to that atom individually, so a drag re-renders only the rows whose outline changed.Validation
pnpm format:check— cleanpnpm 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) andjotai/tests/conformance/utils.test.ts(needslocalStorage, unavailable without--localstorage-file).vitest --project tanstack-table— 39 passed, including 5 differential tests that run the same.tsrxfixture through octane and real@tanstack/react-table@9and assert byte-identical HTML across sorting, filtering, pagination, selection, visibility, expanding, andUpdater<T>compositioncell-range-selectionjourney 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 classespnpm packages:pack:check,pnpm examples:static:check,pnpm bindings:status:check,pnpm tsrx-decls:check,pnpm changeset:checkRisk / follow-ups
useReactTable→useTable;get*RowModel()options → thefeaturesoption;row.getVisibleCells()now requirescolumnVisibilityFeature(getAllCells()is the always-available accessor);table.getState()→table.state. A user-suppliedonSortingChange-style handler now replaces the feature's default atom writer rather than composing with it, so pair it withstate. All recorded in the changeset.@tanstack/table-core@9is still a beta (9.0.0-beta.58), pinned exactly. The v8 catalog entry is untouched, sobenchmarks/tanstack-com/reactstays on v8.openDashboardin the pulseboard spec asserts a transientaria-busy="true"right aftergoto(..., { 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 againstHEAD); worth fixing separately before this suite gates CI..tsrxformatter silently dropsconsttype-parameter modifiers. Minimal repro:export function f<const T extends string>(x: T): Treformats to<T extends string>. It stripped them fromcreateTableHook's component-map generics; the published.tsrx.d.tssidecar 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/storeinstalls would break subscriptions.Overview
Retargets
@octanejs/tanstack-tablefrom TanStack Table v8 to v9 (@tanstack/[email protected]). The adapter is rewritten arounduseTable,Subscribe,flexRender/FlexRender,createTableHook, and store-driven state via@octanejs/tanstack-storeanduseSelector, replacing v8’suseReactTableanduseStatewiring.useLegacyTableis not ported.useTable/useAppTablestrip the compiler hook slot from rest args so an optional trailingselectordoes not consume the slot.Docs and release notes update binding status, package entry counts, and a changeset describing the breaking API shifts (
featuresvsget*RowModel(),table.statevsgetState(),getAllCells(), customon*Changebehavior).Pulseboard migrates to the v9 API and adds cell range selection (click, shift-click, drag, keyboard via
@octanejs/tanstack-hotkeys) with per-rowtable.SubscribeoncellSelectionfor cheaper drags, plus a new Playwright journey and styles.Tooling:
tanstack-tablemoves tobindings:typecheck(tsrx-tsc); it is removed from the manual hook-slot forwarding registry because hooks live in.tsrx. Eval train manifestoverlayLockfileHashupdates; roottypecheckno longer typecheckstanstack-tableviatsgo.Reviewed by Cursor Bugbot for commit 0696191. Bugbot is set up for automated code reviews on this repo. Configure here.