-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Echo v3 #665
Comments
/cc @abador |
Thanks for the heads up! Just out of curiosity: what exactly is holding back the Just asking because some people, if not most, are attracted to the piece of the graph that shows how much faster echo is when using But I trust @vishr's decision on what might be the best for the long run. |
Yes, it has been a challenge to maintain two implementation with one interface, we have to compromise on features like you mentioned.
I think we need to find newer way to attract people ;), probably we will put old routing benchmarks :). We will figure it out :) In short, we want to be aligned with Go |
I agree. In my opinion, in the long run maintainability is a better path to follow. |
fasthttp is an interesting library and although it of course provides some great numbers for the Go-router-benchmark obsessed in reality it's use-cases are rather quite niche and I don't think the touted benefits are really worth the compromises that trying to support it within the one framework introduces. I found myself using echo less and less with v2 as it just seemed to have become more complex and laborious to use when much of the complexity wasn't delivering immediate benefits (if using the standard engine). Router benchmarking in the Go ecosystem has jumped the shark IMO - most of the frameworks around now are more than fast enough for most people and the perf differences are imperceptible to an app as a whole so focusing on features, stability and ease-of-use makes much more sense. I'd rather see things being aligned with the Go standard framework more and fewer external dependencies. Less is more. |
That is some serious changes, I'm mostly Ok with. But I'm not sure if the versioning scheme fits and reflects the amount of changes, especially the breaking ones. I'd better issue a 3.0 release. |
Agreed, 3.0 makes more sense. |
Signed-off-by: Vishal Rana <[email protected]>
Signed-off-by: Vishal Rana <[email protected]>
Great decision! |
@lugorian Is it something similar to https://echo.labstack.com/guide/context? |
I think that it's the right way. My opinion is that if someone really needs fasthttp they use it natively. |
@vishr Yes it is similar but with some neat tricks to avoid context casting again and again. Also provides nice api for composing custom framework.. Look at this examples: Lars router is inspired by echo(among ather frameworks), maybe echo can borrow few tricks back from lars? ;) What do you think? |
@lugorian Will look into it soon. |
@vishr If we're talking about simplicity. One of the biggest warts that echov2 has is the ridiculously big Context interface. I'd like to make a case for simple interfaces and composition. In PR #470, I show how this interface could be greatly reduced in complexity by isolating it's pieces. However in this PR I was trying to be mostly API compatible and so it stayed an interface. https://github.com/aarondl/ultimateq/blob/master/irc/writer.go#L103 I'm not hell-bent on one approach or the next, it just seems like a good time to clean up one of the messiest parts of the library and I wanted to provide an example of how it may be done :) |
Hey @lugorian @vishr just wanted to mention about using a Context interface for handlers; I recently struggled with this in my package lars. The recent implementation of the func(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
}
} nosurf CSRF middleware is a perfect example, it was recently updated to use
// because 'r' is a copy of a pointer to allow the information to get
// back to the caller, need to set the value of 'r' as below with '*r'
func(w http.ResponseWriter, r *http.Request) {
*r = *r.WithContext(context.WithValue(r.Context(), 0, "testval1"))
} it may not be a good idea to use a Context interface, I ranted about this in releases 3.3.0 Special Notes section and 3.3.1 I even went so far as to create a new router pure to avoid all of these issues, here is an example application I whipped up to show how it would work here not saying you shouldn't use it, just highlighting some issues I've come accross, good luck with v3! 😃 |
@joeybloggs Thanks for the detailed information. I will definitely keep everything in mind for v3. Update: Context in Echo is the core of the framework, dropping it would not be a good move. We definitely need to understand this issue and address it differently. |
@aarondl I am failing to understand the benefit of splitting the context into multiple interfaces. If you need to extend context, you can simply do it as mentioned in this guide https://echo.labstack.com/guide/context |
@vishr It's just about cleaner code. Current implementation goes against everything interfaces should be, small and composed. If people are somehow happy with the way the Context is implemented I'll be quiet. I just wanted to note that v3 is a refactoring opportunity for something I find unpleasant about echo, we could change it to be more idiomatic and cleanly separated. I'll leave it at that :) |
Would be great if you could also try to keep the functionality provided by echo to a minimum (i.e. Cookie implementation in v2 could be handled almost identically without echo). |
@vishr ok, thanks for clarifying, all clear now, just one more thing, by |
Yes. |
@vishr i just went through the
Also, i noticed that when in a branch, hugo references files from the github repo, (master branch code) i wonder if its possible to make it reference current branch and local files. Would it be ok to send a PR with the change to the middleware recipe ? also, what should we do for GAE and graceful ? |
Once we release v3, master will be pointing to v3. Ideally, we should keep source code reference as is. With that there might not be much change in the docs. In short, we want to make sure all the code mentioned in the docs should be for v3, for instance, |
@vishr Oh, understood the v3 branch references to master, yes, i could cover the I have a couple of questions i did not get answer from your last comment:
I'll start looking on the |
@vishr sorry, I am busy for debug my app, which is written by echoV3 and gorm(https://github.com/jinzhu/gorm). @apaganobeleno If you have time now, you can help me to cover the |
@apaganobeleno
Yes
Graceful shutdown is now part of the core framework using |
thanks @vishr, i'll give it a shot soon. |
@vishr Thank you. |
@vishr Regarding the graceful description would it be ok do tell something like:
|
Looks good. For future just send me a PR and we can discuss over there. |
@vishr are we ok to mark "Update recipes" > "Put back Gracful shutdown" task as done or it still needs more work ? |
Just updated. |
When is V-3 going to release? |
Anyone up for updating the |
I could help but im out the city now, would it be ok starting next week? |
@apaganobeleno Sure, also look into #667 PR. |
@apaganobeleno We will just have a benchmark chart based on Echo performance for various API set. |
A new v2 release is cut from master branch and master now has v3, still not released yet but it makes it easier to develop on master. |
@apaganobeleno I need help in updating the migrating guide and change log, please let me know if you are in. You can send me initial PR and we can take it from there. PS: We will drop v1 mention from the migrating guide. |
@vishr i'm in 👍 |
@apaganobeleno Update: we still need to retain v1 to v2 migration. |
Thanks everyone!!! |
It seems that fasthttp support was finally dropped, but Feature Overview in README still notes fasthttp:
|
Echo v3 on go-echo/echo fork is NOT in sync with main repo. |
Making Echo as simple as it was in v1
fasthttp
support to keep the project simple, easy to maintain, aligned with standard library and compatible with community packages. As simple as it was in v1.Skipper
function to conditionally skip a middlewareMap
type as shorthand formap[string]interface{}
@ericmdantas @o1egl @CaptainCodeman @mtojek @Anon-Penguin @gavv @01walid @ipfans @matcornic
Open for discussion
The text was updated successfully, but these errors were encountered: