Skip to content

test(build): check published declarations with skipLibCheck off - #9032

Draft
schiller-manuel wants to merge 3 commits into
refactor/remove-preload-intent-proximityfrom
test/published-declaration-check
Draft

schiller-manuel wants to merge 3 commits into
refactor/remove-preload-intent-proximityfrom
test/published-declaration-check

Conversation

@schiller-manuel

Copy link
Copy Markdown
Collaborator

🎯 Changes

Stacked on #9031.

With skipLibCheck: true, a broken reference in a published .d.ts silently becomes any (the #8203 shape). Neither publint nor attw reports it. This adds a check that does.

  • scripts/check-published-types.mjs compiles a package's published declarations the way a user's project sees them: skipLibCheck: false, no paths, dependencies through node_modules, one program per dist tree (esm, cjs, source), every declaration file a root. It reports diagnostics in the package's own files only, plus any relative specifier that leaves dist.
  • It runs at the end of test:build in all 41 packages (about 0.3 to 1.1 s each).
  • Tests for the script with tiny generated fixtures, run as the root project's test:unit.

Defects it found in declarations published today, fixed here:

  • @tanstack/router-plugin and @tanstack/start-plugin-core refer to types from @tanstack/virtual-file-routes without depending on it, so virtualRouteConfig was any. Both now list the dependency.
  • @tanstack/react-start-rsc/rsbuild/browser-decode re-exported from react-server-dom-rspack/client.browser, which ships no types, so both exports were any. They are now typed constants; same function objects at runtime.

Defects that need TanStack/config#443 and stay red until a @tanstack/vite-config release with that fix is installed:

  • router-plugin: import { HmrStyle } from '../hmr.js' where hmr is a directory (10 files).
  • react-router, solid-router: dist/cjs/index.dev.d.cts re-exports from ./HeadContent.dev, which does not resolve.

Draft until then. With #443 applied locally, test:build passes for all packages (82 of 82 tasks).

Written with AI assistance (Claude Code).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

🤖 Generated with Claude Code

schiller-manuel and others added 3 commits November 30, 2026 01:33
…le-routes

The published declarations of both packages refer to
`@tanstack/virtual-file-routes` types through the router generator's
config. Neither package listed it, so the import resolved to nothing and
`virtualRouteConfig` was typed as `any` (in start-plugin-core's
declarations it was emitted as `any` outright).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`scripts/check-published-types.mjs` compiles each package's published
declarations the way a user's project sees them and runs at the end of
every package's `test:build`, after publint and attw. With
`skipLibCheck: true` a broken reference in a published `.d.ts` silently
becomes `any`; this makes such defects fail CI.

- One TypeScript program per declaration tree under `dist` (esm, cjs,
  source, ...), every declaration file a root.
- `skipLibCheck: false`, strict, Bundler resolution, Node types, the
  package's JSX settings and nothing else from its tsconfig, so `paths`
  never apply. Dependencies resolve through node_modules to their dist.
- Only diagnostics located in the package under test count.
- Fails on relative specifiers that leave the package's dist and on any
  specifier containing `dist-ts`.
- A named per-package list of specifiers that cannot resolve by design
  (react-start-rsc's virtual modules); an unused entry fails.

The script's tests run as the root project's `test:unit` target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`rsbuild/browser-decode` re-exported `createFromReadableStream` and
`createFromFetch` from `react-server-dom-rspack/client.browser`, which
ships no declarations. The ambient declarations in `src` are not
published, so the exports were `any` for users and the published
declaration failed with TS7016 under `skipLibCheck: false`.

Export the same functions through annotated constants, so the published
declaration carries the signatures and no import of the untyped module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fa61d01

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tanstack/react-start-rsc Patch
@tanstack/router-plugin Patch
@tanstack/start-plugin-core Patch
@tanstack/react-start Patch
@tanstack/router-vite-plugin Patch
@tanstack/solid-start Patch
@tanstack/vue-start Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@nx-cloud

nx-cloud Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit fa61d01

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 9m 6s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 33s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-30 00:51:32 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

11 package(s) bumped directly, 17 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-router 1.170.46 → 1.170.47 Changeset
@tanstack/react-router-devtools 1.167.4 → 1.167.5 Changeset
@tanstack/react-start-rsc 0.1.69 → 0.1.70 Changeset
@tanstack/router-core 1.171.39 → 1.171.40 Changeset
@tanstack/router-devtools-core 1.168.4 → 1.168.5 Changeset
@tanstack/router-plugin 1.170.0 → 1.170.1 Changeset
@tanstack/solid-router 1.170.43 → 1.170.44 Changeset
@tanstack/solid-router-devtools 1.167.4 → 1.167.5 Changeset
@tanstack/start-plugin-core 1.173.0 → 1.173.1 Changeset
@tanstack/vue-router 1.170.42 → 1.170.43 Changeset
@tanstack/vue-router-devtools 1.167.4 → 1.167.5 Changeset
@tanstack/react-start 1.170.0 → 1.170.1 Dependent
@tanstack/react-start-client 1.168.45 → 1.168.46 Dependent
@tanstack/react-start-server 1.167.52 → 1.167.53 Dependent
@tanstack/router-cli 1.168.1 → 1.168.2 Dependent
@tanstack/router-devtools 1.167.4 → 1.167.5 Dependent
@tanstack/router-generator 1.169.0 → 1.169.1 Dependent
@tanstack/router-vite-plugin 1.167.50 → 1.167.51 Dependent
@tanstack/solid-start 1.170.0 → 1.170.1 Dependent
@tanstack/solid-start-client 1.168.42 → 1.168.43 Dependent
@tanstack/solid-start-server 1.167.50 → 1.167.51 Dependent
@tanstack/start-client-core 1.170.39 → 1.170.40 Dependent
@tanstack/start-server-core 1.169.45 → 1.169.46 Dependent
@tanstack/start-static-server-functions 1.167.44 → 1.167.45 Dependent
@tanstack/start-storage-context 1.167.41 → 1.167.42 Dependent
@tanstack/vue-start 1.170.0 → 1.170.1 Dependent
@tanstack/vue-start-client 1.167.45 → 1.167.46 Dependent
@tanstack/vue-start-server 1.167.50 → 1.167.51 Dependent

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 2837b331a9b8
  • Measured at: 2026-11-30T00:42:54.877Z
  • Baseline source: history:a47dc36d0310
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Initial (gzip) Raw Brotli Trend
react-router.minimal 84.0 KiB
-15 B
83.9 KiB
-14 B
261.5 KiB
-25 B
73.3 KiB
-39 B
▁▆▆▆▆▆▆▆▆██▄
react-router.full 87.6 KiB
-16 B
87.5 KiB
-14 B
273.4 KiB
-25 B
76.4 KiB
-42 B
▁▆▆▆▆▆▆▆▆██▅
solid-router.minimal 33.4 KiB
-13 B
33.2 KiB
-12 B
95.3 KiB
-25 B
30.2 KiB
-43 B
▁██████████▆
solid-router.full 38.3 KiB
-14 B
38.1 KiB
-14 B
110.1 KiB
-25 B
34.6 KiB
+2 B
▁██████████▃
vue-router.minimal 49.5 KiB
-12 B
49.3 KiB
-11 B
136.5 KiB
-50 B
44.8 KiB
-8 B
▁██████████▆
vue-router.full 55.0 KiB
-15 B
54.9 KiB
-15 B
154.6 KiB
-50 B
49.7 KiB
-9 B
▁██████████▆
react-start.minimal 96.8 KiB
-10 B
96.7 KiB
-11 B
302.4 KiB
-25 B
84.1 KiB
-18 B
▁▅▅▅▅▅▅▅▅██▄
react-start.query-integration 104.2 KiB
-14 B
104.1 KiB
-12 B
329.0 KiB
-25 B
90.6 KiB
+53 B
▁▅▅▅▅▅▅▅▅██▄
react-start.deferred-hydration 97.5 KiB
-12 B
96.7 KiB
-11 B
303.8 KiB
-25 B
84.7 KiB
-130 B
▁▆▆▆▆▆▆▆▆██▆
react-start.full 99.9 KiB
-14 B
99.7 KiB
-14 B
311.7 KiB
-25 B
86.7 KiB
-27 B
▁▅▅▅▅▅▅▅▅██▄
react-start.rsbuild.minimal 96.7 KiB
-13 B
96.5 KiB
-13 B
298.3 KiB
-25 B
83.5 KiB
-26 B
▇█████████▅▁
react-start.rsbuild.minimal-iife 97.1 KiB
-14 B
96.9 KiB
-14 B
299.2 KiB
-25 B
83.7 KiB
-103 B
▆█████████▅▁
react-start.rsbuild.full 99.9 KiB
-13 B
99.8 KiB
-13 B
307.9 KiB
-25 B
86.2 KiB
+57 B
▇█████████▄▁
solid-start.minimal 46.2 KiB
-11 B
46.1 KiB
-12 B
135.1 KiB
-25 B
41.1 KiB
-106 B
▁██████████▇
solid-start.deferred-hydration 49.2 KiB
-10 B
46.1 KiB
-12 B
142.4 KiB
-25 B
43.9 KiB
-35 B
▁██████████▇
solid-start.full 51.2 KiB
-19 B
51.1 KiB
-16 B
150.1 KiB
-25 B
45.4 KiB
-20 B
▁██████████▆
vue-start.minimal 65.4 KiB
-14 B
65.3 KiB
-13 B
185.7 KiB
-50 B
58.3 KiB
-36 B
▁██████████▆
vue-start.full 69.2 KiB
-17 B
69.0 KiB
-16 B
197.5 KiB
-50 B
61.6 KiB
-101 B
▁██████████▆

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Nov 30, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@9032

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@9032

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@9032

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@9032

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@9032

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@9032

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@9032

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@9032

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@9032

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@9032

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@9032

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@9032

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@9032

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@9032

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@9032

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@9032

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@9032

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@9032

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@9032

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@9032

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@9032

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@9032

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@9032

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@9032

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@9032

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@9032

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@9032

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@9032

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@9032

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@9032

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@9032

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@9032

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@9032

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@9032

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@9032

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@9032

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@9032

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@9032

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@9032

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@9032

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@9032

commit: fa61d01

@codspeed

codspeed Bot commented Nov 30, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

Warning

TanStack has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 13, 2026 to keep using CodSpeed.

2 warnings

⚠️ 46 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 198 untouched benchmarks
⏩ 3 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory mem server error-paths error (vue) 130.4 KB 136.2 KB -4.21%
⚡ Memory mem client navigation-churn (solid) 140.6 KB 133 KB +5.67%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing test/published-declaration-check (fa61d01) with refactor/remove-preload-intent-proximity (a5b2b34)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

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