[chore] Modernize tsconfig + add native TS7 type-check#5472
Draft
ardaerzin wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Two production-ready changes plus an opt-in fast type-checker, stacked on the tsc-cleanup work. Both apps stay at 0 errors throughout. 1. tsconfig modernization (real change, toolchain-neutral). Switched oss/ee to the relative-paths, no-baseUrl form. This is the modern standard: classic TS 5.9 accepts it, and it is also what TS7 REQUIRES (it removed baseUrl -- TS5102 -- and disallows non-relative path values -- TS5090). 2. CSS side-effect import typing (real change, additive). Added css-modules.d.ts per app, mirroring packages/css-modules.d.ts, so asset imports are typed. TS7 needs this (TS2882); classic tolerated untyped CSS under moduleResolution:bundler. 3. Opt-in native type-check. Adds @typescript/native-preview (the isolated tsgo binary -- does NOT replace typescript@5.9, so typescript-eslint and next build are untouched) and a type-check:native script. Usable today for a faster local loop: OSS check-to-zero 18.1s (classic) -> 3.7s (native), ~4.9x. Also adds a plain type-check (classic) script; there wasn't one. Verified all four gates green with these changes: native tsgo: oss 0, ee 0 classic tsc: oss 0, ee 0 next build oss: exit 0 (Next resolver handles no-baseUrl) lint oss (typescript-eslint): exit 0 Deferred (not in this PR): making native the ENFORCED gate (CI/pre-commit/next build). The hard blocker is typescript-eslint: TS7.0 shipped without a stable compiler API (7.1 will add one), and npm refuses to install typescript-eslint alongside typescript@7 at all (ERESOLVE) -- so flipping the lint job to native is not yet possible. Whether next build's internal type-check is also blocked is unverified: it depends on whether Next consumes the programmatic API or shells out to the tsc binary. This PR does not touch either gate; it makes the later flip a small change and measures the win now.
ardaerzin
force-pushed
the
ts-chore/native-tsc-trial
branch
2 times, most recently
from
July 23, 2026 19:41
9c0b856 to
6e344f2
Compare
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.
Context
TypeScript 7 (the Go-native compiler) went GA on 2026-07-08, ~8-12x faster on large codebases with unchanged type semantics. This PR modernizes the tsconfig so the native compiler runs cleanly, types the CSS side-effect imports it (correctly) requires, and adds an opt-in native type-check script. Both apps stay at 0 errors throughout.
Two of the three parts are production-ready changes that stand on their own; the third is an opt-in dev tool. None of it touches the enforced toolchain.
Changes
1. tsconfig modernization (
oss/tsconfig.json,ee/tsconfig.json). Switched to the relative-paths, no-baseUrlform:This is the modern standard form. Classic TS 5.9 accepts it (paths resolve relative to the tsconfig dir when there's no
baseUrl), and it is also what TS7 requires — 7.0 removedbaseUrl(TS5102) and rejects non-relative path values (TS5090). So one change satisfies both compilers.2. CSS side-effect import typing (
oss/css-modules.d.ts,ee/css-modules.d.ts). Added ambient*.cssdeclarations per app, mirroring the existingpackages/css-modules.d.ts. TS7 requires a declaration forimport "x.css"(TS2882); classic tolerated it undermoduleResolution: bundler. Additive and harmless to classic.3. Opt-in native type-check. Added
@typescript/native-preview(pinned) — the isolatedtsgobinary. It does NOT replace thetypescript@5.9package, so typescript-eslint andnext buildresolve the classic compiler exactly as before. New scripts:type-check:native(tsgo) andtype-check(classic — there wasn't a standalone one; type-checking only ran vianext build).The measurement
OSS, full check to zero errors: 18.1s classic → 3.7s native (~4.9x). EE native 4.3s. Less than Microsoft's headline 12x, which is on very large codebases; this is a mid-size app.
Verification (all green)
tsgotscnext buildThe
next buildand lint passes are the important ones: they prove removingbaseUrldoes not disturb Next's own module resolver or typescript-eslint's parser, both of which read this tsconfig.Deferred (not in this PR)
Making native the enforced gate — CI, pre-commit, and
next build's internal type-check.The hard blocker is typescript-eslint: TS7.0 shipped without a stable programmatic API (7.1 will add a new one), and npm refuses to install typescript-eslint alongside
typescript@7at all (ERESOLVE — its peer range caps below 6.1.0). So the lint job cannot move to native until 7.1. Microsoft's bridge for this transition is@typescript/typescript6(atsc6binary re-exporting the 6.0 API) — see Announcing TypeScript 7.0 and typescript-eslint#12518.Whether
next build's internal type-check is also blocked is unverified — it depends on whether Next consumes the programmatic API or shells out to thetscbinary, which I did not confirm. Either way, typescript-eslint alone is sufficient reason to keep native off the enforced gate for now. This PR makes the later flip a small change; it does not attempt it.One preview caveat: the isolated
tsgobinary is currently only distributed via the nightly@typescript/native-previewchannel (post-GA, the stable native compiler ships astypescript@7, whosetscbin would collide withtypescript@5.9). It's pinned to an exact version, and it sits outside every build path, so the blast radius is a local script.Tests / notes
What to QA
Nothing user-facing. For a reviewer:
cd web && pnpm type-check(classic, 0 errors) andpnpm type-check:native(tsgo, 0 errors) both pass;pnpm build-ossstill succeeds.