Releases: fluture-js/Fluture
7.1.0
✨ New features
- Added an
alt
function to use withAlt
types such asConcurrentFuture
. - Added
of
,ap
,map
,alt
andzero
functions toPar
, making theConcurrentFuture
type Static Land -compliant.
✨ Improvements
- All TypeScript interfaces are now exported.
- Typescript definitions for
ap
andmap
are now overloaded to work onConcurrentFuture
instances as well asFuture
instances. - Added Typescript definitions for
extractLeft
andextractRight
methods.
7.0.0
- #129 Some TypeScript projects might break due to the increased strictness introduced by type definitions.
- b3851fe The
chainRec
named export has been removed in favor of regular recursion.
✨ New features
- #129 Projects which consume Fluture as an ES6 module can now enjoy full TypeScript support!
6.3.0
✨ Improvements
- #128 The performance of transforming Futures has improved significantly.
- #131
Future.parallel
has been made stack-safe. - #131
Future.parallel
now guarantees execution order. - #132 Improve version interoperability.
🗒️ Note
6.3.x
futures will not be compatible with 6.2.x
Futures, so when upgrading, make sure to upgrade all producers of Future instances.
To avoid having to do this with future releases, I recommend setting Fluture as a peerDependency if you are maintaining a library which exposes Future instances to its users.
🐛 Bug fixes since 6.2.6
Changes between 6.0.1 and 6.2.6
✨ New features
- #111 Add
Future.done()
andFuture#done()
: an easy way to fork using a Nodeback.
🐛 Bug fixes and improvements
- #108 Correct a common typo in many error messages.
- #109 Fix Static Land compliance of the Future type representative exported by the module build.
- e24fa0f A problem related to the order in which asynchronous actions were executed was resolved
- e24fa0f Parallel actions are now cancelled appropriately as one early-terminates
- 9296445 Optimize when parallel actions are executed
- 446a27f Prevent asynchronous concurrent actions from running twice
- 9c5900b Improve
chain
s interoperability of different compatible versions of Fluture - f434193 Make
Future#both()
cancel the other when the one rejects.
6.0.1
- #80 The ES5 import has been moved from
fluture/es5
tofluture
. - #80 The
Future#hook
method (but not the function) has been removed. - #80 The
Future#cache
method (but not the function) has been removed. - #80 Old environments are asked to bring their own polyfills for
Object.create
,Object.assign
andArray.isArray
. - #96 The arguments to the
ap
-method have been flipped back. - #97
and
andor
no longer run the two Futures in parallel. - #98
fromPromise
has been renamed toencaseP
. - 1a636d5
chainRec
is no longer curried and direct use is now discouraged.
✨ New features
- #80 Added an ES6 module for use with tools like Rollup.
- #80 All transformations, including recursive
chain
, are now stack safe! - #80 Added
isNever
. - #98 Added
tryP
, the nullary version ofencaseP
.
🐛 Bug fixes and improvements
- #98 Errors thrown while transforming Futures produced by
tryP
orencaseP
no longer get caught (and silenced) by the Promise. - #80 User-supplied functions no longer have strict arity requirements.
- #80
Future.hook
no longer cancels the acquire Future after it has settled. - #80
Future.hook
now always cancels running Futures appropriately. - #80 Added aliases
attempt = try
,go = do
,lastly = finally
. - #102 Supplying incompatible or outdated instances of Fluture now throws more
sensible error messages. - 192c34b Added fast failure to
encase
andencaseP
.
5.0.0
- #74 The argument order of
Future.or()
has been flipped - #75
Future.isForkable()
has been removed - #75
Future.fromForkable()
has been removed - #75
Future.cast()
has been removed - #59 (Sanctuary)
S.is(Future, Future.of(1))
now returnstrue
rather thanfalse
- #59 (Sanctuary) Fluture now requires its type to be defined to be used in polymorphic functions
✨ New features
- #70 Add a new ConcurrentFuture type
🐛 Bug fixes and improvements
4.0.0
Future.recur
has been removed in favor ofFuture.chainRec
.- #38
Future.ap
is no longer parallel. Instead one might useFuture.and
orFuture.both
. - #38
of
andfantasy-land/chainRec
are no longer available on the prototype.
✨ New features
- #34 Casting a Future to string now shows a much more friendly representation.
- #39
Future.rejectAfter
has been added as a counterpart toFuture.after
. - #40
Future.and
has been added as a counterpart toFuture.or
. - #41
Future.both
has been added as an alias toFuture.parallel(2, [a, b])
. - #42 Static
ap
,map
,bimap
andchain
functions can now handle native
algebraic data types, courtesy of sanctuary-type-classes.
🐛 Bug fixes and improvements
- #4 Several curried functions have been made to fail the moment they receive an invalid argument.
- #34 When a cached Future is cancelled, its other subscribers are not unsubscribed.
- #34 When a hooked Future is cancelled, the disposal Future is still forked (and cancelled).
- #34 Some Futures were not being automatically cancelled when no longer needed.
- #42 Improved string representations of values in error messages, courtesy of
sanctuary-type-classes.
🚀 Performance
- #34 Performance of
Future.race
has trippled. - #34 Performance of
Future.cache
has doubled. - #34 Performance of
Future.chainRec
has improved by 50%. - #34 Performance of
Future.parallel
has improved by 30%. - #34 Performance of all other functions has improved by 10%-20%.
⬆️ Upgrading
Refactor code using Future.recur
into code using Future.chainRec
const repeat = (x) => Future.after(10, x).map(add(1)).recur(repeat);
repeat(1).fork(...)
- becomes
Future.chainRec((next, done, x) => Future.after(10, x).map(add(1)).map(next), 1)
.fork(...)
Use Future.both
over Future.ap
for parallelism
Future.of(1).ap(Future.of(add(1)))
- becomes
Future.of(1).both(Future.of(add(1))).map(([x, f]) => f(x))
Use Future.parallel(Infinity)
over sequence(Future.of)
sequence(Future.of, [m1, m2, m3])
- becomes
Future.parallel(Infinity, [m1, m2, m3])
Access of
via constructor
property
const empty = m => m.of()
- becomes
const empty = m => m.constructor.of()