Conversation
- Add explicit types fields (v6 defaults to types: []) - Constrain BufferSource type to ArrayBuffer for ES2024 - Drop esModuleInterop true by default
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4824 +/- ##
=======================================
Coverage 92.84% 92.84%
=======================================
Files 177 177
Lines 11643 11643
Branches 3469 3469
=======================================
Hits 10810 10810
Misses 832 832
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
travisbreaks
left a comment
There was a problem hiding this comment.
TypeScript major version bumps in framework code need careful review. A few things:
-
BufferSource narrowing to ArrayBuffer: This is the most impactful change. Downstream consumers passing TypedArray or DataView to Hono APIs that accept BufferSource will break at the type level. Worth checking if any middleware or common patterns rely on passing Uint8Array directly (common in Workers/crypto code).
-
esModuleInterop removal: If downstream projects importing Hono have esModuleInterop enabled in their tsconfig (which many do as a default), this should be fine. But if Hono's own code relied on esModuleInterop for default imports from CJS modules, those imports would need to change to namespace imports. Worth verifying no CJS dependencies are imported with default-import syntax.
-
TS7 pre-testing: Thorough approach testing against tsgo. The 4 build errors in tests: are these known tsgo gaps or real issues that TS7 would surface?
-
Peer dependency range: Will the package.json typescript peer dep be updated to include v6? Users on v5 shouldn't be forced to upgrade until they're ready.
Good migration work. The author's diligence on pre-testing TS7 is noted.
This PR updates TypeScript to v6 and adjusts config for the new defaults.
typesfields (v6 defaults totypes: [])BufferSourcetype toArrayBufferesModuleInteroptrue by defaultNote
TS v6 benchmarks ran a bit slower, which is expected - v6 is mostly a preparations release with stricter checks ahead of v7.
Benchmarks using
tsgoand today's TS v7 release show roughly 2× lower memory usage and almost 3× faster type-checking on Mac M3.TS 7.0 readiness
tsc --stableTypeOrdering --noEmit- passes with no issuestsgo --noEmitwith TS 7.0.0-dev.20260324.1 - passes with no issues (full type-check with the native Go compiler)tsgo -p tsconfig.build.json- passes with no issues (successfully generatesd.tsfiles)tsgo --build- 4 errors in tests code regarding overload resolutionThe author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code