Skip to content

Releases: seangwright/typescript-functional-extensions

v3.0.0 - New Result/Async methods, build process

01 May 21:34
6f304dc
Compare
Choose a tag to compare

What's Changed

New Contributors

Upgrade from v2.0.0 to v3.0.0 (generated by Warp)

  1. Audit Existing Code

    • Identify and list all usages of the old bindFailure() and bindFailureAsync() methods.
    • Locate all references to ResultValueOf<T> and plan for rename to ResultValue<T>.
  2. Replace Deprecated Methods

    • Change all bindFailure() calls to compensate() and ensure the error parameter is accommodated in your function signature.
    • Change all bindFailureAsync() calls to compensateAsync() with the new error parameter signature.
  3. Update Type Definitions

    • Rename all ResultValueOf<T> occurrences to ResultValue<T>.
    • Use ResultValue<T> for both synchronous and asynchronous handling.
  4. Integrate New APIs

    • Evaluate usage of the new Result.combineAsync(), Result.combineInOrderAsync(), ResultAsync.combine(), and ResultAsync.combineInOrder() methods in relevant asynchronous flow.
    • Explore using the new ResultRecord<T> type where key-value result pairs are needed.
  5. 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.
  6. 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

07 May 01:52
Compare
Choose a tag to compare

What's Changed

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 Promises. 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

28 Sep 02:52
Compare
Choose a tag to compare

What's Changed

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

03 Jun 01:47
Compare
Choose a tag to compare

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 🐱‍🏍

23 Apr 14:35
Compare
Choose a tag to compare

What's Changed

  • feat(result): support combining multiple results by @GregOnNet in #8

New Contributors

Full Changelog: v1.1.1...v1.2.0

v1.1.1 - GitHub Actions integration ⚙

23 Apr 14:09
Compare
Choose a tag to compare

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

11 Jan 19:18
bf9e148
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.1...v1.1.0

v1.1.0-beta.2 - Pipe operator

10 Jan 23:09
ff85358
Compare
Choose a tag to compare
Pre-release

Test release for adding .pipe() method to all monads
#6

v1.0.1 - CommonJs support

31 Dec 15:27
ff85358
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Initial Release 🎉

27 Dec 18:52
Compare
Choose a tag to compare
  • Add tests for all types/methods
  • Add jsdoc comments for all public methods for all types
  • Update README.md with examples