Repository navigation
@octanejs/tanstack-table: complete @tanstack/react-table 8.21.3 binding (+ keyed-@for survivor-skip soundness fix) - #44
Merged
Conversation
New binding completing the TanStack suite (query, router, now table): @tanstack/table-core is reused verbatim (both catalog entries exact-pinned to 8.21.3 so the differential oracle shares the shipped core); the ~100-line React adapter (useReactTable, flexRender) is transcribed onto octane hooks preserving upstream's useState-based state wiring. flexRender renders component cells through octane's createElement descriptors; upstream's class-component and memo/forwardRef exotic branches are dropped (octane's memo() returns a plain function — proven by a memo-wrapped cell test). Also fixes a keyed-@for compiler soundness bug the port exposed: the PURE/DEP-PURE survivor short-circuit rendered STALE output when an item body contained a render-time call reading mutable state through a ref-stable item — the canonical TanStack header markup (header.column.getIsSorted() on table-core's memoized header objects). compile.js's body analysis now disqualifies call-bearing bodies (containsRenderCall); calls deferred inside event-handler closures stay eligible, and property-read-only bodies (the measured js-framework- benchmark/dbmon wins, flags=14 verified) keep the promotion. Regression pinned in packages/octane/tests/for.test.ts (CallBodyList). - 35 tests: core wiring (stable instance, data/columns swaps, controlled + passthrough state, functional-updater contract, render-count probe), flexRender triage (string/fn/component/undefined/descriptor/memo + the upstream !Comp falsy quirk pinned), feature smokes (column/global filter, faceting, pagination, selection incl. predicate select-all semantics, visibility + group colSpan, nested expanding with DOM identity, grouping/aggregation), export parity + core-instance identity. - 5 differential fixtures byte-identical vs real @tanstack/react-table: basic/sorting/filter-paginate/selection/visibility-expand. Checkboxes use the controlled-forms onClick precedent; selection surfaced as text/data attrs (checked is a DOM property, invisible to innerHTML); no <select> (the rig has no change driver). - Wiring: vitest project + aliases, typecheck chain, catalog pins, status.json + regenerated bindings table (16), README, changesets (binding + octane compiler fix), hook-slot registry pin, MCP KNOWN_BINDINGS + bridge skill rows. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2 of 5 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
@octanejs/tanstack-tablebinding — a complete 1:1 port of@tanstack/react-table8.21.3 completing the TanStack suite (query, router, table) — plus a keyed-@forcompiler soundness fix the port exposed.The binding
@tanstack/table-corereused verbatim and re-exported; both catalog entries are exact-pinned to 8.21.3 (react-table's only dep is table-core at the same version — a caret would let the differential oracle drift from the shipped core).useReactTabletranscribed line-for-line onto octane hooks, preserving upstream'suseState-based shape (create-once instance, state inuseStatewired intoonStateChange, render-phasesetOptionsre-composition) — so partially-controlled state,onStateChangepassthrough, and table-core's functionalUpdater<T>contract behave exactly as on React. Slot forwarding via the sharedsubSlothelpers.flexRender: components render through octane'screateElementdescriptor at value position; strings/numbers/pre-created elements pass through. Upstream's class-component andreact.memo/forwardRefexotic-object branches are dropped — provably dead in octane (no classes/forwardRef;memo()returns a plain function, covered by a memo-wrapped-cell test). The upstream!Compfalsy quirk (''/0→null) is pinned as parity, not fixed.Compiler fix: keyed
@forstale-survivor soundnessThe canonical TanStack header markup —
{header.column.getIsSorted()}inside the header@for— rendered stale: table-core memoizes header objects, so the PURE/DEP-PURE survivor short-circuit skipped ref-stable items whose bodies read changed state through a method call. React re-runs bodies unconditionally.Fix in
compile.js's body analysis:containsRenderCalldisqualifies bodies executing any call during render (calls can read state neither the item ref nor the deps tuple witnesses). Calls deferred inside event-handler closures stay eligible, and property-read-only bodies keep the promotion — the js-framework-benchmark row shape still compiles with full flags (14= singleRoot + depEligible + indexIndependent), so the measured perf wins are intact. Regression pinned inpackages/octane/tests/for.test.ts(CallBodyList), contrasted with the existingDepPureList(bare module-var reads remain documented at-your-own-risk). Separateoctanepatch changeset included.Tests (35 in the new
tanstack-tableproject)core.test.tsx+ the matrix upstream doesn't have): markup render, stable instance identity, rowModel, data/columns swaps through render-phasesetOptions, uncontrolled sorting asc→desc→cleared, partially-controlledstate.sorting+onSortingChange,onStateChangepassthrough with internal state still applied, queued functional updaters within one event, and a one-click-one-render probe.getIsAllRowsSelectedcounts only selectable rows → isAll AND isSome both true), column visibility with group-header colSpan, nested expanding with keyed-row DOM-node identity, grouping + aggregatedCell.@tanstack/react-table+ core-instance identity (both rig sides share one table-core).onClickprecedent, state surfaced as text/data attrs sincecheckedis invisible to innerHTML), visibility+expanding (incl. collapse-with-retained-child-expansion).Reviewer notes
autoResetPageIndex: false; the differential pins the default double-update behavior byte-for-byte.1_name_firstName) — tests query structurally.<select>in differential fixtures (the rig has nochangedriver); page size via buttons.status.jsonnotes column sizing/pinning drag interactions are untested-by-interaction (jsdom/rig has no mousemove); their state APIs are verbatim table-core computation.Validation
pnpm test: 762/764 files passed (2 skipped), 5,927 tests passed (8 expected-fail pins, 1 skip, 58 todo)pnpm typecheck,pnpm format:check,pnpm bindings:status:check,pnpm changeset:checkall green🤖 Generated with Claude Code
Note
Medium Risk
The compile.js @for purity change affects reconciliation for all keyed lists app-wide; mitigated by targeted tests and preserved read-only optimizations, while the large new binding is heavily differential-tested.
Overview
Adds
@octanejs/tanstack-table, a 1:1 port of@tanstack/[email protected]:@tanstack/table-coreis re-exported unchanged;useReactTableandflexRenderare transcribed onto octane hooks (including hook subSlot forwarding). Export parity and byte-identical differential tests vs real react-table cover sorting, filtering, pagination, selection, visibility, and expanding.Fixes a keyed
@forcompiler soundness bug exposed by table headers:containsRenderCallnow blocks PURE/DEP-PURE survivor short-circuit when the item body has render-time calls (e.g.header.column.getIsSorted()on stable memoized items), so bodies re-run each parent render like React. Property-only bodies and calls inside event handlers stay optimizable. Regression:CallBodyListinfor.test.ts; separate octane patch changeset.Wires the binding into bindings status, root typecheck, vitest
tanstack-tableproject + differential precompile, and MCP KNOWN_BINDINGS / bridge skill table.Reviewed by Cursor Bugbot for commit 0a35609. Bugbot is set up for automated code reviews on this repo. Configure here.