Skip to content

build: upgrade to TypeScript 7 - #827

Open
zhyd1997 wants to merge 1 commit into
nextfrom
codex/typescript-7-upgrade-1785359282
Open

build: upgrade to TypeScript 7#827
zhyd1997 wants to merge 1 commit into
nextfrom
codex/typescript-7-upgrade-1785359282

Conversation

@zhyd1997

@zhyd1997 zhyd1997 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • use the native TypeScript 7.0.2 compiler for repository typechecking
  • retain the official TypeScript 6 compatibility package for tools that still import the JavaScript API, including ESLint, Storybook, Vite declaration tooling, and tsup
  • enable Next.js's TypeScript CLI integration so the web production build runs TS7 directly
  • remove TS7-incompatible baseUrl settings and add explicit Node ambient types where the new defaults require them
  • scope a workaround for tsup#1388 to the eg-walker declaration build
  • update Renovate grouping and the pnpm lockfile

This follows the TypeScript 7 migration guidance while the stable programmatic API is still transitioning.

Closes #825.

Performance

Measured on an Apple M1 MacBook Pro with 16 GB RAM and Node 24.12.0. The web comparison used seven warmed, alternating direct runs of:

tsc -p apps/web/tsconfig.json --noEmit --pretty false
Compiler Median wall time Peak RSS Relative
TypeScript 5.9.3 3.33 s 504,437 KB 1.00x
TypeScript 7.0.2 0.53 s 322,384 KB 6.28x faster

--extendedDiagnostics compiler time improved from 2.57 s to 0.45 s (5.71x), while peak memory fell by 36.1%.

Across five representative workspace configurations, the co-installed TS6 API bridge took 11.54 s in aggregate versus 2.23 s for native TS7, a 5.17x speedup.

Validation

  • pnpm install --offline --frozen-lockfile
  • pnpm build — 7/7 production build tasks passed
  • native TS7 typechecks for web, playground, awareness, bench, config, editor, eg-walker, md2latex, and UI
  • Vitest/Node test suites for web, playground, awareness, editor, bench, md2latex, and ESLint config
  • pnpm --filter @softmaple/web lint
  • pnpm --filter @softmaple/eg-walker lint
  • pre-commit Biome and lint-staged hooks
  • git diff --check

Existing unrelated failures

  • Repository-wide pnpm lint still reports existing Biome errors in unchanged playground source files; targeted checks for this change pass.
  • The existing eg-walker deferred-text-materialization property test reproducibly exposes a runtime algorithm defect after hundreds of generated traces. No eg-walker runtime or test source changed here; the other 710 tests pass, including the convergence property when rerun in isolation.

Screenshots are not applicable because this change has no UI impact.

Summary by CodeRabbit

  • Chores
    • Updated the project’s TypeScript tooling to support newer TypeScript releases.
    • Enabled the web app’s TypeScript command-line integration.
    • Removed obsolete module-resolution settings while preserving existing path aliases.
    • Added explicit Node.js type definitions where required.
    • Updated declaration generation compatibility for newer TypeScript behavior.
    • Improved automated grouping of TypeScript-related updates.

Co-authored-by: Codex <noreply@openai.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 700426ee-2e15-4145-b1f4-65ec952a2f74

📥 Commits

Reviewing files that changed from the base of the PR and between ff39536 and 1560e0a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • .github/renovate.json
  • apps/playground/package.json
  • apps/playground/tsconfig.json
  • apps/web/next.config.mjs
  • apps/web/package.json
  • apps/web/tsconfig.json
  • package.json
  • packages/awareness/package.json
  • packages/bench/package.json
  • packages/bench/tsconfig.json
  • packages/config/package.json
  • packages/config/tsconfig.json
  • packages/editor/package.json
  • packages/editor/tsconfig.app.json
  • packages/editor/tsconfig.json
  • packages/eg-walker/package.json
  • packages/eg-walker/tsconfig.json
  • packages/eg-walker/tsup.config.ts
  • packages/eslint-config/package.json
  • packages/md2latex/package.json
  • packages/ui/package.json
  • packages/ui/tsconfig.json
