Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Templates using Javascript: Enhancement Suggestion #50

Open
NicKAnderson038 opened this issue Sep 23, 2024 · 1 comment
Open

Comments

@NicKAnderson038
Copy link

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
@yusukebe
Copy link
Member

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.

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

No branches or pull requests

2 participants