Skip to content

chore(deps): drop unused transitive @tanstack/react-table from the install graph - #1917

Draft
stipsan wants to merge 1 commit into
mainfrom
cursor/remove-unused-tanstack-react-table-9958
Draft

chore(deps): drop unused transitive @tanstack/react-table from the install graph#1917
stipsan wants to merge 1 commit into
mainfrom
cursor/remove-unused-tanstack-react-table-9958

Conversation

@stipsan

@stipsan stipsan commented Aug 18, 2026

Copy link
Copy Markdown
Member

Description

Started as the @tanstack/react-table v8 → v9 upgrade from sanity-io/sanity#14114, applied to this monorepo while following the React Compiler guide thoroughly. Working through the guide surfaced that there is nothing to upgrade or migrate here — but there is something to remove.

Audit results (what the guide asks you to check):

  • No workspace package depends on @tanstack/react-table, and no source file references any of its APIs (useReactTable, useTable, flexRender, createColumnHelper, getCoreRowModel, TableMeta, Subscribe). @sanity/table is a custom implementation, sanity-plugin-media renders its table view with react-virtuoso.
  • The React Compiler is enabled for plugin builds (reactCompiler: true in each tsdown.config.ts) and enforced via the react/react-compiler oxlint rule, so a v8 useReactTable consumer here would be a real hazard — v8 is the canonical interior-mutability example in React's incompatible-library lint docs. The repo's only 'use no memo' directive (media plugin's asset details form) is a react-hook-form register() issue, unrelated to tables.
  • The other @tanstack/* dependencies in this repo (react-query v5 in the Vercel widget, react-virtual v3 in workflow) are not covered by the Table v9 rework; react-virtual has no store-based, compiler-ready major to move to yet (latest is 3.14.9).
  • The only copy of table v8 in this workspace is a transitive dependency of sanity (pinned to the next dist-tag): pnpm why shows no other path, and the installed sanity@6.10.0-next.53 build has zero react-table references outside its package.json — the sheet-list consumer was removed in sanity-io/sanity#12477 and the dependency itself in sanity-io/sanity#14121 (merged today).

The change: a scoped pnpm removal override, 'sanity>@tanstack/react-table': '-', drops the unused package (and @tanstack/table-core) from the lockfile and install graph now. Scoping it to the sanity> edge means it self-neutralizes once the pinned next prerelease ships without the dependency, and it cannot interfere if a plugin ever adopts table v9 directly — at which point the override should be deleted (noted in the comment).

Why not wait for the upstream release? Release @next in sanity-io/sanity runs on a schedule (~07:17/14:13 UTC); today's second run started before #14121 merged (14:24 UTC), so the current sanity@next (6.10.0-next.87) still declares ^8.21.3. Also worth flagging: a plain lockfile re-resolution to next.87 is currently blocked anyway — it pulls @sanity/sdk@3.0.0-rc.1, which fails the workspace trustPolicy: no-downgrade check (no provenance on the RC while earlier versions had it). That is a pre-existing condition this PR does not touch; the lockfile was therefore edited surgically (verified: pnpm install reports Already up to date, and a clean reinstall produces a tree where sanity's virtual-store dirs no longer link react-table).

What to review

  • pnpm-workspace.yaml — the scoped override and its removal note
  • pnpm-lock.yaml — removals only: the override mirror, the @tanstack/react-table@8.21.3 + @tanstack/table-core@8.21.3 package/snapshot entries, and the three sanity snapshot edges

Testing

No changeset — no published package's package.json or runtime code changes (workspace config + lockfile only, same as the dedupe PRs). Verified locally on the branch:

  • pnpm install --frozen-lockfile from a clean node_modules (tree confirmed free of react-table)
  • pnpm format — no diffs
  • pnpm lint — pass
  • pnpm knip — pass
  • pnpm build — 52/52 tasks
  • pnpm test run — 211 files, 1283 tests, all pass
Open in Web Open in Cursor 

…stall graph

The pinned sanity@next prerelease still declares @tanstack/react-table (v8)
as a dependency, but nothing imports it: its only consumer (the sheet list)
was removed in sanity-io/sanity#12477 and the dependency itself in
sanity-io/sanity#14121. A scoped pnpm removal override
('sanity>@tanstack/react-table': '-') drops the unused, React
Compiler-incompatible v8 package from this workspace until a next
prerelease ships without it.
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1c8b8d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview Aug 18, 2026 2:54pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plugins-e2e-test-studio Ignored Ignored Aug 18, 2026 2:54pm

Request Review

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

❌ E2E Tests

🟢 22 passed🔴 4 failedview full reportview run

🤖 Share with an AI agent:

Fix the failing e2e tests. The failure report with error messages and page snapshots is at https://plugins-e2e-test-studio-g9gxbfa4c.sanity.dev/agent-report.md

Studio: https://plugins-e2e-test-studio-8otf1rasl.sanity.dev

Datasets: pr-1917-chromium-32151194439, pr-1917-firefox-32151194439

Debug failing tests locally
SANITY_E2E_PROJECT_ID=a1psl692 \
SANITY_E2E_BASE_URL=https://plugins-e2e-test-studio-8otf1rasl.sanity.dev \
SANITY_E2E_DATASET_CHROMIUM=pr-1917-chromium-32151194439 \
SANITY_E2E_DATASET_FIREFOX=pr-1917-firefox-32151194439 \
pnpm test:e2e --headed \
  tests/document-internationalization/document-internationalization.spec.ts

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 32.01% 5511 / 17213
🔵 Statements 31.78% 5815 / 18294
🔵 Functions 27.79% 1428 / 5137
🔵 Branches 23.35% 2831 / 12123
File CoverageNo changed files found.
Generated in workflow #9228 for commit 1c8b8d4 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants