[no-Jira] Migrate to TypeScript 6#1792
Conversation
|
Preview branch generated at https://typescript-6.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against 1d25db1 No significant changes found |
2665662 to
094a21d
Compare
canac
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review
Verdict: APPROVED WITH SUGGESTIONS — no blockers, mechanical TS 5.6 → 6.0 bump. 1 Important + 4 Medium/Suggestion findings posted as inline comments.
Risk Assessment
- Score: 10/10 (capped) — CRITICAL
- Driven by typescript compiler-version blast radius across the whole repo, not by semantic risk in the diffs themselves. The actual changes are minimal and mechanical.
- Gate merge on a green whole-repo
yarn lint:ts+yarn testCI run, plus a manual smoke test of the two upload paths (CSV import + avatar upload) given thenew Uint8Array(...)wrap.
Agents Run
Security, Architecture, Testing, UX, Standards, Financial Reporting (Data Integrity skipped — no schema/migration/Apollo cache/mutation/pagination changes).
Key Findings
-
[Important 7.0] Root cause of every
String(t(...))wrap is stalei18next@21.9.2/react-i18next@11.18.6. Newer versions returnstringby default, or augment viainterface CustomTypeOptions { returnNull: false }. Eliminates the churn and de-risks the ~73 other unwrappedaria-label={t(...)}sites that compile today only because looser MUI prop typings tolerate the wider return type. Follow-up ticket recommended — not blocking. -
[Medium 6.5] Inconsistent fix style:
ExpectedMonthlyTotalReportTable.tsxhoistsconst label = t(...)while the other 7 files inlineString(t(...)). Pick one. Flagged by 4 agents (Architecture, Testing, UX, Standards). -
[Medium 6.0] New
tsconfig.jsontypes: ["node", "jest", "@testing-library/jest-dom"]narrowing is load-bearing on a transitive/// <reference types="google.maps" />from@googlemaps/js-api-loader. Add an explicit reference inapp.d.tsso a future dep upgrade can't silently drop ambient types. -
[Medium 5.0] Selective application — only ~7 of ~80
aria-label={t(...)}sites were wrapped (rest compile via looser MUI prop typings). Confirmyarn lint:tspasses whole-repo, not just changed files, before merging. -
[Suggestion 4.0]
@types/testing-library__jest-domis now redundant — the runtime@testing-library/jest-dompackage ships its own types (and is referenced explicitly in the newtypesarray). Remove from devDependencies. -
[Suggestion 4.0] No tests cover the two upload endpoints (pre-existing, excluded by jest coverage policy).
new Uint8Array(Buffer)wrap is byte-identical at runtime, but smoke-test both upload paths before merge.
What's Clean
- Security: No findings.
NextAuthOptions['providers']swap is type-equivalent toProvider[].new Uint8Array(buffer)copies bytes 1:1 (no risk of reading past buffer).typescriptcorrectly placed indevDependencies. No NextAuth callback / CSP / env-var / redirect changes. - Financial Reporting: No calculation, aggregation, currency, or date logic touched.
- Standards Checklist: All applicable items PASS. No new
any, no@ts-ignore, no debug output, no commented-out code, nonew Date(). - Architecture positives:
moduleResolution: "bundler"is the correct choice for Next 15 + TS 6. RemovingbaseUrlwhile adding explicitpathsis the right move.declare module '*.css'confirmed needed (2 real CSS imports in_app.page.tsx).
Dependency Impact
Global: tsconfig.json, app.d.ts, package.json, .yarn/sdks/typescript/package.json. No breaking runtime changes.
Findings on Related Files (Not in Diff Hunk)
The following finding is on a file in this PR but on a line outside the diff hunk, so it cannot be posted as a line-anchored comment:
[Suggestion 4.0] package.json:116 — @types/testing-library__jest-dom is now redundant. The runtime @testing-library/jest-dom package ships its own types and is referenced explicitly in the new tsconfig.json types array. Remove this DefinitelyTyped package from devDependencies: yarn remove @types/testing-library__jest-dom. Informational — not blocking.
| export = value; | ||
| } | ||
|
|
||
| declare module '*.css'; |
There was a problem hiding this comment.
/// <reference types="google.maps" />
declare module '*.graphql' { ... }
declare module '*.css';
declare module '*.svg';|
@wjames111 This is not urgent at all. But I remembered I had this working in a branch a few weeks ago, so I might as well push it up. This should take care of all the breaking changes so that when TypeScript 7.0 comes out (which is supposed to be ~10x faster 🚀 ) it will be an easy upgrade. |
wjames111
left a comment
There was a problem hiding this comment.
Looks great, looking forward to the upgrade! Claude mentioned this as well, "the String(t(...)) workaround papered over a typing problem that's better solved with one module-augmentation block in app.d.ts" if this is possible to do a in a module wouldn't it be better just to do it there?
Description
Upgrade to TypeScript 6.0
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions