Skip to content

Upgrade TypeScript to 7 - #305

Merged
keichi merged 1 commit into
masterfrom
upgrade-typescript
Oct 15, 2026
Merged

keichi merged 1 commit into
masterfrom
upgrade-typescript

Conversation

@keichi

@keichi keichi commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Depends on #304. Base is migrate-browser-tests-to-vitest; it will retarget to master once #304 is merged.

Summary

  • Upgrade typescript from 5.1 to 7. Nothing uses the TypeScript JS API anymore (ts-node and karma-typescript are gone), so the native compiler works for npm run build.
  • tsconfig.json:
    • Set rootDir: "./lib" explicitly. TS 6+ requires it.
    • Remove moduleResolution: "node". node10 has been removed, and the default resolution handles undici-types for the ESM build.

Output

  • The emitted JavaScript (CJS and ESM) is byte-identical to TypeScript 5.1.
  • The only difference is in .d.ts: the leading /// <reference types="node" /> lines are gone. TypeScript stopped synthesizing them in 5.5. Consumers who reference Buffer types still need @types/node, as before.

Testing

  • npm run build passes, and its output was diffed against TS 5.1.6.
  • npm test: 166 passed
  • npm run test:browser: 82 passed, 1 skipped
  • npm run format passes

ts-node and karma-typescript, which relied on the TypeScript JS API, are
gone, so the native TypeScript 7 compiler can be used for the build.

- Set rootDir explicitly, now required.
- Drop moduleResolution: node10 has been removed, and the default
  resolves undici-types for the ESM build.

The emitted JavaScript is identical to TypeScript 5.1. The declaration
files no longer start with /// <reference types="node" />, as
TypeScript stopped synthesizing it in 5.5.
@keichi
keichi force-pushed the upgrade-typescript branch from 4c9cb4e to 2ad5a03 Compare October 15, 2026 14:12
Base automatically changed from migrate-browser-tests-to-vitest to master October 15, 2026 14:14
@keichi
keichi merged commit 5390a03 into master Oct 15, 2026
@keichi
keichi deleted the upgrade-typescript branch October 15, 2026 14:15
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