Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kanongil
Copy link
Contributor

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

  1. Merge my Support AbortSignal #37, Add typescript typings #39, and Much faster rethrow(err, 'system') #40 PRs.
  2. Remove isBoom() and isError() APIs. Both are better handled using a regular instanceof check.
  3. Remove Boom dependency, and 'boom' type. The 'boom' type can be replaced with the Boom class. All tests are preserved.
  4. Make the types option required, and throw a TypeError if missing. This aligns with the API docs and typings.
  5. Add new default strict option, which will throw a TypeError if the err argument is not instanceof Error. This helps ensure that the error is actually an Error, and means that a rethrow(err, 'system') can narrow err from unknown to Error.
  6. Rename ignore() to assert(). 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 ignore with assert, and 'boom' with Boom, 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.

@kanongil kanongil added feature New functionality or improvement breaking changes Change that can breaking existing code labels Aug 31, 2025
@kanongil kanongil changed the base branch from master to next August 31, 2025 12:44
@kanongil
Copy link
Contributor Author

Note that the test coverage failure is a false positive. It seems lab has a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Change that can breaking existing code feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants