build: upgrade to TypeScript 7#8167
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 90be1f51-4a09-4876-b773-8e5d9cf27399
|
|
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s TypeScript toolchain to run tsc using the TypeScript 7 native compiler while keeping TypeScript 6 available for compiler-API consumers via the @typescript/typescript6 compatibility package.
Changes:
- Added
@typescript/native(aliased totypescript@^7.0.2) sotsccan use the TS 7 native compiler. - Switched workspace
typescriptdevDependencies tonpm:@typescript/typescript6@^6.0.2for TS 6 compiler API compatibility. - Adjusted
ActionList.TrailingAction@ts-expect-errorplacement to match TS 7 diagnostic locations. - Removed the TS 6-only
stableTypeOrderingcompiler option.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.base.json | Removes stableTypeOrdering now that TS 7 is in use. |
| package.json | Adds @typescript/native and re-points typescript to the TS6 compatibility package. |
| package-lock.json | Locks new TS7 native compiler and TS6 compatibility dependencies. |
| packages/react/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/styled-react/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/rolldown-plugin-preserve-directives/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/rolldown-plugin-import-css/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/react-compiler-check/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/postcss-preset-primer/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/mcp/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/doc-gen/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/canvas/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| examples/theming/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| examples/nextjs/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| examples/codesandbox/package.json | Uses the TS6 compatibility package for tooling that depends on compiler APIs. |
| packages/react/src/ActionList/TrailingAction.tsx | Updates @ts-expect-error placement for TS 7 diagnostics. |
Review details
- Files reviewed: 15/16 changed files
- Comments generated: 0
- Review effort level: Low
…mpat - Update root package.json to restore @typescript/native alias (TypeScript 7 for tsc) while keeping `typescript: @typescript/typescript6` for eslint and rolldown-plugin-dts - Update all workspace packages except doc-gen to use typescript: "^7.0.2" - Keep packages/doc-gen on @typescript/typescript6 (runtime TypeScript compiler API) - Add @typescript/typescript6 devDep to styled-react and update its deprecated-exports test to import from @typescript/typescript6 (the test uses the TypeScript compiler API) - Update examples to use typescript: "^7.0.2" Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Done in commit All workspace packages (canvas, mcp, postcss-preset-primer, react, react-compiler-check, rolldown-plugin-import-css, rolldown-plugin-preserve-directives, examples) now use Two notes on the root and styled-react:
|
…omment Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
… compatibility Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Fixed in commit The CI failure was in
|
No linked issue.
This PR updates the repository to use the TypeScript 7 native compiler while keeping TypeScript 6 available for tools that still depend on the compiler API.
Changelog
New
@typescript/nativedevelopment dependency sotscuses the native compiler.Changed
@typescript/typescript6compatibility package for API-based tooling such as typescript-eslint.ActionList.TrailingActiontype suppressions for TypeScript 7's diagnostic locations.Removed
stableTypeOrderingcompiler option.Rollout strategy
Testing & Reviewing
tscresolves to TypeScript 7.0.2 andtsc6remains available through the compatibility package.Migration guidance: