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
feat!: add append and prepend handler instead of reverse execution #630
Conversation
BREAKING CHANGE: since "pushHandler()" was actually prepending handlers it is now an alias for prependHandler but "popHandler()" is still removing the last handler.
IMO we should be very careful, because pushHandler() is one of the most important whoops APIs |
@staabm I guess that is the reason @denis-sokolov suggested to create new methods and mark this as deprecated. Because of the reverse execution push was not actually appending handlers as the name indicates. The API is not changing but the naming to clear this out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful PR, thank you!
Could you rename the handlerStack variable to handlerQueue? Since it’s not first in, first out anymore?
sure thing |
🚀 |
Also, shouldn't |
Adding methods to an interface is a major breaking change. |
Ok, so it should be added in Whoops 3.0. |
The method will always work, there is no need to force users off it. |
But it is deprecated, so it could maybe be removed in some future major version. |
Nice change 👍 As an example: Zend did the same with the |
Beware that these changes have been partially reverted in 2.6.0, we should not have released them in a patch version. Please note the PR and the accomodating work was great, the fault is thoroughly on me. #639 (comment) |
see #580
BREAKING CHANGE: since
pushHandler()
was actually prepending handlersit is now an alias for prependHandler but
popHandler()
is stillremoving the last handler.
This should make the interface clearer: pushing (append) is now executed at the end while prepend is alias by the deprecated
pushHandler()
method.People using the deprecated
pushHandler()
method andpopHandler()
should update the implementation to useshiftHandler()
andprependHandler()
.