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

Stop using tiged #50

Closed
goisaki opened this issue Jun 20, 2024 · 6 comments · Fixed by #63
Closed

Stop using tiged #50

goisaki opened this issue Jun 20, 2024 · 6 comments · Fixed by #63

Comments

@goisaki
Copy link
Contributor

goisaki commented Jun 20, 2024

Currently create-hono uses tiged to download templates, but since this is not dynamic and the data size is small, it would be better to include the templates themselves in create-hono. This change would reduce package size and speed up project generation. It may be necessary to automatically update the package to match the template updates, but this is enough work to be worth the effect and I can make it myself.
If we plan to support 3rd-party repositories as templates in the future it makes sense to continue to rely on tiged. However, it is safe to assume that users with such advanced usage already have the git command installed; the create-remix implementation that downloads Github repositories as a zip can also be referenced.

@ryuapp
Copy link
Contributor

ryuapp commented Jun 20, 2024

I agree to stop using tiged.
In my opinion, I find it problematic that tiged depends on git.

Many users already have git installed, but beginners and people who have replaced their PC do not have git installed.
I often see people on Discord community who don't have git installed for some reason and can't use create-hono.
Also, that error is very confusing. This is the pain point.

We can do something like create-remix, but depending on a reliable library will reduce maintenance costs.
For example, giget:
https://github.com/unjs/giget

@yusukebe
Copy link
Member

I also want to stop using git and make it not depend on git.

At first glance. Using giget is good.

@goisaki
Copy link
Contributor Author

goisaki commented Aug 1, 2024

Hi @yusukebe @ryuapp @MathurAditya724
Sorry for the ongoing implementation, but there is another way that is simplest and does not require git commands or heavy tiged etc.
It is to put the templates in create-hono itself. If we clone the templates with Git when we build, users can use create-hono without Git commands. And the experience would probably be better, as templates are lighter than tiged (at least for now) and don't call for additional network traffic.
This method would require more work than using third-party libraries, but the benefits are worth the cost. What do you think about this method?
See also create-vite for the same method.

@MathurAditya724
Copy link
Contributor

For using community templates in vite they suggest we use degit - https://github.com/vitejs/vite/tree/main/packages/create-vite#community-templates

In our case, we want to download the templates using create-hono because of the hooks, especially for Cloudflare-related templates. So even if we bundle the templates in create-hono we need something like degit to download external/community templates. These support caching and offline mode so once a user has used them they will be cached (Currently this is not supported but we can enable this in the future #63 (comment)).

Also IMO, most users don't use more than 2 - 3 templates. I did comment about this approach here #62 (comment)

@goisaki
Copy link
Contributor Author

goisaki commented Aug 3, 2024

The recommended method of using degit to download community templates is very reasonable.
With create-hono we should focus on providing the best bug-free experience in common cases rather than how to support all cases.
So it is a good way to package the templates for this goal.
I would like to hear @yusukebe and @ryuapp 's opinions, especially on the support for community templates.

@ryuapp
Copy link
Contributor

ryuapp commented Aug 3, 2024

I also think it's good to implement like create-vite. However, due to the configuration, maintainers will have to upload the package every time you update the Hono version in package.json. It takes time for them, so we need to think about it.

At least the current configuration is less time consuming.

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

Successfully merging a pull request may close this issue.

4 participants