chore(typescript): adopt TypeScript 7.0 (tsgo) for cowswap-frontend typecheck - #7907
tenderdeve wants to merge 4 commits into
Conversation
…ypecheck Start the TypeScript 7.0 migration (cowprotocol#7827). The native compiler (tsgo) is type-check compatible with tsc and ~10x faster. - Add @typescript/native-preview as a dev dependency. - Switch the cowswap-frontend typecheck target to tsgo (it type-checks cleanly). - Add docs/typescript-7-migration.md documenting the approach, how to run tsgo, and per-project status. Repo-wide rollout is gated on cowprotocol#7828; the remaining libs don't type-check cleanly yet, so they stay on tsc until fixed. Each project is switched to tsgo as it's verified.
|
@tenderdeve is attempting to deploy a commit to the cow-dev Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe repository adds the TypeScript native preview compiler, documents its incremental migration, and changes the cowswap frontend typecheck target from ChangesTypeScript 7 rollout
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| nx typecheck cowswap-frontend | ||
| ``` | ||
|
|
||
| ## Status |
There was a problem hiding this comment.
Looks good @tenderdeve, but we have other libs and apps that are passing typecheck right now and can be moved over.
…ript-native-preview # Conflicts: # pnpm-lock.yaml
|
@kernelwhisperer thanks — agreed. I've resolved the conflict with On moving more projects over: I looked into it and it's not a clean target-flip. ( So I'd suggest keeping this PR scoped to |
|
Hey @tenderdeve I think we should do the migration to ts 7 in one go and not step by step. Let's try to do it all in this 1 PR, it should be just tsconfig changes, right? |
…er (tsgo) Switch every place that ran tsc to tsgo: cowswap-frontend (already), the workspace typecheck script, and ui. Make the tsconfigs TS7-compatible, which is what unblocks the rest of the workspaces: - tsconfig.base.json: moduleResolution node10 -> bundler; drop the removed baseUrl and downlevelIteration options. - Remove esModuleInterop:false from every project (TS7 is always esModuleInterop true); remove baseUrl (cowswap-frontend/explorer keep resolution via a paths '*' -> ./src/* map, others just drop it) and downlevelIteration. - Add a one-line 'declare module inter-ui' shim to the three apps that side-effect-import it, since bundler resolution is stricter about untyped side-effect imports. typecheck-workspaces.mjs now only skips balances-and-allowances, which has a real type error (missing @cowprotocol/cow-sdk Solana exports) unrelated to the compiler swap; core/snackbars/tokens/ui/wallet now type-check cleanly under tsgo and are back in the pipeline. Verified locally with tsgo: tsconfig.base + every non-skipped lib, plus sdk-tools and widget-configurator, type-check with zero errors. cowswap-frontend and explorer are left to CI (they exceed local resources here).
|
@kernelwhisperer done — migrated the whole monorepo to tsconfig changes (base + per-project):
Two non-tsconfig bits it needed:
Verified locally with |
|
First step toward #7827.
TypeScript 7.0 ships a native compiler (
tsgo,@typescript/native-preview) that's type-check compatible withtscand ~10x faster.@typescript/native-previewas a dev dependency (pinned).cowswap-frontendtypechecktarget fromtsctotsgo— it type-checks cleanly under the native compiler (0 errors).docs/typescript-7-migration.md: how to runtsgo, per-project status, and the rollout plan.Kept incremental on purpose:
tscstays installed and in use everywheretsgohasn't been rolled out. Repo-wide adoption is gated on #7828 — the remaining libs don't type-check cleanly yet, so they stay ontscuntil fixed. I'll flip each project totsgoas it's verified (uiis already fixed in #7905).@kernelwhisperer as discussed on #7879.
Summary by CodeRabbit
Tooling
Documentation