feat: migrate to TypeScript 7#585
Open
adriangohjw wants to merge 11 commits into
Open
Conversation
- 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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.
Collaborator
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
Contributor
Author
@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>
6 tasks
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>
TypeScript 7 has now shipped a stable release, so we no longer need the RC pin.
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 |
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.
Problem
Monorepo typechecking used
tscfrom the classictypescriptpackage. We want to adopt the new native Go-based compiler now available as the official TypeScript 7 for fasterpnpm typecheck/ CI runs.Solution
pnpm-workspace.yamlcatalog: removed@typescript/native-preview, bumpedtypescriptto^7.0.2.typecheckscripts fromtsgo --noEmitback totsc --noEmit— TypeScript 7 ships the same native Go compiler under the standardtscCLI.@typescript/native-previewdevDependency from all packages.typescript.tsdkin.vscode/settings.jsontonode_modules/typescript/lib(the package now lives there).apps/web: ambient*.css/*.module.cssdeclarations so side-effect CSS imports typecheck cleanly.tooling/tailwind:tsconfigoverrides (types: ["node"],module/moduleResolution: NodeNext) so shared config JS typechecks correctly.Improvements:
Before & After Screenshots
Tests
pnpm installpnpm lintpnpm formatpnpm typecheckpnpm buildDeploy Notes
New dependencies:
Updated dev dependencies:
typescriptbumped from^5.9.3to^7.0.2(official stable release, sametscCLI).Removed dev dependencies:
@typescript/native-preview— superseded by the official TypeScript 7 package.