chore: upgrade TypeScript to v6 and hold v7 - #351
Conversation
TypeScript 7 can't land yet. typescript-eslint, which comes in through @playcanvas/eslint-config, only supports typescript <6.1.0 (latest 8.70.1), so linting crashes on 7. Move to 6.0.3, the newest version it supports, and make the config changes that 7 will also need. - Remove baseUrl from the root and blocks tsconfigs. TS 6 deprecates it (an error by default) and TS 7 removes it. Nothing used it as a lookup root, and blocks' paths already start with ./src, so they resolve the same without it. - Add "types": ["node"] to lib's tsconfig. TS 6 no longer loads every @types package by default, and lib's env.ts uses the process global. - Drop an @ts-expect-error on navigator.gpu that TS 6 reports as unused, because its DOM types now include WebGPU. The one on navigator.xr is still needed. - Hold typescript below 7 in renovate.json until typescript-eslint supports it, like the existing changesets/action hold. Verified locally: build, lint, test and fmt pass with the same results as main. The emitted .d.ts files are byte-identical to TS 5.9's, and the only JS differences are comments: the removed directive, and commented-out JSX in splat-viewer that TS 6 no longer copies into the output. pnpm 12's first re-resolve also re-keys a few lockfile snapshots (debug's optional supports-color peer and the eslint-plugin-import cycle) without changing any package version other than typescript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
commit: |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review comments remain, and all readiness assessments support approval.
Review effort: Lite
Findings: None
What changed in this PR
Upgrades TypeScript to 6.0.3, prepares configuration for TypeScript 7, and prevents Renovate from proposing v7 prematurely.
Changes:
- Removes deprecated
baseUrlsettings. - Adds Node typings and updates WebGPU compatibility.
- Updates dependency metadata and Renovate constraints.
| File | Description |
|---|---|
tsconfig.json |
Removes deprecated root baseUrl. |
renovate.json |
Holds TypeScript below v7. |
pnpm-lock.yaml |
Updates TypeScript and dependency snapshots. |
packages/lib/tsconfig.json |
Includes Node typings. |
packages/lib/src/utils/create-graphics-device.ts |
Removes obsolete WebGPU suppression. |
packages/blocks/tsconfig.json |
Removes deprecated baseUrl. |
package.json |
Upgrades TypeScript to 6.0.3. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
TypeScript 7 can't land yet. typescript-eslint, which comes in through
@playcanvas/eslint-config, only supportstypescript <6.1.0, even in its latest release (8.70.1), so lint crashes on 7. That's one of #348's failures. This moves to TypeScript 6.0.3, the newest version typescript-eslint supports, makes the config changes TypeScript 7 will also need, and holds 7 in Renovate until typescript-eslint catches up.Changes
baseUrlfrom the root and blocks tsconfigs. TS 6 deprecates it (an error by default) and TS 7 removes it; it caused fix(deps): update all npm dependencies (major) #348's build failure. Nothing used it as a module lookup root, and blocks'pathsalready start with./src, so they resolve the same without it."types": ["node"]to lib's tsconfig. TS 6 no longer loads every@typespackage automatically, andsrc/utils/env.tsuses theprocessglobal. It goes in lib's config rather than the root one because only lib has@types/node.@ts-expect-erroronnavigator.gputhat TS 6 reports as unused, because its DOM types now include WebGPU. The one onnavigator.xris still needed.typescriptbelow 7 inrenovate.jsonuntil typescript-eslint supports it, written like the existingchangesets/actionhold.Verification (local)
.d.tsfiles are byte-identical to a TS 5.9 build. The only JS differences are comments: the removed directive, and commented-out JSX insplat-viewer.tsxthat TS 6 no longer copies into the output.tsc-aliasrewrites blocks' imports exactly as before.typescriptis the only package whose version changes. This is the first dependency change under pnpm 12, so the re-resolve also re-keys some snapshots, as described in pnpm 12's release notes.debug's optionalsupports-colorpeer is now linked, and theeslint-plugin-import/eslint-module-utils/eslint-import-resolver-typescriptpeer cycle is keyed canonically.After merging
Tick the rebase box on #348 so Renovate regenerates it from main. With the hold, it should drop
typescript, and its CI should then show whether ESLint 10 andlucide-react1.x work.No changeset: the published output changes only in comments.
🤖 Generated with Claude Code