chore: migrate type-check from tsc to tsgo across all workspaces#35488
Merged
chore: migrate type-check from tsc to tsgo across all workspaces#35488
Conversation
Switch every workspace's `type-check` script to `tsgo` (TypeScript 7.0 beta native compiler), removing the transitional `type-check:tsgo` alias. On the web workspace this takes type-check from ~54s to ~6s; running all five workspaces in parallel now finishes in ~7s total. - Replace `tsc` with `tsgo` in web / e2e / sdks / dify-ui / migrate package.json scripts, and in the migrate codemod's runtime subprocess invocation (all required flags --noEmit / --pretty / --incremental / --tsBuildInfoFile / --project are supported by tsgo) - Add `@typescript/native-preview` to each workspace that runs tsgo so the binary resolves without relying on hoisting - Pin `@typescript-eslint/eslint-plugin` to 8.59.0 to match the already bumped `parser` (both are released in lockstep) - Add explicit `include`/`exclude` to packages/dify-ui/tsconfig.json so tsgo does not scan the generated `storybook-static/` JS artifacts - Drop stale `pnpm type-check:tsgo` references in docs, agent skills, and refactor-component.js output The `typescript` package itself stays as devDep because typescript-eslint, tsslint, knip, next, vite-plus and the migrate codemod still import the TS 6 programmatic API at runtime (TS 7 stable API lands in 7.1). Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35488 +/- ##
==========================================
- Coverage 85.54% 85.54% -0.01%
==========================================
Files 4438 4438
Lines 207244 207244
Branches 38623 38623
==========================================
- Hits 177284 177283 -1
- Misses 26850 26851 +1
Partials 3110 3110
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Keep the scope of this PR limited to the tsc → tsgo migration by reverting unrelated dependency bumps that snuck in: security-override target bumps for brace-expansion / canvas / dompurify / rollup / solid-js / undici, and react-i18next 16.5.8 → 16.6.6. The vite-plus override entries are left as-is. Made-with: Cursor
hyoban
approved these changes
Apr 22, 2026
fatelei
pushed a commit
that referenced
this pull request
Apr 24, 2026
asukaminato0721
pushed a commit
to asukaminato0721/dify
that referenced
this pull request
Apr 24, 2026
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.
Summary
Switch every workspace's
type-checkscript fromtsctotsgo(the TypeScript 7.0 beta native compiler from@typescript/native-preview), and drop the transitionaltype-check:tsgoalias.On the
webworkspace alone,pnpm type-checkgoes from ~54s to ~6s. Running all five workspaces viapnpm type-check(i.e.vp run -r type-check) now finishes in ~7s total.What changed
tscwithtsgoinweb/e2e/sdks/nodejs-client/packages/dify-ui/packages/migrate-no-unchecked-indexed-accesspackage.jsonscriptspnpm exec tsc ...→pnpm exec tsgo ...) — all required flags (--noEmit,--pretty,--incremental,--tsBuildInfoFile,--project) are supported by tsgo@typescript/native-previewto every workspace that runstsgoso the binary resolves without relying on hoisting@typescript-eslint/eslint-pluginto8.59.0so it matches the already-bumped@typescript-eslint/parser@8.59.0(they are released in lockstep,eslint-plugin@8.59.0haspeerDependencies["@typescript-eslint/parser"]: ^8.59.0)include/excludetopackages/dify-ui/tsconfig.jsonso tsgo does not scan the generatedstorybook-static/JS artifacts (TS 7 is stricter about JSDoc/Closure-style JS than TS 6)pnpm type-check:tsgoreferences inAGENTS.md,.agents/skills/**,web/docs/lint.md,web/scripts/refactor-component.jsandpackages/dify-ui/README.mdThe
typescriptpackage itself stays as devDep: typescript-eslint, tsslint, knip, Next, vite-plus, and the migrate codemod all import the TS 6 programmatic API at runtime (stable TS 7 programmatic API is planned for 7.1).Test plan
pnpm install --frozen-lockfile— cleanpnpm type-check— all 5 workspaces pass, 0 errors, ~7s totalpnpm --filter dify-web exec eslint app/layout.tsx— 0 errors (typescript-eslint 8.59.0 / 8.59.0 aligned)pnpm --filter dify-client exec eslint src/index.ts— 0 errorsvp run type-checkin.github/workflows/style.yml)Made with Cursor