| 1 |
New changes are described in CHANGELOG.md |
| 2 |
|
| 3 |
v0.7.6 -- 2017.03.15 |
| 4 |
* Fix errors in documentation |
| 5 |
* Prevent stack trace related range errors |
| 6 |
|
| 7 |
v0.7.5 -- 2016.01.28 |
| 8 |
* Fix few stack trace overflow vulnerabilities |
| 9 |
* Improve delay arguments handling. `timeout` is now optional |
| 10 |
if not provided then `nextTick` is used |
| 11 |
otherwise proper validation of input value takes place. |
| 12 |
|
| 13 |
v0.7.4 -- 2015.11.18 |
| 14 |
* `every` extension |
| 15 |
* `dynamicQueue` util |
| 16 |
|
| 17 |
v0.7.3 -- 2015.09.10 |
| 18 |
* `find` extension (Array's find for promises) |
| 19 |
* Fix spelling of LICENSE |
| 20 |
|
| 21 |
v0.7.2 -- 2015.01.07 |
| 22 |
* Force assimilation of pre v0.7 deferred promises. |
| 23 |
Using them as own raised serious bugs |
| 24 |
* Configure lint scripts in package.json |
| 25 |
|
| 26 |
v0.7.1 -- 2014.04.27 |
| 27 |
* Update internals to use latest versions of dependencies |
| 28 |
|
| 29 |
v0.7.0 -- 2014.04.04 |
| 30 |
Major (breaking) changes: |
| 31 |
* Fix error handling: |
| 32 |
Up to v0.6.x promise could have been rejected only with error instance, and |
| 33 |
same way they couldn't be successfully resolved with an error instance. It was |
| 34 |
not an issue if we followed good practices, still it didn't match `throw` |
| 35 |
behavior (any JavaScript value can be thrown). Starting from v0.7 promise can |
| 36 |
be rejected and resolved with any kind of value. It's also how promises behave |
| 37 |
in other implementations including upcoming ECMAScript 6 standard. |
| 38 |
* Assimilate foreign promises. Promises from other implemantations (including |
| 39 |
native promises) are detected and assimilated for recursive resolution. |
| 40 |
Addresses issue #29 |
| 41 |
* Rename `promise.match` to `promise.spread`, this is the name under which this |
| 42 |
functionality was popularized in other libraries. |
| 43 |
* Remove `end`, as it was replaced by `done` in v0.6.4 (`end` was kept as an |
| 44 |
alias to not break current programs) |
| 45 |
* Move modules from `lib` to root folder |
| 46 |
|
| 47 |
Other changes: |
| 48 |
* Expose `resolve` and `reject` functions on deferred. It complies to |
| 49 |
`Promise.resolve` and `Promise.reject` |
| 50 |
* Remove Makefile (it's cross-environment package) |
| 51 |
* Fix handling of promise arguments in promisifySync |
| 52 |
|
| 53 |
v0.6.8 -- 2013.12.27 |
| 54 |
* Function version of `invokeAsync` utility (further addresses #26) |
| 55 |
|
| 56 |
v0.6.7 -- 2013.12.27 |
| 57 |
* `callAsync` utility, to promisify asynchronous functions inline in algorithm. |
| 58 |
Fixes #26 |
| 59 |
|
| 60 |
v0.6.6 -- 2013.10.14 |
| 61 |
* Fix stack overflow vulnerability in `reduce` implementation, as diagnosed |
| 62 |
here: https://github.com/cujojs/promise-perf-tests/blob |
| 63 |
/e58b90c2660914411c96efe854446444160b592a/lib/tests/reduce-large.js#L25 |
| 64 |
* Introduce `examples` directory. First examples introduced by |
| 65 |
Marc-Aurèle DARCHE (@madarche). Thanks! |
| 66 |
* Improve benchmarks, and add kew and bluebird to them (and remove jQuery) |
| 67 |
* Documentation: Fix profiler example and general improvements |
| 68 |
|
| 69 |
v0.6.5 -- 2013.06.05 |
| 70 |
* `catch` extension |
| 71 |
* Unify listeners handling in promises handled by gate |
| 72 |
* Improve documentation |
| 73 |
|
| 74 |
v0.6.4 -- 2013.05.15 |
| 75 |
* Rename `done` to `end` and leave `end` as an alias for `done`. |
| 76 |
With v0.7 release `end` alias will be removed. |
| 77 |
|
| 78 |
v0.6.3 -- 2013.03.21 |
| 79 |
* promise.finally extension |
| 80 |
|
| 81 |
v0.6.2 -- 2013.03.18 |
| 82 |
* Provide deferred.reject to allow configuration of v0.7 safe working flows |
| 83 |
* Do not require whole event-emitter but just needed modules |
| 84 |
|
| 85 |
v0.6.1 -- 2012.10.05 |
| 86 |
* Fix profiler paths detection to work on Windows systems |
| 87 |
* Fix monitor test so it's not dependent on order in which is run |
| 88 |
* Added When implementation to benchmarks |
| 89 |
|
| 90 |
v0.6.0 -- 2012.09.22 |
| 91 |
Major refactor, with focus on performance and better modularization. |
| 92 |
* New Deferred is about x3 faster than v0.5 version |
| 93 |
* Promise is now also an event emitter |
| 94 |
* Better extensions system (deferred.extend) |
| 95 |
* `aside` extension (derived from `cb`), that allows to split promise chain |
| 96 |
* New `cb` extension with different semantics, allows escaping promise chain |
| 97 |
with typical asynchronous function callback |
| 98 |
* Refactored Array#map, it doesn't support any more limit argument (it should be |
| 99 |
now achieved with help of deferred.gate) |
| 100 |
* Refactored Array#reduce, added support for sparse arrays |
| 101 |
* Array#some - added support for sparse arrays |
| 102 |
* Changed signature of `end` it's now on pair with `then` and newly introduced |
| 103 |
`aside` extension |
| 104 |
* Profiler - gather promise initialization statistics |
| 105 |
* Removed promise.js module, some of it's logic is left as internal _ext.js |
| 106 |
module and other part was merged into deferred.js |
| 107 |
* Benchmarks |
| 108 |
|
| 109 |
v0.5.6 -- 2012-07.17 |
| 110 |
(Maintenance, as v0.6 is nearly ready for rollout). |
| 111 |
Added workaround for for v8 bug (eminent in Node v0.6): |
| 112 |
Defining property via descriptor on plain function, prevents us from |
| 113 |
setting same property directly later on different function. |
| 114 |
|
| 115 |
v0.5.5 -- 2012.06.13 |
| 116 |
* deferred.some - (array & promise extension). Promise aware Array's some for |
| 117 |
array-like objects. |
| 118 |
* Fix handling of callbacks in `cb` promise extension. Only success callback |
| 119 |
mode was not handled correctly. |
| 120 |
* Mark functions that returns promises with 'returnsPromise' flag, and provide |
| 121 |
awareness of that in `promisify` extensions, so they return same functions |
| 122 |
back if they're called on such. |
| 123 |
* Files reorganization so internal modules are no longer in utils folder but |
| 124 |
instead are prefixed with '_' (it's convention we use in other projects) |
| 125 |
|
| 126 |
v0.5.4 -- 2012.05.28 |
| 127 |
* deferred.gate - (function extension) Handles maximum concurrency number for |
| 128 |
given asynchronous task. Additionally postponed calls queue length can also be |
| 129 |
limited to chosen number |
| 130 |
* Modify code so we can use es5-ext at it's latest version |
| 131 |
|
| 132 |
v0.5.3 -- 2012.05.04 |
| 133 |
* Fixed resolution of synchronous calls in a queue of map extension, they were |
| 134 |
not resolved as expected |
| 135 |
|
| 136 |
v0.5.2 -- 2012.05.02 |
| 137 |
* Fixed serious issue in `get` extension, which in some scenarios made errors in |
| 138 |
following resolved flow silent |
| 139 |
|
| 140 |
v0.5.1 -- 2012.04.29 |
| 141 |
* Fixed error handling in invoke extension for case in which context object is |
| 142 |
null or undefined |
| 143 |
|
| 144 |
v0.5.0 -- 2012.04.18 |
| 145 |
* Addons & Improvements |
| 146 |
* Resigned from dual async/sync: `invoke` extension and `promisify` method. |
| 147 |
Such abstraction lead to unexpected results in some cases. |
| 148 |
`invokeSync` is from now on `invoke` (`invokeSync` is no longer available), |
| 149 |
`promisifyAsync` is now `promisify` (`promisifyAsync` is no longer |
| 150 |
available). |
| 151 |
* Brought back `cb` extension in slightly different form. It's useful for |
| 152 |
creating "hybrid" asynchronous functions that both take callback and return |
| 153 |
promise, it can also be useful if we want to split promise chain, return |
| 154 |
promise and carry on with other flow. |
| 155 |
* `get` now accepts more than one argument, this way we can with one call get |
| 156 |
to nested properties of object |
| 157 |
* `extend` functions that helps in configuration of promise extensions now |
| 158 |
accepts array of validation functions that should be called on extension |
| 159 |
initial call. |
| 160 |
* Input arguments of promise extensions are now validated on initial call. |
| 161 |
It is quite important as error now can be easily tracked down, if we |
| 162 |
propagate our error to some next event loop it's more problematic. |
| 163 |
|
| 164 |
* Fixes |
| 165 |
* Arguments validation in `extend` function was broken |
| 166 |
* When run on resolved promises, errors invoked by some extensions where not |
| 167 |
propagated into promise chain as expected |
| 168 |
|
| 169 |
v0.4.3 -- 2012.02.20 |
| 170 |
* Improvements: |
| 171 |
* Added support for fourth argument in deferred.map through which we can set |
| 172 |
maximum number of tasks that should be run simultaneously |
| 173 |
* Exposed `promisifyAsync` and `promisifySync` on deferred, and exposed by |
| 174 |
default `invokeSync` and `invokeAsync` promise extensions |
| 175 |
* Added possibility to add just onsuccess callback to `end` |
| 176 |
* Optimize internal logic by reducing number of created unresolved promises |
| 177 |
* Code validation with JSLint |
| 178 |
|
| 179 |
* Fixes: |
| 180 |
* Removed invalid doubled call from invoke extensions |
| 181 |
* Handle exceptions thrown by asynchronous functions |
| 182 |
|
| 183 |
v0.4.2 -- 2012.01.26 |
| 184 |
* Optimization. Cut down promise creation time about 60% |
| 185 |
|
| 186 |
v0.4.1 -- 2012.01.26 |
| 187 |
* Fixed logic error for multi argument `deferred` call. It was same case as with |
| 188 |
`map` fixed with v0.4.0: In specific cases resolve was called in callback |
| 189 |
passed to promise, cause of that any errors that occurred in same event loop |
| 190 |
were silent. |
| 191 |
|
| 192 |
v0.4.0 -- 2012.01.19 |
| 193 |
* Changed the way `end` behaves: |
| 194 |
* When called without arguments, throws error if promise is rejected |
| 195 |
* When called with one function argument, it's treated as callback passed to |
| 196 |
Node.js style asynchronous function. When promise is resolved it is called |
| 197 |
with two arguments, first is error if promise is rejected, second is |
| 198 |
resolved value if promise succeeds. |
| 199 |
* When called with two function arguments, first one is taken as onsuccess and |
| 200 |
second as onerror (it behaves similar as `then` but it doesn't extend chain |
| 201 |
with another promise) |
| 202 |
* It no longer returns its promise |
| 203 |
* Fixed `map` extension. There was logic error: in specific cases resolve of map |
| 204 |
was called in callback passed to promise, cause of that any errors that |
| 205 |
occurred in same event loop were silent. |
| 206 |
* Removed `cb` extension as now `end` has same functionality |
| 207 |
|
| 208 |
v0.3.1 -- 2012.01.13 |
| 209 |
* Promisify and invoke extension now resolves also input arguments before |
| 210 |
calling the function |
| 211 |
* Possibility to preset fixed number of arguments for promisified function, |
| 212 |
it makes promisified functions less error prone |
| 213 |
|
| 214 |
v0.3.0 -- 2012.01.08 |
| 215 |
Major update: |
| 216 |
* Revised promise collections approach: |
| 217 |
There's no longer all, join & first functions. |
| 218 |
Instead we may use deferred for grouping promises: deferred(p1, p2, p3) |
| 219 |
or use map or reduce extensions e.g. deferred.map(paths, readFile). See |
| 220 |
documentation for more info |
| 221 |
* Introduced promise extensions. |
| 222 |
* cb - end promise chain with regular asynchronous callback |
| 223 |
* get - get property of resolved object |
| 224 |
* invoke - invoke function on resolved object (supports both synchronous and |
| 225 |
asynchronous functions) |
| 226 |
* map - promise aware version of Array's map |
| 227 |
* match - match result array to function arguments |
| 228 |
* reduce promise aware version of Array's reduce |
| 229 |
* Replaced asyncToPromise (used as a2p or ba2p) and syncToPromise (used as s2p |
| 230 |
or bs2p) with 'promisify', it works as 'bind' version for both asynchronous |
| 231 |
and synchronous functions and is available on deferred as deferred.promisify. |
| 232 |
It has also been improved to support asynchronous functions that return more |
| 233 |
than one value. |
| 234 |
* Rewritten internal logic. Currently promises are backed with _base object |
| 235 |
which is different for resolved and unresolved promises |
| 236 |
* Removed nextTick rule, no new event loops are introduced by deferred. |
| 237 |
* Unresolved promises can now be tracked via deferred.MONITOR |
| 238 |
* valueOf promise function. Returns self promise if unresolved and resolved |
| 239 |
value if resolved |
| 240 |
* isPromise returns true only for deferred's like promise, as deferred api |
| 241 |
diverged from other promises implementations it's no open anymore to work |
| 242 |
with foreign promises. |
| 243 |
* Exposed 'isPromise' & 'delay' functions on deferred |
| 244 |
|
| 245 |
v0.2.6 -- 2011.12.12 |
| 246 |
* Cleared npm warning for misnamed property in package.json |
| 247 |
|
| 248 |
v0.2.5 -- 2011.11.08 |
| 249 |
* Fix for bug introduced with node.js >= 0.5.7 ( https://github.com/joyent/node/issues/1877 ) |
| 250 |
|
| 251 |
v0.2.4 -- 2011.08.09 |
| 252 |
* Expose 'promise' function on deferred object returned by index.js. |
| 253 |
There are valid use cases for using it outside of deferred lib |
| 254 |
|
| 255 |
v0.2.3 -- 2011.08.09 |
| 256 |
* 'delay' function: delay execution of given function, |
| 257 |
return promise for function result |
| 258 |
|
| 259 |
v0.2.2 -- 2011.08.08 |
| 260 |
* Added TAD test suite to devDependencies, configured test commands. |
| 261 |
Tests can be run with 'make test' or 'npm test' |
| 262 |
|
| 263 |
v0.2.1 -- 2011.08.08 |
| 264 |
* Use process.nextTick instead of setTimeout if available |
| 265 |
|
| 266 |
v0.2.0 -- 2011.08.08 |
| 267 |
* Renamed 'chain' dir into 'join' as it's more about joining promises |
| 268 |
* promise is now promise.then function (promise === promise.then) |
| 269 |
* resolve returns promise, handful for quick function returns |
| 270 |
(return d.resolve(x)) |
| 271 |
* syncToPromise function |
| 272 |
* Compatibility with es5-ext v0.6 |
| 273 |
* Test with TAD |
| 274 |
|
| 275 |
v0.1.2 -- 2011.07.11 |
| 276 |
* Make it possible to use it with older JavaScript implementations |
| 277 |
* Removed dead code |
| 278 |
* Better tests coverage |
| 279 |
|
| 280 |
v0.1.1 -- 2011.07.07 |
| 281 |
* Documentation |
| 282 |
|
| 283 |
v0.1.0 -- 2011.07.05 |
| 284 |
* Initial version |