Skip to content

feat: migrate to TypeScript 7#585

Open
adriangohjw wants to merge 11 commits into
mainfrom
feat/migrate-ts-typecheck-to-tsgo
Open

feat: migrate to TypeScript 7#585
adriangohjw wants to merge 11 commits into
mainfrom
feat/migrate-ts-typecheck-to-tsgo

Conversation

@adriangohjw

@adriangohjw adriangohjw commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Problem

Monorepo typechecking used tsc from the classic typescript package. We want to adopt the new native Go-based compiler now available as the official TypeScript 7 for faster pnpm typecheck / CI runs.

Solution

  • Updated pnpm-workspace.yaml catalog: removed @typescript/native-preview, bumped typescript to ^7.0.2.
  • Reverted all typecheck scripts from tsgo --noEmit back to tsc --noEmit — TypeScript 7 ships the same native Go compiler under the standard tsc CLI.
  • Removed @typescript/native-preview devDependency from all packages.
  • Restored typescript.tsdk in .vscode/settings.json to node_modules/typescript/lib (the package now lives there).
  • apps/web: ambient *.css / *.module.css declarations so side-effect CSS imports typecheck cleanly.
  • tooling/tailwind: tsconfig overrides (types: ["node"], module / moduleResolution: NodeNext) so shared config JS typechecks correctly.

Improvements:

  • Faster typecheck paths via TypeScript 7's native Go compiler (same 1.7x–2.3x headroom as before, now on the stable release).
  • Tracks the official release channel rather than a dev-preview package.

Before & After Screenshots

Before After (typecheck only) After (typecheck + build)
1x 1.7x faster 2.3x faster
Screenshot 2026-03-21 at 2 04 35 AM Screenshot 2026-03-21 at 2 05 38 AM Screenshot 2026-03-21 at 2 17 07 AM

Note: this PR ships the typecheck + build column (2.3x). The 1.7x typecheck-only column is only for reference

Tests

  • pnpm install
  • pnpm lint
  • pnpm format
  • pnpm typecheck
  • pnpm build

Deploy Notes

New dependencies:

  • None for app runtime.

Updated dev dependencies:

  • typescript bumped from ^5.9.3 to ^7.0.2 (official stable release, same tsc CLI).

Removed dev dependencies:

  • @typescript/native-preview — superseded by the official TypeScript 7 package.

- Introduced the @typescript/native-preview package with version 7.0.0-dev.20260320.1 across various configurations.
- Updated pnpm-lock.yaml and pnpm-workspace.yaml to include the new package.
- Modified .vscode/settings.json to use the new TypeScript SDK path.
- Updated package.json files in multiple apps and packages to replace `tsc` with `tsgo` for type checking.
- Added type declarations for CSS modules in a new file style-modules.d.ts.

This change enhances TypeScript support and streamlines type checking across the project.
- Added information about using `tsgo` from `@typescript/native-preview` for workspace typechecking.
- Clarified that packages emitting declarations to `dist/` continue to use `tsc` for build and development.
- Updated `.vscode/settings.json` reference for editor configuration.
@vercel

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
starter-kit Ready Ready Preview, Comment Mar 20, 2026 6:17pm

Request Review

…ple packages to use tsgo

- Replaced `tsc` with `tsgo` in package.json scripts for build and development in common, db, logging, redis, and validators packages.
- Updated tsconfig.json files to specify `rootDir` and adjusted `include` paths for better TypeScript project structure.
- Modified template files for package.json and tsconfig.json to reflect these changes for future package generation.
- Revised the TypeScript type checking section to specify the use of `tsgo` from `@typescript/native-preview`.
- Removed outdated information regarding `tsc` usage for type checking in the README.
- Enhanced clarity on the project structure and package generation process.
@adriangohjw adriangohjw self-assigned this Mar 20, 2026
@adriangohjw adriangohjw changed the title Feat/migrate TS typecheck to tsgo Feat/migrate ts to tsgo Mar 20, 2026
@karrui

karrui commented May 13, 2026

Copy link
Copy Markdown
Collaborator

while keeping the classic typescript package for ESLint (typescript-eslint) and editor tooling that still expects it.

if we move to oxlint, will that change this description?

…heck-to-tsgo

# Conflicts:
#	.vscode/settings.json
#	apps/web/package.json
#	packages/common/package.json
#	packages/common/tsconfig.json
#	packages/db/package.json
#	packages/logging/package.json
#	packages/logging/tsconfig.json
#	packages/redis/package.json
#	packages/redis/tsconfig.json
#	packages/ui/package.json
#	packages/validators/package.json
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
#	tooling/eslint/package.json
#	tooling/eslint/tsconfig.json
#	tooling/prettier/package.json
#	tooling/storybook/package.json
#	tooling/tailwind/package.json
#	turbo/generators/templates/package.json.hbs
@adriangohjw

Copy link
Copy Markdown
Contributor Author

while keeping the classic typescript package for ESLint (typescript-eslint) and editor tooling that still expects it.

if we move to oxlint, will that change this description?

@karrui yup, no longer relevant after that - have updated PR description

tsgo emit is not yet stable in @typescript/native-preview; keep tsc for
build/dev and reserve tsgo for --noEmit typecheck. Reverts the tsconfig
rootDir overrides that were only needed for tsgo's emit path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
adriangohjw and others added 2 commits June 30, 2026 11:42
Replace @typescript/native-preview (tsgo) with the official typescript@7.0.1-rc
package. TypeScript 7 RC ships the same native Go-based compiler under the
standard `tsc` CLI, so all typecheck scripts revert to `tsc --noEmit`.

Also resolves merge conflicts from origin/main (vitest minimumReleaseAge
exclusions, logging test scripts).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adriangohjw adriangohjw changed the title Feat/migrate ts to tsgo feat: migrate typecheck to TypeScript 7 RC Jun 30, 2026
TypeScript 7 has now shipped a stable release, so we no longer need the RC pin.
@adriangohjw adriangohjw changed the title feat: migrate typecheck to TypeScript 7 RC feat: migrate typecheck to TypeScript 7 Jul 9, 2026
@adriangohjw adriangohjw changed the title feat: migrate typecheck to TypeScript 7 feat: migrate to TypeScript 7 Jul 9, 2026
@adriangohjw

Copy link
Copy Markdown
Contributor Author

actually typescript 7 is not supported in next.js build's typecheck yet - but its skipped in this repo so its not an issue

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.

2 participants