perf: speed up root typecheck with native TypeScript 7
Use the stable native TypeScript 7.0.2 compiler for Hub's existing root lint typecheck. The median compiler check falls from 0.706165s to 0.134239s, 80.99% less time (5.26×), saving 0.571926s per invocation locally.
TypeScript 5.8.3 remains installed for @rollup/plugin-typescript and rollup-plugin-dts, which use its JavaScript compiler API. The lint script invokes the exact @typescript/native alias explicitly because both packages expose tsc. The root build configuration, application source, Biome commands, production dependencies and CI permissions are unchanged.
The check-only config uses moduleResolution: bundler because native TypeScript no longer supports the old Node resolver. Its explicit types list preserves all eleven baseline-visible ambient type packages. Both compilers cover the same 43 project files; every baseline @types declaration file remains included. Compiler library differences account for 397 versus 400 total files. An initial narrower ambient configuration was caught in independent review and corrected before the final benchmark.
Benchmark
Baseline commit: 4dc2d0fdd212e096802ec5f3a9eb1ff01e374705. Same final source/dependency tree on macOS arm64, Node 22.14.0 (the CI version), TypeScript 5.8.3 versus 7.0.2. Two unmeasured warmups per compiler, then seven alternating pairs; 18 subprocesses all exited zero. Each check is nonincremental, with warm filesystem caches. Package-manager startup and dependency installation are excluded. Other audit agents were idle during measurement; the host can still have unrelated background work. Load averages were [3.2900390625, 5.05810546875, 11.0859375] before and [3.85986328125, 5.12158203125, 11.03759765625] after.
TS5.8.3 seconds: 0.698405500, 0.708034000, 0.715826041, 0.715691625, 0.706164500, 0.698508209, 0.700781334
TS7.0.2 seconds: 0.138645875, 0.136970500, 0.130474375, 0.129188292, 0.131949875, 0.137109167, 0.134239000
Reproduce after npm ci on this branch with the same Node executable. Confirm the two versions, warm each command twice, then time seven alternating pairs and reject any failed process:
node node_modules/typescript/bin/tsc --noEmit --pretty false
node node_modules/@typescript/native/bin/tsc --noEmit -p tsconfig.typecheck.json --pretty false
The saving applies to this compiler check, not total CI time, emitted-build performance or browser runtime. Nested development packages are separate compiler jobs and are outside this root change.
Local validation
- Final
npm run lintpasses: both existing Biome checks cover 97 files and the native typecheck succeeds. The legacy compiler also passes on final source. - Baseline and candidate format-vector/canonical-source validation pass, and Vitest passes 26 tests in one file. These were invoked directly with Node (
node --import tsx scripts/check-format-vectors.tsand the Vitest CLI) to avoid the local tsx launcher IPC limitation. - Both baseline and candidate Rollup runs emit all five artifacts. Their JS, declaration and map bytes are identical, and
verify:buildpasses, including bundle version stamps. - Local build limitation: both the unmodified baseline and candidate leave filesystem watchers alive after Rollup finishes emitting. The bounded candidate run was interrupted after 40 seconds; this is not reported as a successful local build exit. The normal Linux CI build must pass before completion. The change retains the original Rollup/compiler API path.
- Local dependency installation used frozen disposable transport fixtures followed by reconstruction and integrity/edge validation of the exact npm graph, including root peer dependencies. Normal allowed esbuild/Biome lifecycle scripts ran. This is not a claim that a fresh local
npm cicompleted; hosted CI must validate the real npm lock/install.
Security and review
Independent security and whole-diff Forge reviews found no remaining issues. All 351 prior lock package records are unchanged. The only additions are the exact official TypeScript 7.0.2 alias and its 20 optional platform packages; publisher integrity, platform/engine metadata and absence of new lifecycle hooks were checked. Existing legacy API consumers still resolve TypeScript 5.8.3. No application, authentication, SSR, bundle side-effect, publishing or workflow permissions changed. This review does not certify inherited dependencies vulnerability-free.
Hosted validation and final review
The existing Linux CI build passed on head 469e76caf8b378bd84ee73f651aa14a8d1f86766, using Node22.14.0/npm10.9.2: normal npm ci, full Rollup build with successful process exit, bundle verification, both Biome checks plus native TypeScript, and all26 tests. This closes the normal install/build gate while leaving the inherited macOS watcher limitation above explicit. The npm audit reported12 inherited vulnerabilities (8high,4moderate); those package-path counts differ from default-branch Dependabot alerts below.
Cubic approved with no findings across all4files. There are no inline review comments. Aikido and PR-title checks passed. Automatic Copilot failed because review quota was exhausted and performed no review; it was not manually retried. Build/test CI is green, but this quota failure prevents saying every check is green.
GitHub Code scanning reports Needs setup; Secret scanning and Dependabot are Enabled. No scanner configuration or alert disposition was changed. Independent security review and final whole-diff Forge are complete, with no outstanding findings.
GitHub reported 84 existing default-branch Dependabot alerts at push time (2 critical, 50 high, 29 moderate, 3 low). The prior dependency records remain unchanged; these inherited alerts have not been remediated or suppressed here.
Summary by cubic
Switches the root lint typecheck to the native TypeScript 7.0.2 compiler via the @typescript/native alias, cutting median check time from 0.706s to 0.134s (~5.3× faster). TypeScript 5.8.3 stays installed for @rollup/plugin-typescript and rollup-plugin-dts, which rely on its JavaScript compiler API. The lint script now invokes the native binary explicitly since both packages expose tsc.
- Adds
tsconfig.typecheck.jsonusingmoduleResolution: bundler(native TypeScript dropped the oldNoderesolver) and an explicittypeslist preserving all eleven ambient type packages. - Documents the dual-compiler setup in
AGENTS.md; existing lock package records are unchanged, and the merge frommainintroduces no further changes.