feat(bench): real TanStack Table comparator adapter - #122
Merged
Conversation
Phase 2 of 4 for B2 comparative bench. Replaces the Phase 1 placeholder shell with a real TanStack Table v8 + @tanstack/react-virtual adapter: useReactTable + useVirtualizer per the official virtualized-rows example, headless rendering, getSortedRowModel + getFilteredRowModel, setData merge for streaming updates (TanStack has no transaction API), and JSX cell renderers wired to scroll-with-format/-render/-heavy-render scripts. The viewport carries data-pretable-bench-tanstack-viewport, data-tanstack-row, and data-tanstack-cell attributes that match the runtime profile selectors set in Phase 1. keyboard-nav-row resolves to unsupported under the validateSupportedP0aRequest guard inherited from Slab 1 (packages/bench-runner/src/index.ts is locked for Phase 2). That matches the spec's documented unsupported matrix and the cheapest-path default in plan task 2.4. New deps land in apps/bench only (@tanstack/react-table@^8, @tanstack/react-virtual@^3); no leakage into @pretable/* public packages (verified via pnpm why). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Vercel preview readyPreview: https://pretable-qz9pif2t5-cacheplane.vercel.app Updated automatically by the |
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
Phase 2 of 4 for Tier 1 B2 comparative bench.
Replaces the placeholder
tanstack-adapter.tsx(shipped in Phase 1) with a real TanStack Table v8 +@tanstack/react-virtualv3 implementation:useReactTable+useVirtualizerper the official virtualized-rows example.getToggleSortingHandler();getSortedRowModel+getFilteredRowModelengaged.setDatamerge by id — TanStack has no transaction API; this is the honest fairness-asterisk baseline called out in the spec.scroll-with-format/-render/-heavy-render) wired through column-defcell:JSX.data-pretable-bench-tanstack-viewport,data-tanstack-row,data-tanstack-cellattrs matching the runtime profile selectors set in Phase 1, plusdata-row-id/data-row-indexfor the runtime measurement helpers.New deps in
apps/benchonly (@tanstack/react-table@^8,@tanstack/react-virtual@^3); zero leakage into@pretable/*public-surface packages.Provisional resolution
The plan flagged
keyboard-nav-rowas a provisional cell for tanstack. Stock TanStack Table doesn't ship arrow-key cell navigation — adding it would require a custom keyboard handler, which is the kind of shim the spec explicitly forbids. The Slab 1 `validateSupportedP0aRequest` guard in `packages/bench-runner` already returns `unsupported` for non-pretable adapters on this script, matching the spec's documented unsupported matrix. Decision: ship as `unsupported` for tanstack — no adapter or app-shell changes required.What's NOT in this PR
Note on the jsdom shim
The smoke test installs a minimal `ResizeObserver` stub plus `offsetWidth`/`offsetHeight` overrides scoped to elements with `data-pretable-bench-tanstack-viewport`. `@tanstack/react-virtual` reads those for size; jsdom returns 0 for both, and without the shim the virtualizer never emits virtual rows. The shim is per-attribute scoped (returns 0 for non-tanstack elements) and is documented inline in the test. Real-browser matrix runs in Phase 4 are unaffected.
Test plan
🤖 Generated with Claude Code