-
Notifications
You must be signed in to change notification settings - Fork 12
A "next" rework #41
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
Open
kanongil
wants to merge
26
commits into
hapijs:next
Choose a base branch
from
kanongil:next-kanongil
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
A "next" rework #41
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # package.json
# Conflicts: # API.md # lib/index.js # test/index.js
Contributor
Author
|
Note that the test coverage failure is a false positive. It seems lab has a bug. |
202ea3f to
e3aacc7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a vision for the next revision of Bounce. Unfortunately it requires too many interdependent patches for me to propose it all as individual PR's. As such I have gathered them into this PR.
Highligts
isBoom()andisError()APIs. Both are better handled using a regularinstanceofcheck.Boomdependency, and'boom'type. The'boom'type can be replaced with theBoomclass. All tests are preserved.typesoption required, and throw aTypeErrorif missing. This aligns with the API docs and typings.strictoption, which will throw aTypeErrorif theerrargument is notinstanceof Error. This helps ensure that the error is actually anError, and means that arethrow(err, 'system')can narrowerrfromunknowntoError.ignore()toassert(). The ignore name is hard to wrap your head around. Now readers can intuitively know that it is expected to throw something on failure.Besides having to replace
ignorewithassert, and'boom'withBoom, I don't expect this PR will affect most existing integrations. Additionally, the changes should make the library more acceptable to use outside the Hapi ecosystem, as well as in browsers / frontend code.