-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Which web framework should Gitea switch, Gin or Chi? #7403
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
Comments
If there could be a list of reasons why one is better than the other for Gitea from anybody who has an opinion/experience with them that would be helpful! |
For those who want to know the differences if they do not already know that: Please look at the code, look at the examples! I personally prefer Chi because it includes lesser magic, is more idiomatic Go, is simple as the stdlib with some additional sugar. That's why I fell in love with it and using it for all my projects. |
Agree with @tboerger chi is powerful like gin, but simple as stdlib. |
See the all router benchmark results. |
Ok, I think we need to be clear about what we think are the problems with macaron, what we use in macaron and what we would like to use in future. There's a cost to every framework not just in terms of performance but in terms of refactoring and architecture and we should be careful about what we choose to do. If it's just a case of macaron is dead so let's move off it then we should consider a fork or even drop to basic go. If it's a case of macaron makes poor architectural choices then that's a better reason to move but it will certainly cost and we should be certain that we want that architecture. |
Problems I see with macaron:
|
Better URL BrandingWhile this is being reworked I'd suggest considering how to have personally branded URLs. Project URLsInstead of Being able to have ForksInstead of perhaps forks could be handled as
or or even ReasoningI think the aspects of ownership and control are what draw a lot of people to platforms like Gitea - personal. However, it doesn't make a lot of sense to me to always have "organizations" in the traditional sense of what GitHub and GitLab do, for self-hosted git platforms. It should be possible to have more controlled branding. Also, as a service offering, branded Git would be unique. |
I dislike changing the url schema, I'm organizing a lot based on orgs. Beside that, this is not related to choosing one of the frameworks. |
I'm not saying that it should be the default for everyone. I'm saying it should be possible. If all of the URL routing is being rewritten, it's an absolutely perfect time make it flexible to allow for prettier URLs. |
We should keep URL compatible on 1.x even if we changed a web framework. It will broken all the references. |
|
I would say gin because I have better experience with it and like it but the big deps for msgpack and protobuf are kind of bad currently. I haven't use chi so I can't comment on it. |
A problem is gin or chi 's routers maybe not powerful enough to satisfy gitea's requirements. |
Can you give an example? |
One example:
|
I am coming here from #7670 issue. I think before framework is switched, it might be worth asking what changes at the framework level is desired. Macaron has been stable for a while and seem to get the job done (with the caveat that I am not aware of any prior conversation). Switching framework seems like a lot of work. If the primary reason for switching framework is that macaron does not accept/merge any prs and there is no desire to make any other major changes to macaron by Gitea project, forking might be less work. Hence probably a better choice. |
@tamalsaha I have created fork organization, please resend your pull requests to https://gitea.com/macaron . |
@lunny That appears to be supported as per https://godoc.org/github.com/go-chi/chi
|
Does "/page/*/index" match |
@lunny it seems to support custom regex so we could match thoses cases. |
I am tempted to do a POC with chi to learn it |
@sapk that would be great, would love to see that. My experiment with chi somehow was not so sucessful |
We should maybe try to make sub function that are router independent first. |
Of the two, I really like Chi... In fact, I stopped reading Gin's example code after:
Since that would mean nothing to someone who was just familiarizing themselves with the project and didn't know about Gin, or web-frameworks, etc. It's a classic 101 no-no for method naming. Chi's was much better:
I happily read through almost all the example code for Chi with nothing jumping out at me as annoying, incorrect, or confusing. Chi 🥇 |
After playing with chi, I like the KISS feel but it seems to miss some middleware implementation. I am not against implementing them but that will need some work. |
You can always create a pr for useful middlewares which aren't part of chi middleware package |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Closed by #7420 |
I have sent an expirement PR to switch from Macaron to Gin #7177.
But I know some body wants to use Chi (@tboerger @vtolstov).
So I think a vote is meaningful, but I have to say this will not decide which one we will use finally.
👍 Gin
❤️ Chi
The text was updated successfully, but these errors were encountered: