Skip to content

build: type-check docs with tsrs and keep a tsc fallback - #75

Merged
joeblau merged 1 commit into
mainfrom
build/tsrs-docs
Oct 21, 2026
Merged

joeblau merged 1 commit into
mainfrom
build/tsrs-docs

Conversation

@joeblau

@joeblau joeblau commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #74. This finishes the tsrs migration to match the org-wide plan used in sfx#75.

  • Docs app: check is now next typegen && tsrs --noEmit, and it runs in prebuild before next build. next.config.mjs sets typescript.ignoreBuildErrors: true, so Next skips its slower tsc pass ("Skipping validation of types" in the build log). tsrs is pinned to exactly 0.18.0-ts7.1.0-dev.20260929.
  • tsc fallback: tsrs has no Windows or Intel Mac build, so typescript stays a devDependency in both the chart package and the docs app, and Next still needs it too. The new fallback scripts are typecheck:tsc (root), typecheck / typecheck:tsc / build:ts:tsc (chart) and check:tsc (docs).

Docs type check (box, 8 vCPU, 7 interleaved cold runs, .tsbuildinfo removed each run)

TS 6.0.3 TS 7.0.2 tsrs 0.18.0
Median 2.96 s 0.51 s 0.24 s
Peak memory ~495 MB ~260 MB ~108 MB

That's about 12x faster than tsc 6.

Gates

  • Same errors: tsc 6.0.3 and tsrs report identical diagnostics on the clean docs app (0 errors) and on a deliberately broken .tsx file with 5 errors: wrong assignment, a misspelled prop, a non-ReactNode child, a bad argument and a missing required prop.
  • Same output: build:ts (tsrs) and build:ts:tsc emit identical .js and .d.ts files. Only the .map mappings differ, which is the TS 6 to TS 7 source-map change covered in build: compile @bloxwap/chart with tsrs instead of tsc #74.
  • Everything passes: npm run typecheck, npm run typecheck:tsc, npm run docs:build (including check-export), npm run lint and npm run coverage, which stays at 100% on all 139 rows.

@joeblau
joeblau merged commit e034cc1 into main Oct 21, 2026
6 of 7 checks passed
@joeblau
joeblau deleted the build/tsrs-docs branch October 21, 2026 11: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.

1 participant