Skip to content

Update TypeScript to v6 - #1407

Merged
microbit-matt-hillsdon merged 1 commit into
mainfrom
typescript-6
Nov 11, 2026
Merged

microbit-matt-hillsdon merged 1 commit into
mainfrom
typescript-6

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator

Updates TypeScript from 5.9.3 to 6.0.3. v7 is held back for now because of ESLint plugin compatibility; typescript-eslint 8.72.1 supports <6.1.0.

Changes

  • Remove baseUrl from tsconfig.json. v6 deprecates it (TS5101) and the styled-system/* path mapping is already relative to the tsconfig.
  • npm run typecheck now also checks tsconfig.node.json (vite.config.ts, panda.config.ts). No script checked it before and it was already failing under 5.9.3. Fixes:
    • vitest/config no longer exports UserConfig; use ViteUserConfig.
    • process.env.BASE_URL is possibly undefined now that strict is the default, so pwaCacheId uses optional chaining.
    • panda.config.ts imports src/deployment/default/panda-preset.ts, so that file moves from the app project to the node project. It cannot be in both (TS6305).
  • tsconfig.node.json writes its composite build info to node_modules/.tmp rather than the repo root (as the Vite templates do), and lists "types": ["node"] explicitly because v6 no longer loads @types/* automatically.

Behaviour change to review

A staged build (STAGE set) with no BASE_URL used to throw at config load. It now gets an undefined PWA cache id, the same as an unstaged build.

Testing

Typecheck, lint, unit tests and the production build pass locally. E2e tests were not run locally.

Drop baseUrl from tsconfig.json: v6 deprecates it (TS5101) and the
styled-system path mapping is already relative to the tsconfig.

Typecheck tsconfig.node.json (vite.config.ts, panda.config.ts) as part
of `npm run typecheck`. It was not checked by any script and had
drifted:

- vitest/config no longer exports UserConfig; use ViteUserConfig.
- process.env.BASE_URL is possibly undefined now that strict is the
  default. A staged build without BASE_URL previously threw at config
  load and now gets an undefined PWA cache id, as unstaged builds do.
- panda.config.ts imports src/deployment/default/panda-preset.ts, so
  that file moves from the app project to the node project (a file in
  both fails with TS6305).

Also for tsconfig.node.json: write the composite build info to
node_modules/.tmp rather than the repo root, and list "types": ["node"]
explicitly as v6 no longer loads @types/* automatically.
@github-actions

Copy link
Copy Markdown

Preview build will be at
https://review-python.microbit.org/typescript-6/

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit 071e654 into main Nov 11, 2026
4 checks passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the typescript-6 branch November 11, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant