[PR #139] [MERGED] perf: optimize TypeScript server performance #139

Closed
opened 2026-10-27 21:09:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/Comfy-PR/pull/139
Author: @snomiao
Created: 1/9/2026
Status: ✅ Merged
Merged: 1/11/2026
Merged by: @snomiao

Base: main ← Head: sno-ts-speed


📝 Commits (3)

  • 3cec341 perf: optimize TypeScript server performance
  • d68e862 docs: document TypeScript performance optimization
  • b0d9ac1 fix: fix formatting issues in configuration files

📊 Changes

91 files changed (+3794 additions, -3480 deletions)

View changed files

📝 .eslintrc.json (+1 -1)
📝 .prettierrc (+2 -5)
📝 .vscode/mcp.json (+5 -5)
📝 CLAUDE.md (+27 -2)
📝 app/(dashboard)/details/page.tsx (+6 -1)
📝 app/(dashboard)/rules/layout.tsx (+1 -1)
📝 app/(dashboard)/totals-chart/page.tsx (+1 -1)
📝 app/api/(dump)/router.ts (+7 -3)
📝 app/api/[...openapi]/route.ts (+2 -2)
📝 app/api/auth/[...nextauth]/getAuthUser.tsx (+5 -1)
📝 app/api/router.test.ts (+1 -5)
📝 app/api/router.ts (+18 -4)
📝 app/auth/login/page.tsx (+4 -10)
📝 app/globals.css (+1 -1)
📝 app/tasks/coreping/coreping.ts (+97 -88)
📝 app/tasks/gh-bounty/gh-bounty.ts (+9 -7)
📝 app/tasks/gh-design/GithubDesignTaskMetaEditor.tsx (+24 -39)
📝 app/tasks/gh-design/page.tsx (+33 -36)
📝 app/tasks/gh-design/slackMessageUrlParse.ts (+2 -3)
📝 app/tasks/gh-design/zGithubDesignTaskMeta.tsx (+18 -21)

...and 71 more files

📄 Description

Summary

Fixes major TypeScript server performance issues that were causing slowdowns and breaking the TS server.

Root Causes Identified

  1. Overly broad include pattern (**/*.ts) - forced TypeScript to recursively scan all directories including 15,355+ .d.ts files in node_modules
  2. Expensive recursive type computation - DeepAsyncWrapper<T> type was recursively processing the entire Octokit API surface (122K+ lines of types)
  3. Test files included in compilation - unnecessary type checking of test files during development

Changes Made

  • ✅ Replace **/*.ts with explicit directory patterns (app/**/*.ts, src/**/*.ts, etc.)
  • ✅ Remove DeepAsyncWrapper recursive type - runtime proxy already handles async wrapping
  • ✅ Exclude test files (**/*.spec.ts, **/*.test.ts) from TypeScript compilation
  • ✅ Add more specific node_modules exclusions

Performance Improvements

  • Reduced type checking scope: Only scans actual source directories instead of entire project tree
  • Eliminated expensive type computation: No more recursive type inference on 122K line Octokit types
  • Better incremental compilation: More targeted includes enable effective caching
  • Faster IDE responsiveness: TypeScript server no longer overwhelmed by unnecessary file scanning

Testing

  • ✅ TypeScript compilation passes (tsc --noEmit)
  • ✅ All git hooks pass (eslint, prettier)
  • ✅ No breaking changes to runtime behavior

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/Comfy-PR/pull/139 **Author:** [@snomiao](https://github.com/snomiao) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 1/11/2026 **Merged by:** [@snomiao](https://github.com/snomiao) **Base:** `main` ← **Head:** `sno-ts-speed` --- ### 📝 Commits (3) - [`3cec341`](https://github.com/Comfy-Org/Comfy-PR/commit/3cec341b091af218444a3b93d8fedacbf34a3828) perf: optimize TypeScript server performance - [`d68e862`](https://github.com/Comfy-Org/Comfy-PR/commit/d68e86255f281bfff44a34601beebc8d40fb357a) docs: document TypeScript performance optimization - [`b0d9ac1`](https://github.com/Comfy-Org/Comfy-PR/commit/b0d9ac17deb143b35623ba4bce4f58277aa8b408) fix: fix formatting issues in configuration files ### 📊 Changes **91 files changed** (+3794 additions, -3480 deletions) <details> <summary>View changed files</summary> 📝 `.eslintrc.json` (+1 -1) 📝 `.prettierrc` (+2 -5) 📝 `.vscode/mcp.json` (+5 -5) 📝 `CLAUDE.md` (+27 -2) 📝 `app/(dashboard)/details/page.tsx` (+6 -1) 📝 `app/(dashboard)/rules/layout.tsx` (+1 -1) 📝 `app/(dashboard)/totals-chart/page.tsx` (+1 -1) 📝 `app/api/(dump)/router.ts` (+7 -3) 📝 `app/api/[...openapi]/route.ts` (+2 -2) 📝 `app/api/auth/[...nextauth]/getAuthUser.tsx` (+5 -1) 📝 `app/api/router.test.ts` (+1 -5) 📝 `app/api/router.ts` (+18 -4) 📝 `app/auth/login/page.tsx` (+4 -10) 📝 `app/globals.css` (+1 -1) 📝 `app/tasks/coreping/coreping.ts` (+97 -88) 📝 `app/tasks/gh-bounty/gh-bounty.ts` (+9 -7) 📝 `app/tasks/gh-design/GithubDesignTaskMetaEditor.tsx` (+24 -39) 📝 `app/tasks/gh-design/page.tsx` (+33 -36) 📝 `app/tasks/gh-design/slackMessageUrlParse.ts` (+2 -3) 📝 `app/tasks/gh-design/zGithubDesignTaskMeta.tsx` (+18 -21) _...and 71 more files_ </details> ### 📄 Description ## Summary Fixes major TypeScript server performance issues that were causing slowdowns and breaking the TS server. ### Root Causes Identified 1. **Overly broad include pattern** (`**/*.ts`) - forced TypeScript to recursively scan all directories including 15,355+ .d.ts files in node_modules 2. **Expensive recursive type computation** - `DeepAsyncWrapper<T>` type was recursively processing the entire Octokit API surface (122K+ lines of types) 3. **Test files included in compilation** - unnecessary type checking of test files during development ### Changes Made - ✅ Replace `**/*.ts` with explicit directory patterns (`app/**/*.ts`, `src/**/*.ts`, etc.) - ✅ Remove `DeepAsyncWrapper` recursive type - runtime proxy already handles async wrapping - ✅ Exclude test files (`**/*.spec.ts`, `**/*.test.ts`) from TypeScript compilation - ✅ Add more specific node_modules exclusions ### Performance Improvements - **Reduced type checking scope**: Only scans actual source directories instead of entire project tree - **Eliminated expensive type computation**: No more recursive type inference on 122K line Octokit types - **Better incremental compilation**: More targeted includes enable effective caching - **Faster IDE responsiveness**: TypeScript server no longer overwhelmed by unnecessary file scanning ### Testing - ✅ TypeScript compilation passes (`tsc --noEmit`) - ✅ All git hooks pass (eslint, prettier) - ✅ No breaking changes to runtime behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 21:09:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/Comfy-PR#139
No description provided.