honojs/starter

Additional Templates using Javascript: Enhancement Suggestion

NicKAnderson038 opened this issue · 1 comments

This suggestion is based on the continued wide spread use of Javascript. I've been really enjoying the performance and DX of Hono and would love to encourage more people who are hesitant to try Hono.

An example would be a the nodejs template. An update to the cli would prompt Typescript or Javascript like in vite. If selecting Javascript a new template would include the following changes.

  1. package.json
    { "dev": "node --watch src/index.js" } // The watch flag is available by node 18 which is also the earliest version of node usable by Hono.

  2. jsconfig.json // type inference support

Vite screenshot

Screenshot 2024-09-21 at 3 11 07 PM Screenshot 2024-09-21 at 3 11 34 PM

Hi @NicKAnderson038

This is an interesting proposal. But I don't agree with the "JavaScript" in the starters. Hono is based initially on TypeScript (though we started to create Hono with JavaScript and JSDoc in the early phase). TypeScript is okay because the target runtime/platforms are Cloudflare Workers/Pages, Deno, and Bun. With these runtimes/platforms, we don't have to compile it to JavaScript explicitly. And we can use vite/tsx for Node.js, and now there are builders. So, I don't have any chance that I want to write JavaScript instead of TypeScript for the Hono app. I think it's not necessary to support JavaScript templates by making the code more complicated.