Skip to content

Releases: seasonedcc/composable-functions

v2.5.1

01 Nov 12:07
dbaf88e
Compare
Choose a tag to compare

What's Changed

  • Fix double decoding URIError when using input resolvers by @diogob in #118

Full Changelog: v2.5.0...v2.5.1

v2.5.0

24 Oct 20:49
b00d471
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.4.0...v2.5.0

v2.4.0

20 Sep 13:53
383b3ca
Compare
Choose a tag to compare

What's Changed

The zod peer dependency is now gone. This is a backwards compatible change since we still use a subtype of zod parsers and will keep tracking zod interface as our de-facto standard. However, this opens the possibility of adaptors for other libraries as well.

Full Changelog: v2.3.0...v2.4.0

v2.3.0 - "Conditional `pipe`" and `mdf` alias ✂️

12 Sep 21:47
14b1e1b
Compare
Choose a tag to compare

New Features

  • We now export mdf alias for makeDomainFunction so your compositions will look less verbose by @gustavoguichard in #111
  • Improved branch method to act like conditional pipe by @gustavoguichard in #112

You can now conditionally pipe by returning null from a branch, e.g:

// Check out the new `mdf` alias!
import { mdf, branch } from 'domain-functions'
import z from 'zod'

const a = mdf()(Math.random)
const b = mdf(z.number())(String)
// This function will only pipe to `b` if the output of `a` is greater than 0.5
const df = branch(a, output => output > 0.5 ? b : null)
//     ^? DomainFunction<number | string>

The branch method will keep working as always if you return other domain functions from it:

import { mdf, branch } from 'domain-functions'

const a = mdf()(Math.random)
const b = mdf()(() => 'high')
const c = mdf()(() => 'low')
const df = branch(a, output => output > 0.5 ? b : c)
//     ^? DomainFunction<'high' | 'low'>

Other changes

  • Expose and add JSDocs to safeResult to allow people to build their own combinators by @gustavoguichard in #110

Full Changelog: v2.0.0...v2.3.0

v2.2.0 - Rollback @decs/typeschema 😅

11 Sep 14:49
2cd2832
Compare
Choose a tag to compare

What's Changed

In version 2.1.0 we released the possibility of using domain-functions with other schema validation libraries through @decs/typeschema but we missed a breaking change due to optional peerDependencies on typeschema that would require bundler configuration changes or installing a bunch of peerDependencies on each project.

We are rolling back indeterminately.

domain-functions v2 🎉

16 Aug 21:20
2cd2832
Compare
Choose a tag to compare

🔥 Breaking changes

  • Removed the qs dependency so some inputRessolvers might return different results for a few edge cases.
  • Removed errorMessagesForSchema, it seems to be used only in remix-forms. We will move this code there.
  • Removed deprecated types List and ListToResultData, check #101

😎 New feature

  • The bundle size was reduced from 37.9kB (11.4kB gzipped) to 5.7kB (1.8kB gzipped) 🧙🏿‍♂️.
  • collectSequence combinator. It is a sequential version of collect and uses the input object keys' order to determine the sequence of functions to be called.
  • DX improvement: JSDocs with inline documentation of every public method #90

🧹 Housekeeping

  • Use a test-prelude to keep test imports in a central location, also upgrade our std library version used for testing.
  • We've updated our Remix example with newer remix versions and domain-functions conventions. #93
  • We simplified the implementation of some combinators #89 and #87

Full Changelog: v1.8.0...v2.0.0

v1.8.0 - 'branch' for conditional compositions 🔀

31 Jul 17:49
75d6679
Compare
Choose a tag to compare

Updates

We just introduced a new branch combinator. Check it out in the README, you'll love it!
The branch function makes it easy to express more complex conditions in your compositions. It accepts 1 domain function and a predicate function that should return another domain function. You can use the output of the first function to make some conditional check and decide between the next possible domain function to run. It works sequentially like pipe.

const prelude = makeDomainFunction()(() => ({ total: 2, next: 'multiply' }))
const sum = makeDomainFunction(z.object({ total: z.number() }))(n => n + 1)
const multiply = makeDomainFunction(z.object({ total: z.number() }))(n => n * 2)

const df = branch(prelude, output => output.next === 'multiply' ? multiply : sum)
//    ^? DomainFunction<number>

What's Changed

Full Changelog: v1.7.1...v1.8.0

v1.7.1

31 Jul 12:28
2f483d3
Compare
Choose a tag to compare

What's Changed

New Contributors 🎉

Full Changelog: v1.7.0...v1.7.1

v1.7.0

21 Mar 12:55
a04a82e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.1...v1.7.0

v1.6.1

27 Feb 16:15
1c1a0b6
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.6.0...v1.6.1