-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
📢 v2 - Changelog #736
Comments
To be continued.... |
Since, Line 285 in 0d31dc1
|
@StarMonk the following would achieve the same result. func main() {
app := fiber.New()
app.Static("/", "./public")
app.Use(func(c *fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).SendString("I find your lack of navigation disturbing")
})
log.Fatal(app.Listen(":3000"))
} |
API is clear more, can't wait to use it |
Error handling gonna be 🔥 |
Changes look good to me. I'm almost certain VSCode will ask people whether it should update the dependency in go.mod. And suddenly the code doesn't compile anymore. Is this the kind of surprise that you want to make? @Fenny You're breaking like 80% of the API. That calls for an increment of the major version. |
Hey @pofl, good question! We definitely considered moving to It's a fact that Go has a problem when it comes to the Most and if not all repo's that moved to v2+ have issues regarding this matter: The official Go Blog tried to clear the situation up some and posted a write-up about it. Personally I found this write-up somewhat impenetrable. For how important and unusual of a requirement this is, the write-up is not accessible enough. We think this is the right way to go at this point in time to avoid future problems, but please feel free to change my mind! For what is worth, we try to make this transition as good as possible and stand by for anyone who needs assistance. I maintain Fiber in my spare time and all the help is welcome, so any feedback or ideas are highly appreciated! Update: Thanks for all the feedback! We are moving to v2, see: #issuecomment-691251128 |
Okay, I mean you run this project as you think is best. And I want to express my gratefulness for this great library. But the way I see it is that many projects introduce v2+ without major issues. I worked with one of those, https://github.com/jackc/pgx, and it was made quite obvious to me how I should use it. Just I just wanted to give you my opinion on this. I think getting 5 Github issues asking about problems with v2 is the lesser issue compared to surprising people with breaking changes. But that is just my opinion. I'll shut up now. It's off my chest and I'll leave it at that. Thanks again for the great work. |
I understand that module versioning is not perfect, but @pofl is correct: by introducing breaking changes within a major version, you are going to cause more problems for users. Looking through the issues that you've cherrypicked, they for the most part seem to be easily resolved, due to misunderstandings by the user on how to use v2+, or not even related to modules at all (there was one where somebody was complaining about dep not working). That's not to say there aren't legitimate issues, but most of the problems seem to be related to understanding and documentation rather than inherent failure of the system. Please reconsider your decision. They're not perfect, but modules are the path forward, and it would be better to work with the Go team to make them better than stepping on the boat halfway (using modules, but not adhering to the backward compatibility promise). |
Thanks, @pofl, and @e3b0c442 for taking the time to shine some light on this decision! I'm always open to learn new things and change my decision accordingly, I always want to make the right call for the community.
I'm not sure if we can still support legacy pre-module users this way, but that's a sacrifice we have to make. Thanks for sharing your opinions and idea's, this is what open-source is all about 💪 |
I do not use it's all trade-offs. |
edit: sorry 🤦 I didn't see the comment 5h ago |
its a greating. Thank you! |
Yo @Fenny I created that Reddit thread. My aim was to kick off a discussion about the v2 methods in the larger Go community. I didn't want to put you on the spot. And I hate that you have been accused of doing a bad job as the maintainer of this project. Nevertheless I love the fact that you are so open-minded to just change direction in this matter. This project is in good hands. |
Yes... I think that using header before its a more expressive |
Thanks for being so open minded about going to 2.0 after listening to the feedback from the community. This decision has increased my confidence in using and endorsing this package even further. |
Man, i really can't wait for 2.0 😍 . What timezone will the release be on, Fenny? EST? Because if so, i've got an extra one day of waiting to do then.... 😭 |
Updated September 14, 2020 ( 🚀 v2 benchmark results )
Dear Gophers, after long discussions in our , we decided to release
v2.0.0
on 15 September 2020. We will summarize our current API proposal in this post, feedback is more than welcome.⚠ Breaking Changes
string
addr argument.To enable TLS, provide your own listener app.Listener(ln net.Listener) 🤔 Using interface{} to support int or string addresses is confusing #555
Prefork
will be compatible with custom listeners.*fasthttp.RequestCtx
and is still compatible with thecontext.Context
interface.🧹 Updates
Other outgoing Send methods also return an error to comply with the new Handler signature
defaultValue
argument⚠ Removed
// func (c *Ctx) SendBytes(body []byte) {}
// func (c *Ctx) Error() error {}
🔥 New
*fasthttp.Request
.*fasthttp.Response
.c.IP()
to return the value of the given header key. By defaultc.IP()
will return the Remote IP from the tcp connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.ErrMethodNotAllowed
to the error handler. The request size is limited by ReadBufferSize if GETOnly is set. Server accepts all the requests by default.🚀 Routing
📦 Middleware
🚀 Improvements
405 Method Not Allowed
will be passed to the global error handler, in the old version this behavior was not controllable.v2.0.0
allows us to implement a hybrid radix tree router which will remove the remaining allocation whenCaseSenstitive
is disabled and increase performance drasticly. The reason why we went with the hybrid implementation is because we still want to respect the router stack order 😉 thnx @ReneWerner87See: ( 🚀 v2 benchmark results )
The text was updated successfully, but these errors were encountered: