Hono should drop CJS support in next major version and go ESM only
right now Hono is published as a dual package with both cjs and esm support,
but there isn't any widespread usage of hono in pure cjs context [sourcegraph search for require("hono")]
there is lot of typescript code that looks like imports but is compiled down to CJS under the hood, but I think its fine. Current supported Node releases are 22, 24, and 26. Node 20 is EOL. require(esm) is already supported across all supported node versions including node 20. Node is only one of Hono's target runtime where we need CJS and that issue is mostly solved, on runtimes like Bun/Deno/Cloudflare we don't have any use for CJS.
So I think we should, raise minimum supported version for hono to node >=22 and remove all tooling for CJS and publish hono@5 (next major) as a ESM only version.
Refs:
Open PR: #5114
Hono should drop CJS support in next major version and go ESM only
right now Hono is published as a dual package with both cjs and esm support,
but there isn't any widespread usage of hono in pure cjs context [sourcegraph search for require("hono")]
there is lot of typescript code that looks like imports but is compiled down to CJS under the hood, but I think its fine. Current supported Node releases are 22, 24, and 26. Node 20 is EOL.
require(esm)is already supported across all supported node versions including node 20. Node is only one of Hono's target runtime where we need CJS and that issue is mostly solved, on runtimes like Bun/Deno/Cloudflare we don't have any use for CJS.So I think we should, raise minimum supported version for hono to node >=22 and remove all tooling for CJS and publish hono@5 (next major) as a ESM only version.
Refs:
Open PR: #5114