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
Prepare a breaking build #76
Conversation
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.
The work in here looks great. I have peeled-off a v5 branch and will be incorporating this into there alongside some of the other changes that have been documented through issues (primarily thinking of gauge()
and off()
). Thanks!
|
||
static validate(events) { | ||
/** @type {Map<string,internals.EventListener>} */ |
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.
👍 I am into some well-placed jsdoc type annotations.
Contains two breaking changes that removes functionality (#65 & #73), and two breaking changes for maintenance (#74 & #75).
Note that when I removed promise support from
emit()
, I took care to preserve the behaviour that a handlerthrow
will not stop the other handlers from being called. This is different from how node events work, where athrow
immediately falls up the the caller.Besides the breaking changes, I also took the opportunity to do some cleaning, which can be seen through the remaining commits. For instance I completely removed
exports.decorate()
which was poorly implemented, not documented, and not used in any hapi projects.The only outstanding issue before this is ready to be published, is updating any dependencies that are going to have a breaking release for hapijs/hapi#4279. This is pending that they are actually published.
If anyone is up for it, there are some undocumented (and not in ts.d) APIs that would be nice to finally include: The ones I have found are:
exports.validate()
(used in hapi, catbox & beam)options
argument ofnew Podium()
andpodium.registerEvent()
podium.once()
called without alistener
(which then returns a promise).podium.few()
method.Additionally, I feel that it would be nice to add a
podium.off()
method that aliasespodium.removeListener()
.Let me know if I should break up the first two commits into separate PRs for easier review (but where should it be merged to?).