Client: Upgrade TypeScript to 6.0/7.0 dual-compiler setup to match VxSuite along with additional related cleanup - #2373
Open
nikhilb4a wants to merge 7 commits into
Open
Client: Upgrade TypeScript to 6.0/7.0 dual-compiler setup to match VxSuite along with additional related cleanup#2373nikhilb4a wants to merge 7 commits into
nikhilb4a wants to merge 7 commits into
Conversation
Install typescript 7.0.2 (native compiler) for the tsc binary and @typescript/typescript6 6.0.2 as the typescript package for tools that consume the JS API (typescript-eslint, tsserver, Cypress). - moduleResolution "node" was removed in TS 7; switch to "bundler" - resolvePackageJsonExports: false defers a react-hook-form v7 upgrade (v6's exports map hides its type declarations from bundler resolution) - vite-env.d.ts satisfies TS 7's new check that side-effect CSS imports resolve (TS2882) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nikhilb4a
force-pushed
the
client-typescript-7
branch
from
August 17, 2026 18:04
79b5b8f to
eb111c1
Compare
The declaration/emitDeclarationOnly/outDir setup wrote a dist/ tree of .d.ts files on every tsc run (CI and pre-commit) that nothing consumes: the app is bundled by Vite into build/, and no tooling reads client/dist. noEmit expresses the actual intent — tsc is a type-check gate only. rootDir must still be set explicitly (with a comment saying why): Cypress loads cypress.config.ts through ts-node, which forces an internal outDir, and TS 6 fails there with error TS5011 when rootDir is left inferred. This is also what broke the Cypress CI job after the TS 6/7 upgrade. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The typescript package is now the @typescript/typescript6 wrapper, which ships no lib/tsserver.js, so VS Code silently fell back to its bundled TypeScript. Point tsdk at @typescript/old (the real TS 6 compiler the wrapper re-exports), which does ship tsserver.js. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nikhilb4a
force-pushed
the
client-typescript-7
branch
from
August 17, 2026 22:27
d3a6197 to
2d51e74
Compare
make build silently no-ops when Vite's build/ output directory exists, because make treats the directory as the target being up to date. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Client lint previously ran only in the pre-commit hook (skippable, and absent for bot commits), and vite build ran for the first time at deploy — a change could pass CI and still fail the Heroku build. build-and-test-client now runs both, using the existing client Makefile targets. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vite/client (referenced by vite-env.d.ts) already declares every asset module the CRA shim declared. The shim's *.svg ReactComponent export was a trap: the CRA idiom type-checked but is undefined at runtime under Vite (no svgr plugin). Its NODE_ENV literal-union narrowing is the one piece worth keeping, so it moves to vite-env.d.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jspdf 4 and react-toastify 5 ship their own type declarations, which TypeScript prefers over @types packages, so these v1-era and v4-era stubs were never consulted — only available to drift from the real APIs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nikhilb4a
force-pushed
the
client-typescript-7
branch
from
August 17, 2026 23:22
dbf207d to
059247c
Compare
nikhilb4a
marked this pull request as ready for review
August 17, 2026 23:33
kshen0
approved these changes
Aug 21, 2026
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.
Closes #1471
Commits
tsc.tsctonoEmittype-checking, since we don't use the emitted files..PHONY.react-app-env.d.tstypes withvite-env.d.tssince we've moved to vite.@types/jspdfand@types/react-toastify, unused since those packages now ship their own types.Update Typescript 6.0/7.0 dual-compiler setup
Upgraded to match the same Typescript setup used on VxSuite. Dual-TS version setup is standard for apps using tools like
eslint,cypress, since TS7 doesn't have full API support required for those. That is expected to come in TS7.1 in late 2026/early 2027.Install typescript 7.0.2 (native compiler) for the tsc binary and @typescript/typescript6 6.0.2 as the typescript package for tools that consume the JS API (typescript-eslint, tsserver, Cypress).
Why
tscrun on the client drops from ~30s to under 2s(measured on this repo). That speed shows up everywhere
tscruns:test:cirunstscbefore vitestnew language features, lib updates, and bug fixes now ship in the 6.x/7.x lines. This keeps
us current without waiting until an upgrade is forced by a dependency.
(
typescript→@typescript/typescript6,@typescript/native→typescript@7), so bothVotingWorks codebases follow one convention: the fast native compiler on the
tscbinary,the behavior-matched JS compiler on the
typescriptpackage for API consumers.the TypeScript JS API through the
typescriptalias — lint output is byte-identical beforeand after (0 errors, 19 warnings), and the test suite is unaffected. The bigger
ESLint/typescript-eslint upgrade stays a separate, independent project.
TypeScript Native Preview
VS Code extension can run the editor language service on the native compiler too (optional;
the default tsserver keeps working via the TS 6 package).