💤 Files with no reviewable changes (6)
  • apps/web/tsconfig.json
  • packages/editor/tsconfig.app.json
  • packages/ui/tsconfig.json
  • packages/editor/tsconfig.json
  • packages/config/tsconfig.json
  • apps/playground/tsconfig.json

📝 Walkthrough

Walkthrough

The repository updates its TypeScript development toolchain to TypeScript 6 and native TypeScript 7, removes baseUrl compiler settings, adds explicit Node typings where needed, and adjusts Next.js and tsup integrations.

Changes

TypeScript toolchain upgrade

Layer / File(s) Summary
TypeScript dependency rollout
.github/renovate.json, package.json, apps/*/package.json, packages/*/package.json
TypeScript 6 aliases and native TypeScript 7 dependencies are added across the repository, and Renovate grouping includes @typescript/typescript6.
Compiler configuration updates
apps/*/tsconfig.json, packages/*/tsconfig*.json
baseUrl is removed while existing path mappings remain; benchmark and eg-walker configurations explicitly include Node typings.
Build and DTS integrations
apps/web/next.config.mjs, packages/eg-walker/tsup.config.ts
Next.js enables useTypeScriptCli, and tsup declaration generation receives an ignoreDeprecations compiler option.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: upgrading the build to TypeScript 7.
Description check ✅ Passed The description covers the upgrade, compatibility strategy, performance results, validation, and linked issue closure, even if it doesn't follow the exact template.
Linked Issues check ✅ Passed The changes implement the TypeScript 7 upgrade requested by #825 and the description includes the required performance comparison.
Out of Scope Changes check ✅ Passed The modified files all support the TypeScript 7 migration or its tooling support, with no clear unrelated changes shown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/typescript-7-upgrade-1785359282

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​typescript/​typescript6@​6.0.2621005592100
Updatedtypescript@​5.9.3 ⏵ 7.0.29910089 -1100100 +10

View full report

@chromatic-com

chromatic-com Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

UI Tests need review – Review now

🟡 UI Tests: softmaple_packages/awareness: 38 visual and accessibility changes must be accepted as baselines
🟢 UI Review: softmaple_packages/awareness: 38 stories published -- no changes
Storybook icon Storybook Publish: softmaple_packages/awareness: 38 stories published

@chromatic-com

chromatic-com Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Testing in progress…

🟢 UI Tests: softmaple-packages/editor: 8 tests unchanged
UI Review: softmaple-packages/editor: Comparing 8 stories…
Storybook icon Storybook Publish: softmaple-packages/editor: 8 stories published

@chromatic-com

chromatic-com Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: softmaple-packages/editor: 8 tests unchanged
🟢 UI Review: softmaple-packages/editor: 8 stories published -- no changes
Storybook icon Storybook Publish: softmaple-packages/editor: 8 stories published

@github-actions

Copy link
Copy Markdown

Coverage Report for packages/awareness

Status Category Percentage Covered / Total
🟢 Lines 99.18% (🎯 90%) 1697 / 1711
🟢 Statements 97.61% (🎯 90%) 1798 / 1842
🟢 Functions 99.45% (🎯 90%) 367 / 369
🟢 Branches 92.13% (🎯 90%) 879 / 954
File CoverageNo changed files found.
Generated in workflow #807 for commit 1560e0a by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown

Coverage Report for packages/eg-walker

Status Category Percentage Covered / Total
🟢 Lines 94.07% (🎯 93%) 8947 / 9511
🟢 Statements 94.09% (🎯 93%) 9184 / 9760
🟢 Functions 98.46% (🎯 97%) 1222 / 1241
🟢 Branches 86.01% (🎯 82%) 4618 / 5369
File CoverageNo changed files found.
Generated in workflow #1430 for commit 1560e0a by the Vitest Coverage Report Action

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.

Upgrade to TypeScript v7

1 participant