Releases: seangwright/typescript-functional-extensions
v3.0.0 - New Result/Async methods, build process
What's Changed
- feat(api): pass error to bindFailure & bindFailureAsync projection by @nullNaNNaN in #23
- ref: rename bindFailure(Async) to compensate(Async) by @GregOnNet in #26
- infra: vitest package updates by @GregOnNet in #29
- chore(jest): remove config by @GregOnNet in #33
- feature: combineInOrderAsync by @GregOnNet in #35
- feat: conbineAsync by @GregOnNet in #31
- Feature: Packaging updates by @seangwright in #39
New Contributors
- @nullNaNNaN made their first contribution in #23
Upgrade from v2.0.0 to v3.0.0 (generated by Warp)
-
Audit Existing Code
- Identify and list all usages of the old
bindFailure()
andbindFailureAsync()
methods. - Locate all references to
ResultValueOf<T>
and plan for rename toResultValue<T>
.
- Identify and list all usages of the old
-
Replace Deprecated Methods
- Change all
bindFailure()
calls tocompensate()
and ensure the error parameter is accommodated in your function signature. - Change all
bindFailureAsync()
calls tocompensateAsync()
with the new error parameter signature.
- Change all
-
Update Type Definitions
- Rename all
ResultValueOf<T>
occurrences toResultValue<T>
. - Use
ResultValue<T>
for both synchronous and asynchronous handling.
- Rename all
-
Integrate New APIs
- Evaluate usage of the new
Result.combineAsync()
,Result.combineInOrderAsync()
,ResultAsync.combine()
, andResultAsync.combineInOrder()
methods in relevant asynchronous flow. - Explore using the new
ResultRecord<T>
type where key-value result pairs are needed.
- Evaluate usage of the new
-
Test and Validate
- Update unit tests and integration tests to confirm that signature changes and renamed types compile and function correctly.
- Ensure all new asynchronous methods (e.g.,
combineInOrderAsync()
) handle concurrency and error scenarios properly.
-
Deployment and Documentation
- Update project documentation to reflect the changes in method names, signatures, and types.
- Deploy incrementally to test environments before final production rollout.
Full Changelog: v2.0.0...v3.0.0
v2.0.0 - Expand fetch helpers, new Result methods
What's Changed
- Feature: Improve API helpers and error handling callbacks by @seangwright in #18
- Feature: Result.tapEither/Async by @seangwright in #19
- feat(api): add bindFailure & bindFailureAsync by @GregOnNet in #22
fetchResponse
fetchResponse
now returns the Response
instead of Unit
, giving the consumer more context to inform their next steps. This is a breaking change.
The error handlers for fetchResponse
and fetchJsonResponse
can now return Promise
s. This can be helpful if, for example, an API request returns a 400 response with a JSON body that needs to be unwrapped with response.json()
.
tapEither
Result.tapEither
, Result.tapEitherAsync
, and ResultAsync.tapEither
can all be used to perform a side effect action independent of the result succeeding or failing. This can be useful if, for example, the state of a component (ex: isLoading
) should be toggled when the result of an operation completes - either in a success or failure scenario.
bindFailure
Result.bindFailure
, Result.bindFailureAsync
, and ResultAsync.bindFailure
can be used to convert a failed result to another result. This covers the combination of bind
and mapFailure
.
Full Changelog: v1.4.0...v2.0.0
v1.4.0 - Native ESM support 🧘🏽♀️, Vitest, and Utility Functions
What's Changed
- Feature: Better docs and utility functions by @seangwright in #12
- Feature: Native ES Module support & Vitest by @seangwright in #15
You can now use typescript-functional-extensions
directly from Unpkg as mentioned in the README
Docs have been updated in the README to include the full list of module exports, the size of these modules, and better examples of how the monads in the library might be used.
Work has also begun on more detailed docs for each monad that complement the library's unit tests.
All unit tests have been migrated from Jest to Vitest for faster test runs and a much simpler test configuration when using ESM.
A few new utilities have been added to the library as pure functions instead of methods on the monads so that bundlers can more easily tree-shake them away if they are unused.
import {
noop,
zeroAsNone,
emptyStringAsNone,
emptyOrWhiteSpaceStringAsNone,
} from 'typescript-functional-extensions';
A few methods missing from MaybeAsync
have been added:
getValueOrDefault
getValueOrThrow
Full Changelog: v1.3.0...v1.4.0
v1.3.0 - 🛡 Type Guards for Result to access error and value
What's Changed
- feat(Result): Expose value or error if it is safe to expose by @GregOnNet in #10
To see how this feature works, check out the new tests for Result
Full Changelog: v1.2.0...v1.3.0
v1.2.0 - Result.Combine 🐱🏍
What's Changed
- feat(result): support combining multiple results by @GregOnNet in #8
New Contributors
- @GregOnNet made their first contribution in #8
Full Changelog: v1.1.1...v1.2.0
v1.1.1 - GitHub Actions integration ⚙
This is a non-functional update that adds GitHub Actions publishing to the repository and updates the npm package metadata.
v1.1.0 - Pipe operator
v1.1.0-beta.2 - Pipe operator
Test release for adding .pipe()
method to all monads
#6
v1.0.1 - CommonJs support
What's Changed
- Feature: Add CommonJS support by @seangwright in #5
New Contributors
- @seangwright made their first contribution in #5
Full Changelog: v1.0.0...v1.0.1
v1.0.0 - Initial Release 🎉
- Add tests for all types/methods
- Add jsdoc comments for all public methods for all types
- Update README.md with examples