Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Unbox 2.2.0 #134

Merged
merged 7 commits into from
Oct 23, 2016
Merged

Unbox 2.2.0 #134

merged 7 commits into from
Oct 23, 2016

Conversation

JohnSundell
Copy link
Owner

This is the release branch for version 2.2.0 of Unbox. This release has 2 goals:

  1. Performance. Unboxing collections has been made ~25% faster, thanks to decreased iteration complexity - and key path-based unboxing has been made ~50% faster due to not using associated enum values.
  2. Simplified error API. Unbox has always provided a thorough error reporting API, but this has now been a lot simpler to use - with a single UnboxError struct that comes with readable, easy to debug error descriptions.

Unbox will now throw only a single error type, with a detailed description
or what went wrong. This makes it a lot easier to consume, as you no longer
have to pattern match against multiple error cases, and instead can use
`UnboxError` as a single type.

Unbox errors are now also a lot more readable and provides a lot more debug
information. For example, an invalid array element would previously just return
an “invalid value” error, while now it outputs the following:

“[UnboxError] An error occurred while unboxing path “key.path”: Invalid array
element (InvalidValue) at index 5”.
Don’t go through same code path as for key paths, since this requires an
iteration.
@JohnSundell JohnSundell merged commit a0f1fd8 into master Oct 23, 2016
@JohnSundell JohnSundell deleted the 2.2.0 branch October 23, 2016 23:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant