Skip to content

blog: Table v9 type perf blog#979

Merged
KevinVandy merged 8 commits into
mainfrom
table-v9-type-perf-blog
Jun 15, 2026
Merged

blog: Table v9 type perf blog#979
KevinVandy merged 8 commits into
mainfrom
table-v9-type-perf-blog

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Added a new blog post covering TanStack Table V9 TypeScript type-checking performance improvements, including how table typings were restructured and optimized across the alpha-to-beta cycle.
    • Includes practical guidance for measuring type instantiations using compiler diagnostics/tracing, interpreting results, and understanding what changed when experiments were reverted.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48fce74d-3e80-46d1-ab01-8b2754563bd6

📥 Commits

Reviewing files that changed from the base of the PR and between 2a4b1e8 and 28adcf9.

📒 Files selected for processing (1)
  • src/blog/tanstack-table-v9-typescript-performance.md

📝 Walkthrough

Walkthrough

This PR adds a new blog post documenting the TypeScript type-checking performance improvements made to TanStack Table V9 from alpha.54 through beta.12, detailing the shift from conditional unions to feature maps, optimization techniques, measurement methodology, and practical guidance for developers.

Changes

TypeScript Performance Optimization Blog Post

Layer / File(s) Summary
Post setup and technical context
src/blog/tanstack-table-v9-typescript-performance.md
Blog frontmatter, header image, and explanation of V9's type system complexity compared to V8 due to feature modularization and the TFeatures generic narrowing.
Feature map approach and initial performance metrics
src/blog/tanstack-table-v9-typescript-performance.md
Documents the transition from alpha's hand-written fourteen-branch conditional unions to a named feature map extraction pattern, and reports instantiation metric improvements from alpha.54 to beta.12.
Measurement methodology and results tables
src/blog/tanstack-table-v9-typescript-performance.md
Explains tsc diagnostic tools (--extendedDiagnostics, --generateTrace) and presents detailed instantiation results across @tanstack/table-core, adapters, and example projects.
Optimization mechanisms and strategies
src/blog/tanstack-table-v9-typescript-performance.md
Details four major optimization techniques: using ExtractFeatureMapTypes to reduce conditional recomputation, converting Table_Internal to an interface to prevent re-expansion, applying in out variance annotations, and adding explicit type arguments in adapter helpers to eliminate inference overhead. Also documents a measured regression from splitting feature maps that was reverted.
Practical guidance and takeaways
src/blog/tanstack-table-v9-typescript-performance.md
Provides four numbered recommendations for practitioners: measuring instantiations, understanding named-type cache behavior, careful variance annotation application, and tracking optimization failures and reverts.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested Reviewers

  • schiller-manuel
  • AlemTuzlak

Poem

🐰 A post about types so sleek,
Performance peaks reached week by week!
Features mapped with care and grace,
Variance annotations find their place—
Instants drop, and editors zoom,
No more slowdown in the room!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'blog: Table v9 type perf blog' is directly related to the main change—adding a blog post about TypeScript type instantiation performance improvements in TanStack Table V9.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch table-v9-type-perf-blog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/blog/tanstack-table-v9-typescript-performance.md`:
- Line 16: Fix the typo in the intro sentence: replace the phrase "turned our to
be one of our bigger optimizations" with "turned out to be one of our bigger
optimizations" so the sentence reads correctly.
- Around line 257-261: The paragraph overstates the safety of the `in out`
variance claim; replace the sentences that say "`in out` annotation is simply
trusted" and "sound to do regardless of the structure" with a more accurate
explanation: state that `in out` asserts invariance for the compiler's
instantiation-based comparisons and can bypass structural variance probing
(i.e., the compiler will use the annotated invariance rather than derive
variance from the type's structure), that this usually only restricts
assignability but can also remove relations the code relies on (as shown by
`TValue` breaking the build), and therefore it should be applied only where
parameters are invariant in practice (keeping the `Table_Internal` and `TValue`
examples as-is to illustrate the benefit and caveat).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e6d1f5f-d5d0-48de-88f5-ab374867343d

📥 Commits

Reviewing files that changed from the base of the PR and between 19fa64a and c87762d.

⛔ Files ignored due to path filters (1)
  • public/blog-assets/tanstack-table-v9-typescript-performance/header.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/blog/tanstack-table-v9-typescript-performance.md

Comment thread src/blog/tanstack-table-v9-typescript-performance.md Outdated
Comment thread src/blog/tanstack-table-v9-typescript-performance.md Outdated
---
title: TypeScript Performance in TanStack Table V9
published: 2026-06-13
excerpt: TanStack Table V9's types do a lot more than V8's did. Here's how we cut type instantiations by 66-85% across every package between the alpha.54 and beta.11 to keep the editor experience feeling nearly instant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"nearly"? why so defensive?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In my own experience, there's usually still a noticeable few tenths of a second for the type to pop up. Plus there is still a lot of things going on that make this a slower typescript experience compared to v8. It's just way less of a time cost now and the tradeoffs are worth it.

So I didn't think "nearly" was defensive, just accurate


![TanStack Table V9 - TypeScript Performance](/blog-assets/tanstack-table-v9-typescript-performance/header.png)

TanStack Table V9 has a much more capable, though more complex, type system than V8. The types in Table may not be as complicated as a project like TanStack Router or Form, but it has still grown more complex in V9 than it ever had been in previous versions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is "type system" the right term here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want a better term. What should it be?

@schiller-manuel schiller-manuel Jun 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"type-level API" maybe?


TanStack Table V9 has a much more capable, though more complex, type system than V8. The types in Table may not be as complicated as a project like TanStack Router or Form, but it has still grown more complex in V9 than it ever had been in previous versions.

If you had been using the Table V9 alphas, there's a chance that you could feel a bit of slowness in your editor. Good news, though! Between the alpha and the latest beta, we cut TypeScript's type-checking work by 66-85% across every package and example! The latest beta now type-checks faster than our alpha versions from last week by a wide margin, and the editor experience is back to feeling nearly instant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

again "nearly"


If you had been using the Table V9 alphas, there's a chance that you could feel a bit of slowness in your editor. Good news, though! Between the alpha and the latest beta, we cut TypeScript's type-checking work by 66-85% across every package and example! The latest beta now type-checks faster than our alpha versions from last week by a wide margin, and the editor experience is back to feeling nearly instant.

This post covers where the cost came from, how we measured it, and the specific changes that fixed these issues. One of those changes is a still overlooked TypeScript feature that many library authors still seem to barely use, and it turned our to be one of our bigger optimizations, turning a trade-off into a win across the board.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

still still

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/blog/tanstack-table-v9-typescript-performance.md`:
- Line 14: The headline at line 14 claims a 66-85% improvement "across every
package and example," but the measured data in the tables below shows results
ranging from as low as 36% for examples and 62.1% for `@tanstack/vue-table`, which
fall outside this range. Either widen the percentage range to accurately reflect
all measured improvements (likely 36-85% or similar), or narrow the claim by
removing "across every package and example" and specifying only which packages
or examples achieve the 66-85% improvement. Apply the same correction at line 4,
which contains the identical claim. Ensure the headline numbers align with the
complete data presented in the tables below.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c7ef0bb-b78c-422a-a091-5418440fac15

📥 Commits

Reviewing files that changed from the base of the PR and between c87762d and 7d66d88.

📒 Files selected for processing (1)
  • src/blog/tanstack-table-v9-typescript-performance.md

Comment thread src/blog/tanstack-table-v9-typescript-performance.md Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/blog/tanstack-table-v9-typescript-performance.md`:
- Line 256: Fix the spelling error in the opening sentence of the paragraph that
starts with "The large improvment came from noticing that internal code doesn't
need the feature-conditional view at all." Change the misspelled word
"improvment" to "improvement" to correct the grammar.
- Line 4: The performance range claim of "66-86% across every package and
example" in the excerpt (line 4) and opening line (line 14) is inaccurate based
on the measured data shown below in the document. The core and adapter tables
show improvements from -62.1% to -85.9%, while kitchen-sink examples range from
36% to 79%, making the actual spread 36-86% across all packages and examples.
Update both line 4 and line 14 to either widen the range to 36-86% to cover all
examples, split the claim with separate ranges for core/adapters versus
examples, or remove the specific percentage range entirely and direct readers to
the detailed tables below for the complete performance breakdown.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 149c4eb6-da39-4074-8ca7-a8d9fb336de4

📥 Commits

Reviewing files that changed from the base of the PR and between ab77068 and 2a4b1e8.

📒 Files selected for processing (1)
  • src/blog/tanstack-table-v9-typescript-performance.md

Comment thread src/blog/tanstack-table-v9-typescript-performance.md Outdated
Comment thread src/blog/tanstack-table-v9-typescript-performance.md Outdated
@KevinVandy KevinVandy merged commit 4fcd8b3 into main Jun 15, 2026
9 checks passed
@KevinVandy KevinVandy deleted the table-v9-type-perf-blog branch June 15, 2026 12:24
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.

3 participants