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

Improve bundle size #66

Open
3 tasks
goisaki opened this issue Aug 19, 2024 · 5 comments
Open
3 tasks

Improve bundle size #66

goisaki opened this issue Aug 19, 2024 · 5 comments

Comments

@goisaki
Copy link
Contributor

goisaki commented Aug 19, 2024

The binary size of create-hono is currently 1.39 MB.
This is clearly larger than create-remix (93.3kB)(with dependencies) and create-vite (56.9kB) and should be improved.

These are some of the ways to improve:

  • Stop using commander.
    • arg-parser can be replaced by node:util's parseArgs.
    • usage can be replaced by console.log.
  • Use @clack/core instead of @inquirer/* and nanospinner (225kB total)
  • Self-implement giget(342kB)

I have already tried all of this locally and can make a PR right away.
I would like to hear @yusukebe, @ryuapp, and @MathurAditya724's opinions on these changes.

@yusukebe
Copy link
Member

Hi @goisaki

Here are my thoughts:

  • We don't have to minify it. It should be easy to debug.
  • We should compare "install size"s. You can see them at https://pkg-size.dev/
  • This package will be cached when the user runs the create hono command many times. I think we don't need to be strict about file size.

@goisaki
Copy link
Contributor Author

goisaki commented Aug 22, 2024

Hi @yusukebe
What do you think about @clack/prompts?
It has a very cool UI, small size and also a graceful message on exit.

@yusukebe
Copy link
Member

@goisaki

Looks good. But can you create the UI similar to the current version with @clack/core not using @clack/prompts?

@goisaki
Copy link
Contributor Author

goisaki commented Aug 24, 2024

hi @yusukebe

Understood. As such, I will make a PR.

  1. It would be more effective to migrate the chalk of the duplicate feature package to picocolors (which @clack/core depends on, smaller in size), is that ok?

  2. I would also like to hear why we need to keep a similar UI and only use @clack/core.
    If “UI” means “behavior” (excluding appearance), then we can make it look better without changing the content or order of the prompts.

I am positive about changes/improvements to the look and feel because it makes the experience better.

@yusukebe
Copy link
Member

@goisaki

  1. It would be more effective to migrate the chalk of the duplicate feature package to picocolors (which @clack/core depends on, smaller in size), is that ok?

Yes.

  1. I would also like to hear why we need to keep a similar UI and only use @clack/core.

Because I like the way it looks now. Also because I worry that using @clack/prompts will make it look like any other create-* that uses it.

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